Costco Wholesale (COST 1.01%) is well-loved by both customers and investors, and it's easy to see why.

The warehouse retailer offers rock-bottom prices on quality goods, and its success with customers has helped make it a winner on the stock market, as the stock has a long track record of delivering superior returns. Over the last decade, Costco stock is up nearly 400%, more than double the return of the S&P 500, and Costco shares have gained more than 60,000% since the company went public in 1985.

However, there's no question that Costco trades at a premium compared to its brick-and-mortar retail peers. The stock is currently valued at a price-to-earnings (P/E) ratio of 40, compared to 31 for Walmart (WMT -0.08%), 19 for BJ's Wholesale, and 20 for Kroger.

A look at return on invested capital (ROIC) helps explain why Costco deserves the higher price tag. The chart below compares ROIC at Costco to Walmart, arguably Costco's closest competitor. Walmart, like Costco, is a retail giant that sells groceries and discretionary goods. It even has its own warehouse club chain, Sam's Club.

A chart showing ROIC at Costco and Walmart.

Image source: The Motley Fool.

Breaking down the numbers 

As you can see, Costco has been trouncing Walmart in the ROIC department for several years now, with its returns nearly double Walmart's in the last few years.

This data comes from New Constructs, which defines ROIC as net operating profit after taxes (NOPAT) divided by average invested capital.

For readers who are familiar with both companies, it might be surprising that Costco has a significantly better ROIC than Walmart, because historically Costco has actually had a lower operating margin. The warehouse retailer's business model is to sell bulk goods at near cost and make most of its profit from membership income, meaning low margins are built into the business.

The chart below shows that Costco has narrowed the gap with Walmart, but that doesn't explain why the warehouse retailer has double the ROIC of Walmart.

COST Operating Margin (TTM) Chart

COST Operating Margin (TTM) data by YCharts

How Costco does it

There are different ways of measuring invested capital, but the gist is the same. It's a way of measuring how much money has been invested to build the business in areas like property and working capital, which are necessary for it to run.

A quick look at the balance sheets of Costco and Walmart shows that Costco has lower assets than Walmart. Costco finished fiscal 2022 with $64.2 billion in total assets, while Walmart finished fiscal 2023, which ended in January 2023, with $243.2 billion in total assets.

The best explanation for that gap is that Costco has only a fraction of the stores that Walmart has, and uses them much more efficiently. 

Costco finished 2022 with 838 "warehouses" and 122.5 million square feet of operating floor space. Walmart, on the other hand, had more than 10,500 stores occupying a bit more than 1 billion square feet of space.  

Costco's revenue was $227 billion, compared to $611.3 billion for Walmart in their respective full years. A rough tally of those numbers shows that Costco generates nearly $1,900 per square foot of store space, while Walmart's total is much lower at just around $600.

That helps give Costco a significant advantage over its chief rival in return on invested capital.

Business models count

The lesson for investors is that it's worth looking beyond conventional valuation metrics like the P/E ratio when you're trying to understand the full story behind a stock.

Costco has long had a disciplined approach to investing capital. It avoids advertising, and its marketing efforts are minimal. Unlike most retailers, it's also been selective about its approach to e-commerce, resisting the aggressive spending that Walmart has done to keep up with Amazon.

Those strategic decisions and its superior sales per square foot explain why the company deserves a premium compared to Walmart. As the numbers show, Costco invests capital much more efficiently than its chief rival.