Many retailers have seen their businesses decimated in recent years, as the relentless rise of e-commerce has disrupted the traditional brick-and-mortar retail industry. Yet a select few retailers have bucked the trend. Home Depot (HD 0.02%) is certainly among them, and Target (TGT 1.28%) also appears to have regained its footing in recent months.

But which of these retail giants is the better buy today? Let's find out.

Moat

Home Depot's economic moat is derived in part from its focus on large and heavy building materials that are difficult and expensive to ship. This has helped to insulate it from the threat of e-commerce. Moreover, its exclusive products and ability to attract professional customers such as contractors help to further strengthen its competitive position.

Target's competitive strategy has been to offer a more pleasant shopping experience than heavy discounters such as Walmart, with a large selection of comparably priced -- albeit slightly more expensive -- goods. It's a formula that's resonated well with higher-income shoppers. However, with more and more people choosing the convenience of shopping from home combined with fast and often free delivery, e-commerce king Amazon.com (AMZN -1.14%) is steadily taking share in this important segment. In addition, Amazon's recent acquisition of Whole Foods makes it an even bigger threat to Target's large grocery business.

For these reasons, I'd argue that Home Depot has the wider economic moat than Target.

Advantage: Home Depot

Financial fortitude

Let's now take a look at how these retailers stack up with regard to financial strength.

Metric

Home Depot

Target

Revenue

$99.23 billion

$69.80 billion

Operating income

$14.42 billion

$4.51 billion

Net income

$8.60 billion

$2.65 billion

Operating cash flow

$11.61 billion

$7.04 billion

Free cash flow

$9.78 billion

$4.63 billion

Cash

$3.60 billion

$2.72 billion

Debt

$27.03 billion

$12.63 billion

Data sources: Morningstar, Yahoo! Finance.

Home Depot may have more debt than Target, but it also generates substantially more operating profits and free cash flow. That's important because ultimately, it's a company's cash profits that allow it to invest in growth initiatives and pay dividends to shareholders. So I'll give the edge to Home Depot here.

Advantage: Home Depot

Growth

Target's earnings per share (EPS) are projected to fall by about 1% annually over the next five years, with the retailer expected to continue to struggle with tepid sales growth and rising costs. Home Depot, meanwhile, is forecasted to grow its EPS by more than 14% annually during this same time, fueled by its e-commerce and "interconnected retail" initiatives. As such, Home Depot has a clear edge in terms of expected earnings growth over the next half-decade.

Advantage: Home Depot

A person drawing a rising green line above a falling red line

Home Depot's EPS growth is expected to outpace that of Target by a wide margin in the years ahead. Image source: Getty Images.

Valuation

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

Metric

Home Depot

Target

Trailing P/E

25.69

15.92

Forward P/E

18.15

14.47

P/S

2.14

0.59

P/FCF

22.09

8.92

Data sources: Yahoo! Finance, Morningstar.l

On all four metrics, Target's shares are significantly less expensive than Home Depot's. That's to be expected, considering Home Depot's higher projected growth rates. Still, at current prices, Target's shares are more attractively priced.

Advantage: Target

The better buy is...

Target's stock may be cheaper, but Home Depot's stronger competitive advantages, cash flow generation, and growth prospects make it the better buy today.