Walmart is gaining new, higher-income customers and growing its e-commerce business.
Costco continues to report high renewals, and it's turning more members into executive members, who are loyal and pay double the membership fee.
Walmart is a Dividend King with a higher yield.
It's often during the most challenging times when you can see who the winners really are, in any space. In retail, that means tough economies, and specifically inflation.
Walmart (NASDAQ: WMT) and Costco Wholesale (NASDAQ: COST) are both demonstrating resilience in this tricky climate. Which one is the better buy right now?
Will AI create the world's first trillionaire? Our team just released a report on the one little-known company, called an "Indispensable Monopoly" providing the critical technology Nvidia and Intel both need. Continue »
Image source: Getty Images.
Walmart is the largest retail chain in the world, and its more than 5,000 U.S. locations are within 10 miles of 90% of of the U.S. population. That's incredible reach, and it gives Walmart a leg up on any competition. Lately, a new way it's using its store base to create an edge is by using them as e-commerce distribution centers. E-commerce has emerged as a major growth driver for Walmart, increasing 24% year over year in the 2026 fiscal fourth quarter (ended Jan. 31).
As a discount retailer, Walmart has incredible resilience throughout economic cycles. However, it has expanded to capture market share in more affluent circles, and most of its recent share gains are coming from households earnings at least $100,000.
Walmart is also a Dividend King, and it has raised its dividend annually for the past 53 years. It yields 0.74% at the current price. That's a strong commitment, and it gives shareholders tangible value in the here and now, even if they pass on their Walmart stock to the next generation.
Costco earns consumer loyalty by charging a membership fee and offering rock-bottom prices. Members renew at a high rate, 92.1% in the U.S. and Canada in the 2026 second quarter, ended Feb. 15, and 89.7% globally. More and more members upgrade to the executive membership all the time, which costs double the standard rate of $65 annually. Executive members are highly engaged, representing 76% of total sales. It's a smooth and efficient model that generates high sales and profits.
The cycle keeps repeating itself, but rather than staying in a static loop, Costco is investing to win in today's tech-boosted market. It now offers online registration, self-checkout, and several forms of e-commerce that suit its warehouse-style stores. E-commerce sales increased 24% year over year in the second quarter, and total sales were up 9.1%.
Costco also has a dividend, and it yields 0.52% at the current price. It's a rock-solid retail powerhouse that should reward shareholders for decades.
These are both excellent stocks that I recommend. But does one edge out the other?
Let's compare valuation:

WMT PE Ratio data by YCharts
Costco is more expensive, but they're both expensive right now. Costco is also growing faster, warranting the higher premium.
I would suggest that if you're looking for a top dividend stock, Walmart fits the bill, and that might give it the edge in this comparison. Investors agree: As of the time of this writing, Walmart stock is up 33% over the past year while Costco stock has remained flat.
Before you buy stock in Walmart, consider this:
The Motley Fool Stock Advisor analyst team just identified what they believe are the 10 best stocks for investors to buy now… and Walmart wasn’t one of them. The 10 stocks that made the cut could produce monster returns in the coming years.
Consider when Netflix made this list on December 17, 2004... if you invested $1,000 at the time of our recommendation, you’d have $496,797!* Or when Nvidia made this list on April 15, 2005... if you invested $1,000 at the time of our recommendation, you’d have $1,282,815!*
Now, it’s worth noting Stock Advisor’s total average return is 979% — a market-crushing outperformance compared to 200% for the S&P 500. Don't miss the latest top 10 list, available with Stock Advisor, and join an investing community built by individual investors for individual investors.
See the 10 stocks »
*Stock Advisor returns as of May 1, 2026.
Jennifer Saibil has positions in Walmart. The Motley Fool has positions in and recommends Costco Wholesale and Walmart. The Motley Fool has a disclosure policy.