The headline number matched analyst forecasts and was down from 8.1% in June. On a month-over-month basis, the index rose 0.1%, again matching forecasts.

CPI common, which the central bank says is the best gauge of the economy's performance, was at 5.5%, while June's CPI common was revised sharply up to 5.3%. CPI median edged up to 5.0% in July, while CPI trim eased slightly to 5.4%.

Gasoline prices rose 35.6% in July on an annual basis, slowing from a 54.6% increase in June. Gas prices fell 9.2% in July from June, the largest monthly decline since April 2020.

Grocery prices increased by 9.9% in July, the largest gain since August 1981 and up from 9.4% in June, as the cost of everyday staples such as baked goods and eggs accelerated.

Hot inflation prompted the Bank of Canada last month to hike interest rates by a surprise 100-basis-points. Inflation has been above the central bank's 1-3% control range since April 2021.

(Reporting by Julie Gordon in Ottawa; Additional reporting by Dale Smith; Editing by Peter Graff)