For price-conscious shoppers, a membership to Costco Wholesale (COST 1.01%) is a must. But when it comes to buying the company's stock, the decision becomes more complicated. While the membership-only retailer is known as one of the best-run companies in the world, its stock is often considered expensive when it comes to valuation.

With that in mind, let's examine Costco's recent performance and key financial metrics to evaluate whether its stock should be considered a buy, sell, or hold.

Stock market outperformance

Over the past decade, Costco stock has had a total return (change in stock price plus dividends) of 490%, more than double the benchmark S&P 500's total return of 223%. Additionally, it has outperformed competitors Target and Walmart's respective returns of 341% and 335%. 

Why has the stock had so much success? Costco's steady growth and impeccable balance sheet is the clear answer.

First, the low-markup company makes most of its profit from memberships, which recently crossed the 69 million-member mark. Costco's increased its membership base by approximately 6% over the past 12 months, resulting in roughly $4 billion in annual revenue.

Additionally, higher revenue and earnings growth is likely to come from future membership price hikes. And considering management averages an increase roughly every 5 1/2 years, with the last one coming in June 2017, membership fees will likely be raised sooner rather than later.

Next, Costco is a rare public company with negative net debt -- meaning it has more cash than long-term debt. At the end of Costco's fiscal third-quarter 2023, the company had a net debt of negative $7.2 billion.

This puts its balance sheet in a significantly better position than its peers Target and Walmart, with $14.9 billion and $37.8 billion in net debt, respectively. Due to its robust cash position, Costco possesses a competitive edge, enabling it to navigate economic downturns by steering clear of high-interest-rate loans that could drag down its balance sheet.

COST Net Financial Debt (Quarterly) Chart

COST Net Financial Debt (Quarterly) data by YCharts.

Costco is a longtime dividend payer

Another effect of Costco's strong financial footing is that it can safely return capital to its shareholders. The company's preferred method of doing that is by paying a dividend.

At first glance, Costco's quarterly dividend of $1.02, representing a dividend yield of 0.72%, may not generate much enthusiasm among dividend-seeking investors. However, the company's management has consistently increased the dividend every year since implementing it in 2004, which indicates that annual increases are likely to continue. 

Moreover, Costco's dividend yield is misleading because the company has a track record of periodically issuing special cash dividends approximately once every three years. Given this pattern, shareholders should anticipate another special cash dividend soon, considering the last one was distributed in December 2020 at $10 per share.

Costco is an expensive stock

Before buying a stock, a potential investor should consider the bear case -- or what could go wrong with the stock before buying it. When it comes to Costco, that begins and ends with valuation.

For established companies like Costco, the price-to-earnings (P/E) ratio is a common metric to see if a stock is undervalued or overvalued because it allows for a comparison with its peers or the company's historical average. Costco's P/E ratio currently sits at 41.6, higher than Target's and Walmart's at 22.9 and 38.2, respectively.

With Costco's past decade of total returns crushing Target and Walmart, it tracks that it's the more expensive stock in terms of valuation. However, when looking at the company's average P/E ratio over the past five years of 37.2, it's apparent that the stock is currently priced on the high side.

COST PE Ratio Chart

COST P/E Ratio data by YCharts.

Is Costco stock a buy?

Renowned investor and Berkshire Hathaway Vice Chairman Charlie Munger calls Costco a "perfect [expletive] company" and claims he will never sell a share of its stock. He candidly acknowledges the only flaw of the stock is its expensive valuation.

To summarize, investors should expect Costco to have a higher P/E ratio than its peers, in general, but it's important to keenly watch its valuation and look for a time to buy when the stock trades below its five-year average. Regrettably, that opportunity doesn't exist at present, making Costco stock a firm hold for investors right now.