Amazon (AMZN 0.26%) and Costco Wholesale (COST 0.75%) are two powerhouse stocks that, along with Walmart, dominate U.S. retail shopping. They operate completely different business models within this category, and they have both been excellent stocks to own in the past. Heading into 2023, which one is the better buy?

How are they doing today?

Both Costco and Amazon experienced elevated sales growth at the beginning of the coronavirus pandemic, and they're both seeing slowdowns in the current inflationary environment.

In the 2022 third quarter, Amazon's sales increased 15% year over year; meanwhile, Costco's sales rose 8.1% year over year in its 2023 fiscal first quarter (ended Nov. 20). Amazon posted Q3 net income of $2.9 billion as compared with $3.2 billion in the year-ago period, and Costco's net income increased from $1.32 billion in its fiscal Q1 2022 to $1.36 billion in Q1 2023.

Amazon is a much larger company, both in sales and in terms of the businesses it operates. Amazon's core business is retail e-commerce, but Amazon Web Services has become an important part of the company, and Amazon runs various other businesses such as its device unit and its just-walk-out technology. It also recently purchased MGM Studios and the iRobot equipment maker. 

Costco sticks with its warehouse membership shopping club model, although that has developed from a supermarket-style chain to offering everything from a full travel service to designer clothing and a hearing aid clinic. 

What can we expect this year?

Amazon started the year by slashing 18,000 jobs, like many tech companies that are beyond the boom. It already began to cut costs months ago after it had expanded to meet accelerating pandemic-fueled demand. Management is guiding for a 5% year-over-year sales increase at the midpoint in the 2022 fourth quarter, a huge deceleration, and operating income of $0 to $4 billion. Amazon is trying to muddle through this rough patch by continuing to improve the consumer experience and correct its infrastructure to meet slower demand. 

Costco worked through supply chain issues by developing its own supply chain, and while that helped it through with quicker times and lower costs, it's winding down some of that now that overall supply chain headaches have been easing up. Costco doesn't provide quarterly guidance. Management has noted that inflationary pressures were easing up in the first quarter even as that quarter showed a real deceleration in sales growth, which should reflect positively in the coming quarters.

Costco generally does well in a recession, since it offers some of the lowest prices you can find. Its membership renewal rates have been steady at around 90%, which is fairly consistent in any operating environment.

What can we expect long term?

Over time, all of these trends are likely to continue. Amazon is investing in all kinds of businesses powered by the enormous amount of sales it makes from e-commerce. Some of these don't work out, but many of them do, and they can become essential growth drivers for the overall business. We might not see the benefits quickly if we end up in a recession this year, but Amazon continues to dominate the retail landscape, and its stock should rebound when there's economic improvement.

Costco is expanding slowly, but long term there isn't likely to be any huge change in its model. As it opens new stores, it increases sales and generates more cash. Renewal rates should be consistent, and Costco will likely add millions of customers every year like it almost always does.

You can get a sense of the two companies' different models in looking at their operating margins. Amazon's operating margin has been much higher -- and lower. Costco's is fairly similar no matter the operating environment.

COST Operating Margin (TTM) Chart

COST Operating Margin (TTM) data by YCharts

Valuation and dividends

Amazon has always been an expensive stock in terms of valuation. When it split its stock last summer, each share price fell from around $2,000 to about $100. But its price-to-earnings (P/E) ratio around that time was nearly its cheapest-ever when it fell to about 50. That's still costly when compared with the P/E ratios of most other stocks. Even Costco is considered expensive while it's trading at 37 times trailing-12-month earnings. It, too, gets a premium for offering dependable growth and income.

Amazon doesn't pay a dividend; it's usually older stocks that are past their high-growth stage and are focused on cash generation that pay dividends. Costco pays a dividend that yields a meager 0.7% at the current price, but it also pays an occasional special dividend that brings it into the big leagues.

Putting it all together

Usually when I compare two stocks, one is clearly more compelling than the other, even if they are both great stocks. I don't see that here.

Both Amazon and Costco stock offer incredible benefits to shareholders, in my opinion. It just depends what you are looking for in an investment. Amazon has tons of potential in new businesses, and it offers high growth potential. Costco is more of a slow burn, with stability and dividends, plus strong expansion prospects, that make it incredibly valuable.

I recommend both of these stocks as excellent picks in a diversified portfolio.