The stock market has been nothing short of unpredictable this year. The S&P 500 dropped 21% from Jan. 1 through the end of June, and then rose 12% from July 1 through Aug. 15 before heading back into a downward spiral. On Sept. 13, all three major stock indexes, that is the S&P 500, Dow Jones Industrial Average, and Nasdaq Composite, suffered their worst one-day percentage drops since June 2020, the peak of the COVID-19 pandemic hysteria. Year to date, the S&P 500 is now down 17%. 

The big losses came after fresh inflation data showed that the Core Consumer Price Index (CPI) -- which measures the change in prices excluding those from the food and energy sectors -- rose more than expected in August, up 6.3%, versus 5.9% in July.

But with unpredictability comes volatility, and with volatility comes buying opportunities. Two world-class consumer stocks, Starbucks (SBUX -0.18%) and Chipotle (CMG 0.86%), have had to navigate their way through the high inflationary environment.

Typically for restaurants, rising prices aren't ideal. Consumers are forced to pay more for essential goods, which leaves less money left over for discretionary spending like ordering a Chipotle burrito or buying a Starbucks coffee. Let's take a look at how these restaurant juggernauts are holding up amid the current economic landscape. 

Close-up of person looking at stock chart on cellphone while writing on piece of paper.

Image source: Getty Images.

Chipotle is unfazed

Chipotle stock has been a market-beater since the start of the year, returning just shy of 1% to its shareholders. While the stock hasn't generated jaw-dropping gains, it has significantly outperformed the S&P 500, which has contracted 17% in the same time frame.

In Q2, the name of the game for the fast-casual restaurant chain was its pricing power. When companies can raise prices without losing customers, that's an incredible (and rare) competitive advantage. In the first quarter of 2022, the company increased menu prices by 10.5%, and customers haven't seemed to mind yet.

Total revenue increased 17% year over year in Q2, up to $2.21 billion, while diluted earnings per share climbed 40.2% to reach $9.25. Same-store sales increased 10.1%, and the company continued to build out its digital footprint, with online sales representing 39% of its $2.19 billion in food and beverage revenue. Meanwhile, its operating profit margin surged 230 basis points to conclude at 15.3%.

In addition, CEO Brian Niccol noted in the second-quarter earnings call that the majority of Chipotle's customers are high-income households, which are less likely to stop ordering from the Mexican chain due to rising prices. In August, the company raised menu prices by another 4%. To date, it appears that demand for Chipotle and its burritos is sticky, but moving forward, it'll be interesting to watch if customers start to push back on its higher prices. 

This year, Wall Street analysts forecast the restaurant chain's top and bottom lines to grow 15.8% and 29.3%, respectively. That would be tremendous growth in the midst of an uncertain economy. 

For Starbucks, it's a different story

The narrative is a bit different for famed coffee retailer Starbucks, which has shed 25% of its value year to date. In its third quarter, the company's total net revenue grew 8.7% year over year; meanwhile, its diluted earnings per share fell 18.6% to $0.79. Same-store sales increased just 3%, driven downward by a 44% decline in comparable sales in China, which has recently undergone lockdowns due to a renewed surge in COVID-19.

Its operating margin took a hit as well, dropping 400 basis points to 15.9%, versus 19.9% in the prior year. Unlike Chipotle, Starbucks is really feeling the pressure of inflation on commodity and supply chain costs.

Although Starbucks has raised its prices by roughly 5% over the past 12 months, it doesn't seem to have had the same offsetting effects as Chipotle's price increases. Management did note during the earnings call that despite high inflation and economic turbulence, the company has not experienced a meaningful reduction in customer spending or evidence of consumers "trading down."

That was largely reflected in its rewards program, which enjoyed 13% growth year over year to 27.4 million active members. While the coffee chain could face some growing pains in the immediate term, its business appears largely intact over the long run.

Which stock is the better buy now?

I really like these two stocks over the long run. Both have built incredible brands, and as a result, enjoy loyal customer bases and above-average pricing power. Though Chipotle's price-to-earnings multiple of 63 is much higher than Starbucks' 25, both are trading at similar discounts to historical levels. Over the past five years, Chipotle and Starbucks have carried median price-to-earnings multiples of 69.2 and 29.8, respectively.

Plus, I'd argue that Chipotle deserves a premium valuation at this time due to its superior growth rate. Again, I can't stress it enough that I think both companies will thrive in the long run. But if you had to choose one today, I'd go with Chipotle.