Costco (COST 0.91%), the world's third-largest retailer (as measured by revenue), has seen its business perform extremely well over the past 12 months. What first started out as consumers panic-buying cleaning supplies and toilet paper last spring has since continued into spending on other products such as sporting goods, home furnishings, and consumer electronics. 

The stock has significantly underperformed the S&P 500 since March of last year, a possible indicator that shareholders are worried about Costco's prospects in a post-pandemic world. A recent earnings miss last month put downward pressure on the stock as well. 

This presents long-term investors with a worthwhile opportunity to own a quality business. Here's why I think Costco is a buy. 

digital screen showing a list of stock buys in green

Image source: Getty Images.

The business is still very strong 

Costco's second-quarter 2021 earnings per share missed analyst estimates, driven primarily by higher gas prices. The company usually makes less on the sale of gas when this happens. However, since this is an extremely volatile input and something the company has no control over, investors should not worry too much about it. 

Revenue growth in the quarter was still robust, as comparable sales gained 13% overall and 75.8% in the e-commerce business. And although February saw a deceleration in sales growth compared to January, management highlighted a strong membership renewal rate (91% for U.S. and Canada), ending the quarter with 59.7 million membership households. 

With nearly all of Costco's profit coming from these fees, these two metrics are key for tracking the performance of the business. According to a new analyst note from Wells Fargo, the warehouse club giant may be hiking prices on its memberships this year. While it may certainly lead to some people deciding to cancel, the net benefit to Costco should be a nice boost to the bottom line. 

Even as the world slowly moves past the pandemic and returns closer to normalcy, one burgeoning part of Costco's business is showing no signs of letting up. Online same-day grocery sales skyrocketed 450% in the second quarter of 2021 after soaring almost 300% in the previous quarter. 

And Costco Logistics, the company's in-house solution formerly known as Innovel, continues to fulfill a greater percentage of delivery orders compared to third-party providers. This showcases Costco's adeptness at serving its customers in more convenient ways, something that will only grow in importance going forward.

woman pushing shopping cart in a warehouse club store

Image source: Getty Images.

A solid long-term addition 

Costco's success over time, and especially during the last year, demonstrates just how powerful its competitive advantages are. The massive scale ($175 billion in sales globally in the last 12 months) allows the company to purchase goods at low costs, savings it then passes on to consumers to provide an exceptional shopping experience. This won't change anytime soon. 

I think investors would be wise to consider purchasing shares of Costco today. It can provide a nice bedrock for a diversified portfolio that perhaps also has exposure to riskier, higher-growth names. Whetting investor appetites is a dividend that has increased at a 13% compound annual growth rate since 2004. 

So, how much does it cost to buy a wonderful business that has a wide moat, is still growing, and is a consumer favorite? Investors can buy shares at a multiple of 33 times forward earnings. In a world of loose monetary policy and ultra-low interest rates, this is not expensive at all. Costco's stock price has more than doubled since 2016. It could very well repeat this feat in the next five years.