WASHINGTON — U.S. consumer credit increased by $14.17 billion in June from the previous month, exceeding economists’ median forecast of an $11.85 billion gain, according to Federal Reserve data.

Estimates from 14 economists ranged from an increase of $5 billion to $15 billion. The May figure was revised to a decline of $1.08 billion.

Revolving credit, which primarily includes credit card debt, rose by $6.74 billion. Nonrevolving credit, including auto and student loans, increased by $7.43 billion.