The retailing world is going through a dramatic shift as customers move their spending toward online sales channels. But the recent results from major companies have shown that physical stores still have a big role to play in the market.

Sure, e-commerce will likely keep climbing from its current position of accounting for 10% of total retailing sales (up from 4% a decade ago). But that doesn't mean sellers like Walmart (NYSE:WMT) and Target (NYSE:TGT) can't succeed in the new multichannel selling environment.

With that bigger picture in mind, let's stack the two retailing giants against each other as stock investments.

Walmart vs. Target stocks

Metric

Walmart

Target

Market cap

$245 billion

$38 billion

Sales growth

3%

3.4%

Net profit margin

2%

4.1%

Dividend yield

2.4%

3.4%

Forward P/E

16

13

Profit margin is for the most recent complete fiscal year. Data sources: Company financial filings and S&P Global Market Intelligence.

Sales and profits

Both companies have been enjoying steadily improving sales results that have mainly come at the expense of profitability. In its most recent quarter, Target logged its best quarterly traffic rate in a decade, which allowed comparable-store sales, or sales at existing locations, to rise 3% and nearly match the stellar rate it managed in the previous quarter. Likewise, Walmart notched its best sales growth performance in eight years at the end of 2017 and followed that up with a solid start to fiscal 2018 as comps improved by 2.1%.

Profits are a different story. Walmart's operating income dipped last quarter, just as it has for more than a year. And Target is on track for a second straight year of declining profitability, too.

WMT Operating Margin (TTM) Chart

WMT Operating Margin (TTM) data by YCharts.

Both retailers are keeping their prices low in a bid to protect customer traffic trends. At the same time, they're ramping up spending on digital sales, which in most cases are occurring at lower profit margins. These trends, plus rising costs on wages and store remodels, are likely to continue pressuring profitability for both Target and Walmart.

Why Walmart looks stronger over the long term

Target's business seems more attractive than Walmart's in a few keys ways. It's growing faster, for one, and it sports a higher profit margin thanks to the fact that its portfolio tilts more toward products like apparel and home goods while Walmart's focuses on consumer staples like groceries.

A woman choosing between two detergents.

Image source: Getty Images.

Target also pays a dividend that's about a full percentage point above Walmart's 2.4%. Finally, the stock is valued at a discount at 13 times expected earnings compared to 16 times for its larger rival.

However, there are good reasons for investors to have assigned that premium to Walmart. As a truly global retailer, it is far more diversified than Target, which failed in its last attempt to expand into Canada. Walmart's $28 billion of annual operating cash flow, meanwhile, isn't far from Target's entire market capitalization. And that financial strength gives it the resources to make big bets on future growth. These include acquisitions like its $16 billion purchase of India-based Flipkart and the aggressive push it's making into a grocery delivery service in the U.S.

In my view, that flexibility helps make Walmart stock a better long-term bet today. For an era that's likely to pair more industry pressure with plenty of opportunities for growth, I'd rather own the industry leader than its smaller peer. Yes, shares are pricier, but Walmart has a clearer track toward consistent earnings growth after transitioning into a multi-channel retailer.

Demitrios Kalogeropoulos has no position in any of the stocks mentioned. The Motley Fool has no position in any of the stocks mentioned. The Motley Fool has a disclosure policy.