There are several reasons to believe that buying stock in home improvement chains is one of the best ways to invest in the retail sector today. For starters, many of the items they sell -- think lumber, 5-gallon paint buckets, and bathroom vanities -- are not suitable for delivery methods employed by e-commerce behemoths, making it hard to compete in the space. Against this competitive backdrop, the median age of U.S. homes rose from 31 years in 2005 to 37 years in 2015, according to the National Association of Home Builders.  

With these tailwinds, the two largest home improvement retail chains, Home Depot (NYSE:HD) and Lowe's Companies (NYSE:LOW), have both prospered. Over the trailing one-, three-, and five-year periods, the stock prices of both companies are outperforming the S&P 500 index.

HD Chart

HD data by YCharts.

Let's take a closer look at each to see which of these large retail chains makes for a better investment today.

The case for Home Depot

Home Depot recently reported its 2018 fourth-quarter earnings, and there was a lot for investors to like: Sales rose to $26.5 billion, a 10.9% increase year over year, and earnings per share (EPS) grew to $2.09, a 37.5% increase year over year. The strong growth came on the back of a 3.7% increase of comparable-store sales.

Home Depot has invested heavily to ensure its omnichannel operations are comparable, or better than, any others. Its efforts, appropriately named One Home Depot, signal that management recognizes that regardless of whether customers are browsing online or in-store, they see it as one continuous shopping experience. The efforts appear to be paying off.

In 2018, Home Depot's online sales grew 24.1% and now make up 7.9% of the company's total sales. In an effort to integrate its digital and physical worlds, Home Depot has introduced lockers in over 1,000 stores, with more stores set to debut the feature in 2019. The lockers are located near the front of the store and can hold orders for customers who placed an online order, allowing shoppers to pick up their products and avoiding having to wait in line or go into the store. Customers love the idea, as 94% have rated their locker pick-up experience with five out of five stars. About 50% of online orders are now picked up in-store.

Of course, no omnichannel strategy would be complete without a robust plan for delivery solutions, which is where Home Depot truly stands out. In 2018, Home Depot committed to investing $1.2 billion by 2022 to improve and expand its logistics infrastructure. This effort includes the addition of 170 new distribution facilities, many of which will be specially outfitted for the unique mix of goods and products that Home Depot sells. The company can now service more than 90% of the U.S. population with one- or two-day delivery service.

Based on the company's 2019 EPS guidance of $10.03, shares currently sell at a forward P/E ratio of about 19.1. Management also consistently rewards shareholders with dividends and share buybacks. The company's board recently approved a 36% increase in its quarterly dividend to $1.36 per share, the 10th consecutive year of dividend increases. The board also recently authorized a new $15 billion share-repurchase program.

Hand tools laid out in the shape of a house on a green, artificial turf background.

Home Depot's online sales are much larger and growing faster than Lowe's e-commerce operations. Image source: Getty Images.

The case for Lowe's

Lowe's 2018 fourth-quarter earnings came in relatively flat, though new CEO Marvin Ellison put on a brave face and outlined the many things the company was doing to catch up to its larger rival. In Q4, total sales increased 1% to $15.6 billion, while adjusted EPS improved 8.1% to $0.80. Comparable-store sales rose 1.7% in the quarter, though January saw a 5.8% increase, momentum that Ellison hopes can continue.

Ellison faces several challenges as the CEO, not the least of which is catching up to Home Depot's online operations. In Q4, Lowe's online sales improved 11.1%, less than half the growth rate of Home Depot's and coming off a much smaller base. During the earnings conference call, Ellison stated that traffic to the company's website was strong, but finalizing sales proved to be elusive, partly because of systemic challenges, such as an outage during the record-breaking Black Friday shopping weekend.

To improve its underlying IT infrastructure, Ellison has brought on new personnel, including a new chief information officer and a new president of online sales, who he believes can help turn the ship around. There are reasons for optimism. For instance, even though online sales growth is relatively unimpressive, about 60% of online sales are picked up in stores, indicating that the company does understand the importance of integrating its digital and physical shopping experiences.

One of the key initiatives Ellison highlighted was an effort to transform and optimize Lowe's supply chain. Lowe's current logistics infrastructure was built to deliver goods to its stores, something it is very good at. What the supply chain was not designed to accomplish, Ellison stated, was to deliver products directly to the customer. To this end, Lowe's recently opened a distribution center on the east coast to handle direct-to-consumer shipping, with plans to open a second such center on the west coast soon.

Based on the midpoint of its 2019 fiscal year guidance of $6.05, Lowe's shares currently sell at a forward P/E ratio of about 18. Lowe's management also has a long history of returning money to shareholders via dividends and share repurchases -- it gave back almost 90% of the company's 2018 free cash flow to shareholders.

My final pick: Home Depot

Ellison is certainly taking some promising steps as Lowe's CEO, though the company largely remains a work in progress. If shares were significantly discounted relative to Home Depot's, a reasonable case could probably be made for investing in Lowe's shares over its larger rivals'. Yet with only a slightly cheaper valuation, Home Depot appears to sport superior e-commerce and logistics operations, two areas of operations that are crucial for home improvement retailers and can be directly observed in the two companies' results. Until Lowe's makes these expensive investments and shows material improvement in its sales growth, Home Depot looks to be the better investment for the foreseeable future.

This article represents the opinion of the writer, who may disagree with the “official” recommendation position of a Motley Fool premium advisory service. We’re motley! Questioning an investing thesis -- even one of our own -- helps us all think critically about investing and make decisions that help us become smarter, happier, and richer.