Costco (NASDAQ:COST) and Home Depot (NYSE:HD) share many similarities as investments. Each company dominates its niche of the retail industry, and each has a long track record for generating solid returns for shareholders. Both just experienced  record growth years in 2020 due to the pandemic.

But which one looks likely to be the better investment in 2021 and beyond?

A cart sits in an empty home improvement store aisle.

Image source: Getty Images.

Comparing growth rates

While both companies gained market share during the past year, the edge goes to Costco in the growth department. Its comparable-store sales gains consistently outpaced national peers like Walmart (NYSE:WMT) in recent quarters. Costco's February revenue, for example, grew by 14% in the core U.S. market after adjusting for gasoline price swings.

Walmart's Sam's Club has been expanding at a slower pace, with net sales up 8.7% for the fiscal year that ended Jan. 31.   The warehouse giant's success also shows up in its renewal rate, which recently edged up to a record 91%.

Home Depot's latest results look closer to average for its peer group by comparison. It grew sales by 20% in its fiscal 2020 while Lowe's (NYSE:LOW) notched a 24% gain. The home improvement retailer is also opening stores at a slower pace, with just 5 new locations added in 2020 compared to the 21 that Costco is planning for the current fiscal year.

Profits and cash returns

On the other hand, Home Depot is the clear winner when it comes to profits and cash returns. It boasts a higher operating profit margin than Costco, and dominates Lowe's and most other national retailers on this score.

COST Operating Margin (TTM) Chart

COST Operating Margin (TTM) data by YCharts

Home Depot promises to deliver more cash to investors as well. Management targets an annual return of 55% of earnings to shareholders compared to 35% for Lowe's. That commitment supported a 10% hike in Home Depot's dividend for its March distribution. In contrast, while Costco sporadically issues large special dividends, its regular payout commitment translates into a 0.9% annual yield at current share prices, the lowest in its stock cohort.

The outlook

Home Depot's stock has fared much better since the start of the pandemic, which likely flows from the fact that investors are expecting no big slowdown in its sales as the threat of the coronavirus recedes. Sales will likely grow modestly in 2021, management forecast in late February, as earnings grow following the prior year's spike. The housing market is booming across the country, and factors such as income growth, the age of housing stock, and home prices all suggest further robust gains ahead.

In contrast, business in Costco's portion of the retail world could be in for a relatively sluggish period as demand slackens for bulk quantities of consumer staples like paper towels and laundry detergent. Tens of millions of Americans might soon ease back into their pre-pandemic shopping habits of visiting several stores more often to get the various items they seek, rather than seeking to consolidate their shopping trips as much as possible. That could further pressure the warehouse giant's sales over the next few quarters.

Valuation and bottom line

Yet that potential slowdown appears to already be baked into Costco's stock price, which participated in the wider market's surge over the past 12 months. You can now buy shares of the warehouse retailer for about 0.8 times annual sales. That's less than half Home Depot's valuation by the same metric, and below the 1 times sales you'd have to pay to buy shares of Target (NYSE:TGT).

Costco is more expensive on a price-to-earnings basis, though, as investors are paying over 30 times annual earnings for the stock. That premium is partly thanks to the chain's unusually low profit margin.

On the other hand, cash returns are the best reason to prefer Home Depot even at its premium valuation. You get a bigger dividend commitment and are likely to benefit from aggressive stock buybacks over the next few years by holding the home improvement leader.

This article represents the opinion of the writer, who may disagree with the “official” recommendation position of a Motley Fool premium advisory service. We’re motley! Questioning an investing thesis -- even one of our own -- helps us all think critically about investing and make decisions that help us become smarter, happier, and richer.