U.S. inflation eased to 3.4% in July as core CPI hit 2.5%, giving the Federal Reserve room to remain patient.

Inflation is still well above the Federal Reserve’s target of 2%, and many investors and Fed watchers expect an interest rate increase this year.

Inflation in the U.S. slowed in July and a measure of underlying price pressures also cooled, according to official data Wednesday that suggested higher...