Their businesses are growing quickly, but both McDonald's (MCD -0.91%) and Starbucks (SBUX 0.47%) stocks are trailing the market this year. Investors have poured back into favored tech companies, but they've left these successful fast-food giants out of the 2023 rally.

That oversight could spell opportunity for investors seeking exposure to this recession-resistant industry. With that goal in mind, let's take a closer look at their sales and financial trends to see whether Starbucks or McDonald's is the better fit for your portfolio today.

Growing stronger

People are spending freely in the fast food and fast-casual spaces these days. That fact has made it easier for many national chains, from Shake Shack to Chipotle, to post rising sales through mid-2023.

McDonald's is no exception. Comparable-store sales were up 12% across its global portfolio last quarter and rose 10% in the core U.S. market. This success extended the positive momentum that investors saw in late 2022 and reflects market share gains in a massive, highly competitive industry.

Major growth drivers include improvements to the customer experience, popular menu additions, and a tilt toward digital ordering and delivery. "The McDonald's brand has never been stronger," CEO Chris Kempczinski said in a press release.

Starbucks executives could say the same thing. Sales last quarter rose 10% thanks to a balanced contribution from higher prices and increased customer traffic. This boost beat management's short-term targets, partly thanks to a huge rebound in its China business.

Profiting more

Both companies enjoy high and rising profit margins, but McDonald's prevails in this particular matchup. The fast food giant's heavily franchised selling approach allows it to convert over 40% of revenue into operating profit each year. Starbucks' comparable figure has been improving recently but is still closer to 15% of sales.

Chart showing McDonald's operating margin much higher than Starbucks' since 2014.

MCD Operating Margin (TTM) data by YCharts

Meanwhile, the two companies are leaders when it comes to cash generation, despite Starbucks' recent stumbles in this arena. Today, both chains have ample resources they can use to direct toward growth initiatives. In Starbucks' case, these include adding stores outside of densely populated areas and creating more drive-thru locations. For McDonald's, growth goals include a bigger push into digital ordering and delivery.

The better buy

Their respective stock valuations suggest investors have different expectations for these two businesses. Starbucks is priced at about 3.3 times annual sales, or about the same valuation as Shake Shack, which is much earlier on in its expansion journey. McDonald's is the most highly valued fast food stock today, with a price-to-sales ratio of 9. In Starbucks' case, its valuation has declined significantly from its pandemic highs. McDonald's is closer to that peak level, though.

That difference can best be explained by the fact that Mickey D's is setting new profitability records even today in this inflationary period. Starbucks, on the other hand, is still working to get operating margin back toward 17% of sales.

While both stocks are likely to generate strong returns for patient investors, McDonald's shares will appeal to the risk-averse today. Factors like its industry-leading size and profit margins, plus ample cash flow, make it less likely that the stock will drop far even from its current elevated valuation.

You'll prefer Starbucks, meanwhile, if you like a rebound story. The coffee titan has bounced back completely from prior operating stumbles and seems on pace to engineer another recovery, given its current momentum. In exchange for that uncertainty, you can own the stock for a relative discount, potentially amplifying your returns as you wait patiently for Wall Street to notice how strong both McDonald's and Starbucks' businesses are.