The numbers: Sales at U.S. retailers rebounded in June as Americans flocked to bars and restaurants and bought the latest summer fashions, pointing to an accelerating U.S. economy.

Retail sales increased 0.6% last month in a much better showing than Wall Street had expected. Economists polled by The Wall Street Journal forecast a 0.4% decline.

Households are still buying plenty of goods, but they have increasingly shifted their spending toward services they avoided during the pandemic: Dining out, entertainment, travel, vacation trips and so forth.

Sales jumped 2.3% in June, the government said Friday, and rose sharply for the fourth month in a row. Through the first six months of 2021 receipts are up almost 38%.

Consumers also would have bought more new cars and trucks last month, but automakers can’t produce enough of them because of a shortage of computer chips. Semiconductors are now a critical component in modern vehicles.

Excluding autos, retail sales advanced 1.3% — almost three times as much as Wall Street expected.

Big picture: Most households have plenty of money to spend thanks to massive government stimulus, a rapidly recovering economy and a robust jobs market. There’s little likelihood spending will drop off soon so long as Covid cases remain low.

Strong household spending is expected to keep the economy humming through the end of the year. Consumer outlays account for about 70% of U.S. economic activity.

The one negative: Some of the increase in spending reflects higher inflation. The cost of living has jumped 5.4% in the past year — the fastest pace since 2008.

Americans are paying more for a variety of goods and services, but the Federal Reserve contends it’s just temporary. The reopening of the economy has led to a surge in pentup demand that businesses are unable to satisfy all at once.

Key details: Grocers, apparel outlets, big-box electronics stores, department chains and Internet retailers all posted strong sales gains in June.

Internet sales got a boost from Amazon’s AMZN, 0.24% Prime Day shopping bonanza.

Sales also rose 2.5% at gas stations as Americans reverted to pre-pandemic driving patterns, but they are also paying more at the pump. Gas prices have risen sharply this year.

Sales fell at auto dealerships, home centers and stores that sell home furnishings.

Auto receipts declined 2% in June. Lots of people want to buy new or used cars, but prices have soared in light of a shortage of available vehicles. Auto purchases account for about one-fifth of all U.S. retail sales.

The high cost of lumber and scarcity of homes for sale, meanwhile, likely contributed to the weak results at stores that sell furnishings or materials for home-renovation projects and the like.

Market reaction: The Dow Jones Industrial Average DJIA, 0.16% and S&P 500 SPX, 0.30% were set to open higher in Friday trades.