Costco (COST 1.68%) is looking pretty good these days. Its shares are trading near the all-time highs hit earlier this summer, and its empire of namesake warehouse clubs is stronger than ever. There were 53.1 million paid members as of the end of the fiscal third quarter that ended in mid-May, representing 97.2 million cardholders worldwide. 

The top dog among warehouse-club operators now watches over 772 superstores, with 237 of those warehouses located internationally. Growth is as steady as you probably think. Costco has had just one year of declining top-line growth over the past 30 years, and even then it was a mere 1.5% downtick during the global financial crisis of fiscal 2009.

Costco has been steady as a rock in the past, but with consumer trends shifting, will the class act of warehouse clubs keep delivering the goods? Let's try to size up how Costco will be faring come 2024. 

Exterior shot of a Costco Wholesale store with the logo on the sign.

Image source: Costco.

Hitting the checkout lane

Costco's biggest rivals right now are Walmart's (WMT 0.83%) Sam's Club and BJ's Wholesale (BJ 5.94%), but no one would be surprised if the real competition five years from now is Sam's Club's parent company and Amazon (AMZN -0.17%). Walmart and the world's leading online retailer are getting better about speeding up delivery for online orders, and in Walmart's case, making it more seamless to grab groceries without having to leave the car. 

Amazon and Walmart share Costco's passion for shrewd cost controls, passing along the savings to consumers. A value-driven mindset has served Costco well. Many brick-and-mortar chains are faltering against online competitors, but Costco just works. 

Costco isn't greedy. Membership fees account for just a little more 2% of its revenue. In its latest quarter, Costco sold nearly $34 billion in merchandise that it cost a little more than $30 billion to acquire. Gross margin of 11% may not seem impressive, and by the time the company's done covering the rest of its operating overhead, it's down to a pre-tax profit margin around 3%.

In short, another way to look at this is that the lion's share of its profit comes from the membership fees it collects. This may not be a good selling point for growth investors, but the lean model is also a powerful moat that will keep it on top for the foreseeable future.

Customers love Costco. Comps have risen 8.5% through the first 36 weeks of fiscal 2019 and a still impressive 6.9% ascent if you back out the volatility of gasoline prices. Walmart is a master at turning inventory over to optimize its meager markups, and Amazon never shies away from subsidizing a business, even if it will never be a high-margin gold mine. As the perceived line between online and offline starts to fade, it's not a stretch to say that Costco, Walmart, and Amazon will be the three most important retailers, period. 

Costco can compete against anybody, just as it pulls away from Sam's Club and BJ's Wholesale today. It may have a limited online presence now, but we've learned through Walmart's evolution that you can teach an old dog some new media tricks. Those tricks also go both ways, judging by Amazon's decision to acquire Whole Foods and recently expand its Amazon Fresh platform for home-delivered groceries and its Prime Now offering for same-day delivered staples. 

In the end, Costco's competitive landscape will be different come 2024, but the company should continue to thrive as a growing and relevant survivor. Costco will continue to boost its dividend, sprinkling in bonus special disbursements along the way. The yield just below 1% won't woo income investors, but it's a steady trickle that continues to grow with every passing year.

Costco has been a market beater before and should continue to stay ahead of the market's pace through the next few years. Costco is built to last, and the same can be said about an investment in the undisputed leader in warehouse clubs.