Companies that sell food and other household staples — many of which have reported increased profits in their latest quarterly earnings — are weighing their next moves on prices as inflation cools.

Food prices have gone up at a faster rate than other consumer goods over the past year, and it’s unclear when prices will stop rising. Food can vary widely in price as companies shoulder costs like ingredients and labor, which can be volatile. Companies say consumers have stayed loyal despite the price increases but are starting to pull back.

Many consumer goods companies have raised prices by double-digit percentages in the past year, a move they often attribute to rising commodity prices. Hershey’s, for example, has said rising costs for sugar and cocoa — a result of weather conditions where those staples are grown — are to blame for its price increases.

But other companies have seen their ingredient costs go down.

Commodities prices are “moving favorably,” said Kraft Heinz’s chief financial officer, Andre Maciel. The company — which makes Heinz 57 Sauce, Lunchables snacks and Jell-O desserts — raised prices by 11 percent in its most recent quarter.

When asked by analysts if Kraft Heinz had raised prices too soon and by too much, the company’s chief executive, Miguel Patricio, said: “I would do everything again.”

But as costs go down, the question is whether the high prices will stay.

Ian Borden, chief financial officer of McDonald’s, said he expected “our pricing levels to also start to come down” along with cooling inflation.

On the other hand, the Clorox’s chief executive, Linda Rendle, told analysts that it did not plan to reduce prices if its costs fell. The company — which sells Burt’s Bees skin care products and Brita water filters, as well as a slew of cleaning products — increased its prices by 16 percent in its most recent quarter.

“We intend for these price increases to stick,” she said.

The jump in prices has allowed some companies to keep increasing profits while selling fewer products. Other companies, such as the energy drink company Monster Beverage, have raised prices and sold more. Both trends point to a consumer who is able to absorb higher prices.

Rodney Cyril Sacks, chief executive of Monster, told analysts that price increases “have not significantly impacted consumer demand.”

But some companies are starting to feel consumers tighten their purse strings, either by buying bulk items or switching to generic brands.

Consumers are “really maximizing their pantries,” said Steven Cahillane, chief executive of Kellogg Company.

“They’re closely managing their household inventories, their pantry inventories, zealously guarding against waste, as you would expect in this environment,” he told analysts.