One of the few retail industries that hasn't been turned on its head by e-commerce is home improvement. If we know that the products we'll be buying will be in use for years and even decades, we like to see them for ourselves -- and hold them in our hands -- before plopping down hundreds of dollars.

That has helped the two companies in today's matchup -- Home Depot (HD -0.38%) and Sherwin-Williams (SHW 0.68%) -- thrive in the eight years since the Great Recession. Not including dividends, they have returned over 750% and 650%, respectively, for shareholders.

A couple looking at their kitchen and imagining what it might look like.

Image source: Getty Images

Which is the better buy today? That's impossible to answer with 100% certainty, but that shouldn't stop us from digging a little deeper. By analyzing how these two stack up on three key facets can give us a better idea for what we're buying if we purchase shares of either.

Sustainable competitive advantages

For long-term, buy-to-hold investors, there's nothing more important to study than a company's sustainable competitive advantages -- or its "moat", in investing lingo. At the most basic level, this is what keeps customers coming back year after year, and holds the competition at bay for decades.

In the home improvement category, both Home Depot and Sherwin-Williams benefit from moats provided by scale, market share, and brand familiarity.

Home Depot has nearly 2,000 locations stateside, and a little over 300 internationally. That scale has allowed the company to grab more market share than any other -- outpacing runner-up Lowe's by a 3:2 ratio in 2015, according to Statista.

With that scale has come a valuable brand, coming in at the 25th most valuable globally in 2016. The Home Depot brand alone, according to Brand Finance, is worth almost $29 billion.

Sherwin-Williams benefits from many of the very same advantages. The company's brand, while well-known, isn't nearly as valuable as Home Depot's, coming in with the 406th spot globally.

But it also has unique advantages. The acquisition of Valspar has made Sherwin-Williams the second-largest paint provider in the world, giving it considerable pricing power and scale advantages. It also gives the company far more exposure to international growth markets than Home Depot.

Sherwin-Williams also benefits from the fact that while it does have retail locations -- and those locations account for two-thirds of sales -- it also manufactures the paints it sell, and offers them via other channels, like Lowe's locations and online. That versatility gives it a level of protection against e-commerce that Home Depot doesn't have.

Taking all of these factors into consideration, I would call this a draw. Home Depot has a stronger brand, while Sherwin-Williams has more sales flexibility.

Winner = Tie

Financial fortitude

Both of these companies offer solid dividends. But while the income-investor in all of us would like to see these payouts forever increase, that's not always in our long-term best interests.

That's because every company, at one point or another, will face difficult economic circumstances. When that's the case, it's vital to have healthy cash flows and a sizable war chest to lean on. If you have this, you have options in a crisis: buy back shares on the cheap, acquire your rivals, or -- most importantly -- outspend them to grab market share.

Companies that are debt heavy are in the opposite boat, finding themselves in the precarious position of cutting services while trying not to lose too much market share. Keeping in mind that Home Depot is valued at almost six times the size of Sherwin-Williams, here's how the two stack up.

Company

Cash

Debt

Net Income

Free Cash Flow

Home Depot

$3.6 billion

$22.4 billion

$8.2 billion

$9.0 billion

Sherwin-Williams

$1.0 billion

$1.2 billion

$1.2 billion

$1.4 billion

Data source: SEC filings, Yahoo! Finance.

Here there's a clear winner. While both companies have very healthy cash flows, Sherwin-Williams has a far more flexible balance sheet. While the completion of the Valspar acquisition will change this a bit, it still comes out ahead of Home Depot.

Winner = Sherwin-Williams

Valuation

Finally, we have valuation. While we don't have a one-size-fits-all metric to compare any two companies, we can use multiple data points to make an informed analysis.

Company

P/E

P/FCF

PEG Ratio

Dividend Yield

FCF Payout

Home Depot

23

21

1.7

2.3%

40%

Sherwin-Williams

26

23

2.2

1%

23%

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

Here again we have a pretty clear winner. Home Depot is cheaper on every possible valuation metric, and the company offers a dividend payout over twice the size of Sherwin-Williams'. Additionally, it is a relatively safe dividend, with only 40% of free cash flow being used over the past year to make the payout.

Winner = Home Depot

My winner is...

So there you have it: we have a draw. Often times, I break these ties by giving the nod to the company with the stronger moat. But in this case, these two are virtually identical. If you're interested in investing in dividend-paying home improvement companies, I don't think you can go wrong with either of these.