When many think of e-commerce, Amazon (AMZN 2.50%) is what comes to mind. It's largely the success of the digital retailer that has helped spawn consumers' fast move to online shopping over the years, and its stock has provided huge returns for investors. However, for those looking to capitalize on further gains in online shopping, brick-and-mortar retailers are catching on. One of the best success stories is Home Depot (HD -0.78%), and its stock is an even better value than Amazon's.

A side-by-side comparison

Home Depot's online sales were a mere 6.7% of total revenue at the end of 2017, but Home Depot's online sales are growing at a healthy pace.

Period

Amazon Product Sales Growth

Home Depot Online Sales Growth

Q1 2018

33%

20%

2017

25%

22%

2016

19%

19%

Data source: Amazon and Home Depot.

Some extra context is needed here. Amazon purchased grocery chain Whole Foods last year, so to get a true apples-to-apples comparison, that needs to be excluded. Product sales from its new physical stores totaled $4.5 billion in the first quarter of 2018, meaning its online-only business grew only 14%. So Home Depot is actually the faster digital sales growth play.

Other traditional retailers have been replacing in-store foot traffic with online traffic, but not Home Depot. Since online sales are still very small, comparable-store sales -- a combination of foot traffic and average customer ticket size -- are still getting a bump primarily from physical locations. In 2017, those comparables at stores in the U.S. increased 6.9%. That means that the online store is adding value to the company, rather than poaching revenue from another business segment.

One could argue that Home Depot has been getting a big boost from strong spending on home improvement since the financial crisis of 2008. However, the same could be argued for Amazon. General retail spending has been growing steadily since 2009 as well, and home improvement spending usually follows the overall trend. So, for the sake of this discussion, suffice to say that both companies are benefiting from the same tailwind. At the moment, though, it's the big-box store that's posting the better digital growth.

View of a Home Depot from the parking lot. A customer is pushing a cart out of the store.

Image source: Home Depot.

Two very different stocks

Both Home Depot and Amazon are priced at a premium because of their fast growth, but Amazon especially so. Price-to-earnings ratios based on the last 12 months' performance are 27.5 and 279, respectively. Amazon's number is huge, but when valuing a business, it's the future that really matters.

Home Depot's one-year forward P/E is 19.7. Amazon's, on the other hand, is 85.6, implying not just huge growth in the months ahead but strong bottom-line growth for many more years. That is, of course, a good possibility, especially with Amazon Web Services firing on all cylinders; that segment grew 62% and contributed 89% of operating income in the first quarter of 2018. But strictly in terms of retail, Home Depot is more profitable and a better growth story at the moment. 

The majority of retail spending in the U.S. still happens at brick-and-mortar stores, so Home Depot will continue to benefit from that trend while building its e-commerce. With lower P/E ratios on a trailing- and forward-12-month basis and a faster-growing online presence, Home Depot is a better value play on digital sales over industry leader Amazon, and a best-in-class pick for investors looking to tap into the shift to online retail.