Many retailers have seen their businesses decimated in recent years, as e-commerce continues to disrupt more areas of the traditional brick-and-mortar retail industry. Yet a select group of retailers has not only resisted this trend, but also found a way to prosper in this intensely competitive environment.

Wal-Mart (WMT -0.15%) and Home Depot (HD 0.52%) stand among this elite group. But which of these retail titans is the better buy today? Read on to find out.

An empty shopping cart in an empty store parking lot

The retail world is littered with the corpses of failed enterprises, yet Walmart and Home Depot have found a way to survive and thrive. Image source: Getty Images.

Moat

Walmart's massive scale is its primary competitive advantage. Its scale gives it buying power -- because of the enormous amount of goods Walmart purchases, it's able to obtain favorable prices from suppliers. These price concessions allow it to offer the "everyday low prices" for which it's known.

Home Depot's economic moat is built upon its exclusive products and ability to attract professional customers such as contractors. Moreover, large and heavy building materials comprise a significant portion of the home improvement retailer's product line. These items are expensive to ship, which helps to further insulate Home Depot from the threat of e-commerce.

Yet while Home Depot's moat remains well defended, Walmart's competitive position shows signs of weakening. Online juggernaut Amazon.com can match and sometimes even exceed Walmart's scale in many areas. Even more, Amazon's recent purchase of Whole Foods is a direct assault on Walmart's sizable grocery business, which is perhaps its last remaining stronghold against e-commerce. As such, I'd argue that Home Depot has the wider moat.

Advantage: Home Depot. 

Financial strength

Since only the strongest retailers will survive over the long term, financial fortitude is of the utmost importance. Let's see how Walmart and Home Depot stack up in this regard.

Metric

Walmart

Home Depot

Revenue

$495.01 billion

$100.90 billion

EBITDA

$30.97 billion

$16.74 billion

Operating income

$22.18 billion

$14.68 billion

Net income

$11.44 billion

$8.63 billion

Operating cash flow

$28.81 billion

$12.03 billion

Free cash flow

$18.74 billion

$10.13 billion

Cash

$6.76 billion

$3.60 billion

Debt

$46.49 billion

$27.03 billion

Data sources: Morningstar, Yahoo! Finance.

Home Depot is the more profitable retailer, with an operating margin of 14.55% over the past year, compared with 4.48% for Walmart. Still, Walmart is a cash-generating machine with more than twice the operating cash flow and 85% more free cash flow than Home Depot. That gives the discount giant the edge in terms of financial strength.

Advantage: Walmart.

Growth

Walmart may have greater cash flow production, but Home Depot's revenue growth has significantly outpaced that of its larger rival in recent years. And while Home Depot's earnings per share are up more than 130% over the past half-decade, Walmart's EPS is down by more than a third during this same time.

WMT Revenue (TTM) Chart

WMT Revenue (TTM) data by YCharts

Wall Street expects Wal-Mart's earnings per share to rise by nearly 7% annually over the next five years, driven by the company's e-commerce operations. Home Depot, however, is projected to grow its EPS by more than 15% annually during this period, fueled by its "interconnected retail" initiatives. Thus, Home Depot clearly has an edge in both recent past and expected future earnings growth.

Advantage: Home Depot. 

Valuation

No better-buy discussion should take place without a look at valuation. Let's now check out some key value metrics for these retail rivals, including price-to-free-cash-flow, price-to-earnings, and price-to-earnings-to-growth ratios.

Metric

Walmart

Home Depot

P/FCF

14.06

20.55

Trailing P/E

27.12

24.45

Forward P/E

16.91

17.49

PEG

2.59

1.22

Data sources: Yahoo! Finance, Morningstar.

The metric that stands out to me the most is the PEG ratio, which factors in Home Depot's vastly higher expected EPS growth rate. Valuation exercises should account for growth, and so with a PEG that's less than half that of Walmart, I'd argue that Home Depot is the better bargain.

Advantage: Home Depot.

The better buy is...

Walmart may be a financial titan, but with its stronger competitive positioning, superior growth prospects, and more attractively valued stock, Home Depot is the better buy today.