The housing market has boomed back from the 2008 recession, and The Home Depot (NYSE:HD) and Sherwin-Williams (NYSE:SHW) have both taken full advantage of improving conditions in the home-improvement market. Home Depot has become the leading large-store format retailer in the home improvement space, and it has also worked hard to embrace multiple groups of customers and use rising technology to lead to even greater growth. Meanwhile, Sherwin-Williams has partnerships with key players in the home-improvement retail business as well as having its own specialty retail stores to sell its paint and other products.

Given how strong the industry has been, many investors want to participate, and they need to know which stock is the better buy. With that in mind, let's look at Home Depot and Sherwin-Williams to see how they compare on some key metrics.

Dragon made out of paint cards.

Image source: Sherwin-Williams.

Valuation and stock performance

Both Home Depot and Sherwin-Williams have done exceptionally well over the past year. Sherwin-Williams finishes with a slight edge, as its stock has produced a 23% total return since February 2016. That compares with a 19% showing from Home Depot.

The attractiveness of the home-improvement space has made many investors interested in these two stocks, and their valuations show investor demand for the shares. Home Depot currently trades at 23 times its trailing earnings over the past year. Sherwin-Williams fetches an even higher trailing earnings multiple of 26. Those figures are above the average for the overall market, although they do reflect the general preference toward high-quality consumer stocks.

When you look at their near-term growth prospects, the valuation disparity nearly disappears. Home Depot trades at 20 times forward earnings, and Sherwin-Williams is only a tiny bit above a 20 forward multiple. These differences are minimal and don't show any obvious edge between Home Depot and Sherwin-Williams.

Dividends

Dividend investors won't be entirely satisfied with this selection of stocks. Home Depot currently sports a 2.5% dividend yield, which is a solid showing for a member of the Dow Jones Industrials but is fairly close to the market average. Sherwin-Williams, on the other hand, lags badly, with just a 1.1% yield.

The irony is that many see Sherwin-Williams as having the stronger dividend reputation. The paint-maker is a Dividend Aristocrat, with a 39-year history of boosting its annual dividend payments each and every year. Yet that hasn't always equated to strong dividend growth. For instance, after an impressive 25% dividend boost in 2016, Sherwin-Williams just announced that its 2017 raise would be just $0.01 per share, to $0.85 per share on a quarterly basis. The company could pay higher dividends, as its 27% payout ratio shows. But it has chosen not to share its success with investors in that way.

By contrast, Home Depot's streak of rising payouts goes back only to the financial crisis, but it has been much more generous. Earlier this month, Home Depot boosted its dividend by 29% to $0.89 per share, which continued a streak of impressive performance that has included annual payout growth of at least 17% each year since 2013.

Home Depot's dividend track record recently gives it an advantage over Sherwin-Williams. Until the paint-maker decides to be more aggressive with its dividend policy, Sherwin-Williams won't be able to measure up to Home Depot's more shareholder-friendly attitude.

Growth prospects and risks

Home Depot and Sherwin-Williams have both enjoyed strong economic conditions lately. For Sherwin-Williams, the company's most recent quarterly report helped reverse some troubling trends that had started appearing in past quarters, showing a 7% rise in revenue and a nice rise in adjusted net income. The health of the housing market showed up in its paint stores group, where segment revenue climbed by nearly 10% on same-store sales gains of 5.5%. Sales figures in some of Sherwin-Williams' other segments weren't quite as strong, but the company did a good job of squeezing more profits from sluggish top-line performance due to cost management and efficiency gains. The paint giant is still looking forward to its merger with Valspar (NYSE:VAL), despite the fact that it now believes that it will have to make some transactions to sell off assets in order to gain final approval from regulators. Even with those conditions, favorable guidance for 2017 helped Sherwin-Williams investors get excited about the stock going forward.

Meanwhile, Home Depot has seen its success continue to grow. In its most recent quarter, the company reported comparable-store sales growth of 5.8%, including a 6.3% rise in its U.S. stores. Earnings for the full year grew by nearly a fifth, as CEO Craig Menear pointed to "our focus on providing localized and innovative product selection, improving the interconnected customer experience, and driving productivity" for its success. Home Depot authorized a $15 billion stock repurchase program, and its 2017 outlook included comparable-stores sales growth projections of 4.6% that should help lead to double-digit percentage growth in earnings per share. Home Depot's commitment to shareholders through an increase in the home improvement retailer's targeted dividend payout ratio might signal fewer opportunities for internal reinvestment toward growth, but it nevertheless shows how much of a cash cow Home Depot's business is right now.

Based on current conditions, Home Depot finishes ahead of Sherwin-Williams as a better buy for investors right now. The paint maker does have some things going for it, but Home Depot's positive momentum and higher dividend income give it the nod over Sherwin-Williams.

Dan Caplinger has no position in any stocks mentioned. The Motley Fool recommends Home Depot and Sherwin-Williams. The Motley Fool has a disclosure policy.