Investors are betting the inflationary streak that has sent prices of everything from used cars to lumber soaring will fade in the coming years, a reassuring sign for markets struggling to find direction.

Few issues have vexed money managers more this year than inflation. As the global economy has regained its footing, prices for goods and services have risen—in many cases far faster than economists had anticipated. Labor shortages and supply-chain disruptions snarling the global shipping industry have added to inflationary pressures.

The trend has worried many investors, since inflation can chip into companies’ profit margins, pressuring share prices. It can also eat away at the purchasing power of government bonds’ fixed returns. In the days ahead, investors will get a look at fresh economic data including factory orders, vehicle sales and the monthly employment report.

Yet markets are starting to signal that investors may be growing less fearful.

Take the break-even rate. Calculated by measuring the difference in yields between Treasurys and their inflation-protected counterparts, or TIPS, the break-even rate shows how much inflation traders anticipate over a period of time. Since peaking for the year in May, the break-even rates for five-, seven-, and 10-year Treasurys have all fallen—suggesting traders are pricing in a moderation in inflation in coming years.

In another twist, the five-year break-even rate, which currently trades around 2.58%, has surpassed the 10-year rate, which sits around 2.43%. In contrast, the Labor Department’s main gauge of consumer prices jumped 5.4% in June from the 12 months prior—the biggest rise in prices recorded since August 2008.

Put in other words: traders know inflation is hot now; but they are betting that price pressures will ease up significantly, not just in the next few years but over the next decade.

“Markets seem to be taking it in stride,” said Jeffrey Kleintop, chief global investment strategist at Charles Schwab, noting stock indexes from the U.S. to Europe have managed to climb to records in the past month.

While some of his peers continue to fear inflation will rise at levels that might force the Federal Reserve to step in and sharply rein in its easy-money policies, Mr. Kleintop isn’t as concerned. If there is anything he’s worried about these days, it is that the fast-spreading Delta variant of Covid-19 might wind up disrupting the U.S. recovery.

Recent swings in stock and bond markets “seem more driven by prospects for a downturn driven by more [pandemic-related] lockdowns, rather than downturns from withdrawn support from the Fed,” Mr. Kleintop said.

Housing costs have been rising rapidly and could continue to boost inflation rates.

Housing costs have been rising rapidly and could continue to boost inflation rates.

Photo: Micah Green/Bloomberg News

Economists had expected inflation numbers to be elevated this spring and summer thanks to comparisons to deeply depressed prices a year earlier. But they have far exceeded even those expectations.

In April, May and June, the consumer-price index rose a non-seasonally adjusted 0.9% on average, 0.6 percentage point higher than the average over that period from 2010 through 2019.

Investors, though, have hardly been rattled.

CPI inflation swaps—derivatives used by traders to make precise inflation bets—indicate investors are looking for just one or two more months of eye-popping inflation, with the non-seasonally adjusted CPI index expected to rise 0.6% in July—a month in which, on average, it didn’t rise at all in the 2010-2019 period. After August, monthly inflation is expected to be only a little above average, though year-over-year readings could still exceed 5% before dropping sharply next year.

Used cars and trucks play a major part in investors’ thinking. In June, their prices rose 10.5% from the previous month, driving a third of the rise in overall CPI. Many, though, believe used-car prices could rise more slowly later in the year or even decline, as auto companies ramp up the supply of new cars and consumers start shopping more carefully.

Overall, the consensus on Wall Street is that different supply shortages will, one by one, eventually be resolved; at the same time, consumer demand will normalize as the government sends less money to households with the expiration of coronavirus-relief programs.

The U.S. inflation rate reached a 13-year high recently, triggering a debate about whether the country is entering an inflationary period similar to the 1970s. WSJ’s Jon Hilsenrath looks at what consumers can expect next. The Wall Street Journal Interactive Edition

Markets are saying “yes, we might get some strong inflation, but it’s not likely to be structural inflation,” said Michael Pond, head of global inflation-linked research at Barclays.

Betting on short-term inflation—whether through swaps or off-the-run Treasury-inflation protected securities—has offered unusual opportunities this year. An ICE BofA index of TIPS with remaining maturities of one to nearly five years has returned 4.4% this year, compared with negative 0.1% for non-inflation protected Treasurys of the same maturity range.

Holders of TIPS are compensated with additional principal and coupon payments when CPI rises, meaning they outearn holders of nominal Treasurys if inflation exceeds expectations but earn less if prices don’t rise as much as expected.

“Short-term TIPS have done incredibly well mainly because the inflation compensation component is very large,” said Gemma Wright-Casparius, senior portfolio manager at Vanguard Group, who leads the firm’s actively managed Treasury and inflation bond funds.

Ms. Wright-Casparius said her team added TIPS to Vanguard’s actively managed Treasury funds last year when inflation expectations were deeply depressed but is now more neutral on inflation, seeing the market as adequately priced for what lies ahead.

Some investors and analysts still think high inflation could linger longer than many expect, thanks to both strong consumer demand and continued supply disruptions.

SHARE YOUR THOUGHTS

When do you think inflationary pressures will start to subside? Join the conversation below.

Even if used-car prices decline, other categories such as housing could push in the other direction with household balance sheets in their strongest position in decades, said Aneta Markowska, chief economist at Jefferies LLC.

Long-term inflation expectations have been also closely linked with the outlook for Federal Reserve policy, typically rising whenever it seems the Fed will take a longer time to tighten monetary policy by tapering bond purchases and raising interest rates.

Just in the past few days, the 10-year break-even rate has ticked higher after Fed Chairman Jerome Powell said the central bank had made no decision about when to start reducing bond purchases and would be unlikely to raise rates until it was done with tapering.

Still, for many investors, the overall picture looks more benign than it did a few months ago.

“Our expectation is that inflation is going to settle into a two to three percent clip. And that’s not bad for the market,” said Jason Pride, chief investment officer of private wealth for Glenmede.

Write to Akane Otani at akane.otani@wsj.com and Sam Goldfarb at sam.goldfarb@wsj.com