Walmart's massive purchasing power will help keep prices low.
Costco's membership-driven model will help keep finances steady.
Are you a Walmart (NYSE: WMT) person or a Costco (NASDAQ: COST) person?
When it comes to shoppers, the two groups tend to be mutually exclusive, with many Americans swearing by one and swearing off the other.
Where to invest $1,000 right now? Our analyst team just revealed what they believe are the 10 best stocks to buy right now. Continue »
But for investors, the question is a bit different: They want to know which they should put money into.
And that question is more relevant today than it's been in a while. Many economists expect President Trump's tariffs to start pushing the price of groceries -- from bananas and coffee to soda and beer -- higher in the coming months. The Tax Foundation expects tariffs to impact nearly 75% of U.S. food imports.
If and when prices of groceries rise, both Walmart and Costco are expected to benefit, as many Americans will trade down to retailers that emphasize low prices. Plus, because they're so large, both retailers have significant supply chain leverage that should allow them to push back on higher prices from suppliers -- to an extent, at least.
Image source: Getty Images.
Walmart is quite a bit larger than Costco, with a market cap of $778 billion, versus $441 billion for Costco. Walmart has more than 10,000 stores on four continents and is the world's largest retailer by sales. Costco is the world's third-largest retailer; it has a membership model, with roughly 900 locations and 79.6 million paid household members and 37.6 million paid executive memberships. While they sell all kinds of items, Walmart and Costco rank as grocery behemoths.
Costco stock is up roughly 6% this year as of Aug. 21 and 181% over the past five years, while Walmart stock has gained roughly 8% year-to-date and 123% over five years.
Walmart and Costco often do well when inflation pushes prices higher and shoppers look for bargains.
From January 2022 to February 2023, when year-over-year headline inflation ranged from 6% to 9.1%, Walmart kept the increase in grocery prices to 3%, compared to average price increases of 7.5% or more at rivals like Amazon, Kroger, and Target, according to a Reuters analysis. Walmart's size and buying power help it force suppliers to keep prices lower.
As a result, in its fiscal 2024, ended Jan. 31 of that year, Walmart grew total revenue in constant currency 6% to $648 billion and its adjusted earnings per share 5.7% higher to $6.65. In the 52 weeks following that earnings announcement, Walmart shares climbed 66%.
Costco, on the other hand, makes a large percentage of its profits from membership income -- membership fees totaled about 65% of net income in the most recently reported quarter. That business model -- along with a reputation for good deals -- helps steady the company's results during an inflation spike. In its fiscal 2023 (ended Sept. 3 of that year), Costco saw U.S. net sales grow 6.7% to almost $238 billion. Membership fees increased 8% that year, to $4.58 billion.
In the 52 weeks after that earnings release, Costco stock rose 63%.
And just recently, in its third quarter of 2025, the retailer reported a 10.4% increase in its membership fee income, to more than $1.2 billion. Last September Costco raised membership fees by $5, to $65 a year, yet it saw no meaningful decline in members after the increase.
Both businesses and their stocks benefit from rising overall prices because they're able to either keep prices lower than the competition (Walmart), which drives sales, or rely on membership fees (Costco) that drive profits.
So which stock should you invest in today in anticipation of rising grocery prices in the months ahead?
Well, stock prices ultimately track earnings growth. And analysts expect Costco to increase earnings per share for the current quarter by 10% (results will be released on Sept. 25).
As for Walmart, the retail behemoth released its second-quarter results this week and they were slightly disappointing. Adjusted earnings per share of $0.68 were lower than the average analyst estimate of $0.73, and that sent the stock 5% lower on Thursday. Revenue, however, came in at $177.4 billion, almost $2 billion higher than estimates.
Thus, the picture is mixed. Rising grocery prices will impact all U.S. retailers, and both Costco and Walmart have a history of thriving when that happens. With the uncertainty of Trump's tariff policies still high, however, Costco's membership-driven model may put it in a more advantageous position going forward.
Before you buy stock in Costco Wholesale, 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 Costco Wholesale 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 $649,657!* 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,090,993!*
Now, it’s worth noting Stock Advisor’s total average return is 1,057% — a market-crushing outperformance compared to 185% for the S&P 500. Don’t miss out on the latest top 10 list, available when you join Stock Advisor.
See the 10 stocks »
*Stock Advisor returns as of August 18, 2025
Matthew Benjamin does not hold any of the stocks mentioned in this article. The Motley Fool has positions in and recommends Amazon, Costco Wholesale, Target, and Walmart. The Motley Fool recommends Kroger. The Motley Fool has a disclosure policy.