Despite the onslaught of e-commerce, 2018 has shown that brick-and-mortar retail is alive and well. After all, even Amazon.com has had success opening physical retail stores lately. Physical stores are not dead; investors just have to find the right retailers that can deliver positive comparable-store sales and profitability in today's competitive landscape.

Two retail candidates to survive the Amazon apocalypse are Nordstrom (NYSE:JWN) and The TJX Companies (NYSE:TJX). Both companies have been having success with their respective off-price store concepts. Let's take a look at the investment case for each to determine which one investors should buy today.

Two smiling women looking in a store window

IMAGE SOURCE: GETTY IMAGES.

A technologically advanced department store

Nordstrom was founded in 1901 as a shoe store in Seattle, and today has 363 stores open in the U.S. and 9 stores in Canada. It operates 134 full-price department stores and 236 off-price Nordstrom Rack stores, with the company's largest presence on the West Coast.

As a group, department stores have been the sour apples of the retail industry lately, but thanks to superior brand positioning and investments management has made in e-commerce, Nordstrom has been able to rise above its peers.

One of the ways it's been able to do that is its growing line of off-price Nordstrom Rack stores; they've allowed Nordstrom to reach younger shoppers who can't afford some of the full-price merchandise sold in its flagship department stores.

After a few years of flattish comparable-store sales growth, Nordstrom reported sales growth of 7.1% in the second quarter, with earnings per share soaring 46% higher. Comparable-store sales were up 4%, equally balanced across Nordstrom's full-price stores and its off-price Nordstrom Rack stores. Earnings benefited from a lower tax rate and from management's focus on expanding operating margin, as part of its five-year plan to grow profit faster than the top line. Co-president Blake Nordstrom said: "We remain on track for 2018 to be an inflection point for profitable growth."

Over the next five years, management has guided for 3% to 4% sales growth. The company has spent the last several years investing heavily in e-commerce, including one of the best mobile apps in retail -- which has garnered a five-star score in Apple's App Store, out of 197,000 user reviews. (In comparison, the app for T.J.Maxx, a TJX Companies chain, has only a 2.4-star average rating.)

Additionally, Nordstrom has invested in data analytics and supply-chain operations, pressuring margins in recent years. But with these investments behind it, Wall Street analysts expect the company to grow earnings by 9.4% annually over the next five years.

A well-oiled retail operation

TJX is the largest off-price retailer of apparel and home goods. It has 4,141 stores open worldwide, under the store brands T.J.Maxx, Marshalls, and HomeGoods. The company has a growing presence in Canada, Europe, and Australia.

Metric Nordstrom TJX Companies
Market cap $10.37 billion $65.9 billion
Revenue (TTM) $15.96 billion $37.74 billion
Net income (TTM) $514 million $2.975 billion
Dividend yield 2.4% 1.5%
Forward P/E 16.3 19.6
PEG ratio 1.76 1.87

Data sources: YCharts and Yahoo Finance! TTM = trailing-12-month. P/E = price-to-earnings ratio; PEG = price to earnings to growth.

Taking a look at recent performance: TJX grew sales 12% in the second quarter, with earnings per share up 38%. However, non-GAAP earnings increased 16%. Higher customer traffic drove solid comparable-sales growth of 6% across the company's segments, including Marmaxx, HomeGoods, TJX Canada, and TJX International.

TJX has perfected the off-price model for four decades. The company has only had one year in its history of negative comparable-sales growth -- that's beyond impressive, given how competitive retail is, not to mention the susceptibility of the industry to weak results during economic recessions.

Despite the company's $66 billion market cap and already large store footprint, management believes it can reach 6,100 stores long term. Wall Street analysts believe the company will grow earnings per share 11.5% annually over the next five years.

Which is the better buy?

Both companies are performing well right now, and are solid retail stocks to hold for the long term. TJX has a longer history of delivering consistent results, but Nordstrom looks better equipped for mobile commerce, and its Nordstrom Rack stores are beginning to offer the same benefits to value-hunters as T.J.Maxx stores.

When we look at valuation, Nordstrom is the clear winner. Nordstrom shares currently trade at a forward P/E of 16.3; TJX is more expensive, with a current forward P/E of 19.6. Nordstrom is also cheaper based on its PEG ratio (price-to-earnings ratio divided by expected earnings growth).

Both stocks pay a dividend, but Nordstrom's current yield of 2.4% is higher than TJX's yield of 1.5%. So, in addition to a cheaper forward P/E, Nordstrom also has something to offer those who like some income to go along with growing earnings.

Considering all of this, Nordstrom is the better buy for investors today.

John Mackey, CEO of Whole Foods Market, an Amazon subsidiary, is a member of The Motley Fool's board of directors. John Ballard has no position in any of the stocks mentioned. The Motley Fool owns shares of and recommends AMZN and AAPL. The Motley Fool has the following options: long January 2020 $150 calls on AAPL and short January 2020 $155 calls on AAPL. The Motley Fool recommends Nordstrom and The TJX Companies. The Motley Fool has a disclosure policy.