Most readers are probably aware that the home improvement industry has long been dominated by two businesses. Home Depot (HD 0.02%) and Lowe's (LOW 0.64%), both household names by now, possess favorable attributes that investors could be looking for when it comes to their own portfolios. Moreover, both stocks have beaten the S&P 500 during the past five years. 

As we look toward the future, which of these massive retailers is the better stock to buy right now? Continue reading to find out what I think. 

The case for Home Depot 

Home Depot was only able to increase its top line by 4.1% in fiscal 2022, which ended Jan. 30. And same-store sales actually declined 0.3% in the fiscal fourth quarter. There's no doubt that the company is facing a slowdown amid a shift in consumer behavior and higher inflation.

But this deceleration is happening after Home Depot posted annual revenue growth of 19.9% and 14.4% in fiscal 2020 and fiscal 2021, respectively. Zooming out, we'll see a business that has been resilient throughout the coronavirus pandemic and in 2022. 

Despite macro headwinds that are slowing the company down, Jeff Kinnaird, Home Depot's EVP of Merchandising, said on the Q4 2022 earnings call that project backlogs for professional customers remain elevated compared to historical levels. These professionals, which include contractors and electricians, among other experts, spend more and visit stores frequently, driving up sales volume per location.

And they help explain why Home Depot's profitability metrics, as measured by operating margin and return on invested capital, have consistently been better than those of chief rival Lowe's over the past 10 years. Having a lead with the valuable professional customer group could continue to benefit Home Depot over the long term. 

After Home Depot reported its most recent financial results, the stock tanked, and it now trades at a price-to-earnings (P/E) ratio of 18. This is meaningfully cheaper than the stock's trailing 10-year average P/E multiple. At this valuation, investors would also get an attractive 2.5% dividend yield. Plus, the leadership team has consistently repurchased shares over time. 

The case for Lowe's 

In its most recent quarter (Q3 2022, ended Oct. 28, 2022), Lowe's reported a revenue increase of 2.4% year over year and same-store sales growth of 2.2%. While Lowe's is slated to announce its fiscal fourth-quarter results on March 1, it's probably safe to assume that its numbers will mimic what Home Depot posted. A general slowdown for the business is to be expected. 

As of this writing, Lowe's stock trades at a P/E multiple of 20, which is more expensive than Home Depot. Given that the company's margins and return on invested capital have usually been lower than its bigger rival's, investors might suspect that the stock deserves a lower valuation.

But if we look at diluted earnings per share, which have increased from $2.84 in fiscal 2018 to $10.27 in the last 12 months, we can see that Lowe's has done a spectacular job at boosting its bottom line. This could justify the stock rising 114% over the past five years. 

While Home Depot generates about half of its overall revenue from Pros, Lowe's share is about 25% right now. This gives CEO Marvin Ellison a huge opportunity to close the gap with the bigger competitor. Revamping the Pro loyalty program, and adding improved benefits like volume discounts and dedicated sales staff, can attract new customers and drive better growth over time. 

What's more, Lowe's has always instituted a shareholder-friendly capital-allocation policy. It has paid a steadily rising dividend since 1980. And the outstanding share count has been reduced by 30% since the start of fiscal 2016. 

Closing thoughts 

My initial reaction is to recommend buying Home Depot because of its leading position with professional customers, better profitability, and lower valuation. However, because the home improvement industry is so massive, estimated to be worth $900 billion in the U.S., I can't come up with a valid argument as to why investors can't simply own both of these stocks. Combined, Home Depot and Lowe's represent 28% of the overall industry, based on their respective trailing 12-month revenue totals. This means there is a ton of opportunity to continue growing in the decade ahead. 

To be fair, neither business is immune to the whims of the broader economy and the housing market. However, I believe that they will both be able to navigate whatever comes their way in 2023 and beyond, just like they've done in the past. Consequently, Home Depot and Lowe's can both provide a solid foundation for your portfolio.