Image credit: Getty Images

At their pinnacles, both Wal-Mart (WMT 1.02%) and Whole Foods (WFM) were massively important disruptors. The former transformed the retail landscape of small-town America by bringing big box stores to nearly every rural area. The latter was the first -- and for a time, the only -- player focusing solely on healthy and organic food.

For a long time, this disruptive approach paid off wonderfully for shareholders. But as so often happens, the competition started catching up. Wal-Mart has been besieged by both a massive image problem in terms of how it treats its employees and the onset of e-commerce. At the same time, Whole Foods has been dogged by its "Whole Paycheck" alias, with customers flocking to more traditional players with natural and organic goods.

Over the last three years, the market has doubled -- when including dividends. But these two have struggled.

WMT Total Return Price Chart

WMT Total Return Price data by YCharts

But which is the better stock to buy today?

While there's no definitive answer to that question, here are three ways we can approach it.

Financial fortitude

While cash in the bank might sound boring, it's incredibly important. At some time in a company's public life, it will run into tough times -- whether macro or company-specific in nature. When those times hit, the amount of cash sitting in the bank -- and debt owed -- will make a huge difference.

Companies with cash have options: they can outspend rivals that are struggling, buy back shares, up their dividends, or even make acquisitions. Companies with lots of debt are in the opposite boat, forced to do everything possible just to prevent bankruptcy.

Here's how these two stack up in terms of financial fortitude.

Company

Cash

Debt

Net Income

Free Cash Flow

Wal-Mart

$6 billion

$36 billion

$14.5 billion

$13.9 billion

Whole Foods

$730 million

$1.05 billion

$507 million

$400 million

Data source: Yahoo! Finance, SEC filings. Net income and free cash flow on trailing twelve month basis.

When comparing these two companies, it's important to remember that Wal-Mart is valued at over 20 times the size of Whole Foods. That should help you calibrate your perspective.

Neither one of these companies is in tip-top shape, but neither is in danger of having difficulties due to its balance sheet. I think Whole Foods' cash-to-debt ratio is much better than Wal-Mart's. And even though Wal-Mart produces a ton of free cash flow relative to the size of its debt, so too does Whole Foods.

For that reason, I'm going to give the nod here to Whole Foods.

Winner: Whole Foods

Sustainable competitive advantages

In investing circles, a company's sustainable competitive advantage is often called a "moat." In its purest form, a moat is what makes a company special; it is what differentiates it from all of the competitors, and keeps people coming back. In my years investing, the strength of a company's moat has been the single greatest predictor of my own investment returns.

Both of these companies rely on two things for their moat: scale and brand. Let's start with Whole Foods. This is easily the largest pure play grocer focused on natural and organic goods in the nation. For a long time, that was a great differentiator. But lately, many traditional grocers are offering the same goods for the same price or less. With these offerings, Whole Foods' moat has suffered mightily.

Wal-Mart, on the other hand, has the type of scale that no other brick-and-mortar retailer can offer. The problem, however, is that ever-so-slowly, brick-and-mortar retailers are ceding business to e-commerce. In that realm, Amazon.com is the undisputed king.

Having said that, however, I still think Wal-Mart has a stronger moat. Whole Foods' moat has been rendered almost useless in the face of competition, while Wal-Mart can still use its size to offer goods for as little as possible.

Winner: Wal-Mart

Valuation

For a tie-breaker between these two, we turn to valuation. While there's no perfect way to measure this, I like to consider multiple data points when making my decision.

Company

P/E

P/FCF

P/S

PEG Ratio

Wal-Mart

15

15

0.4

5.4

Whole Foods

20

25

0.6

3.6

Data source: Yahoo! Finance, SEC filings. P/E calculated using non-GAAP EPS.

While both companies have sky-high PEG Ratios -- a "1.0" is considered "fairly valued" -- it's pretty clear that Wal-Mart is the cheaper choice right now. While Whole Foods may very well be successful with its new 365 Store format to drive future sales, Wal-Mart is definitely a more affordable stock. Given that it also offers a 2.8% dividend yield versus Whole Foods' 1.7% offering, I think Wal-Mart easily wins this battle.

Winner: Wal-Mart

Final Call: Wal-Mart

So there you have it. If you asked me three years ago, I never would have thought I'd say Wal-Mart stock was a better choice. At the time, Whole Foods made up a substantial part of my family's holdings. But that's no longer the case. While I think it's a great thing that organic goods are more readily available, it hasn't been so great for current Whole Foods' shareholders.

Lest you think I'm a Wal-Mart bull, I don't own or intend to own shares of this company either. But when pitted against Whole Foods, I think it's the better choice.