Image source: Getty Images.

Costco (COST 0.17%) and Target (TGT -0.70%) are both successful national retailers. In a brutally competitive industry, they each stand out by generating over $2 billion of annual earnings and handling millions of transactions per year.

There are major differences between these two companies that could make one a better buy over the other for long-term investors. Below, we'll look at a few key metrics that separate them -- with an eye toward finding the better stock to own today.

Investment statistics matchup:

 Metric

Costco

Target

Market cap

$70 billion

$40 billion

Sales growth

4%

2.1%

Net profit margin

2%

4.6%

Dividend yield

1.1%

3.3%

Price-to-sales

0.59 times

0.61 times

Price-to-earnings

29 times

13 times

52-week stock performance

(1%)

(1%)

Sales growth is for stores open at least one year and excludes fuel sales and exchange rate changes. Data sources: Company financial filings and S&P Global Market Intelligence.

Growth trends

Costco and Target are both enduring a sales growth slump right now. Costco's epic customer traffic gains, which were averaging over 4% per year for the last six years, fell to just 2% in 2016. That slump was the biggest factor behind the warehouse giant's comparable-store sales slowdown that marked its worst annual performance since 2010.

Chart by author. Data source: Costco financial filings.

As a membership club that derives most of its profits from subscription fees, customer traffic is critically important to the long-run health of the business. That's why Costco executives are hoping that, with its co-branded credit card launch complete, those trends can begin climbing back toward 4% again.

Target has a much weaker growth profile. Customer traffic is down 1% over the last nine months, which puts it behind Costco and also trails Wal-Mart (WMT 1.32%) and its 1% uptick. However, there are signs of improvement for the retailer. Target recently hit the high end of its quarterly sales growth goal thanks to a surprise bump in visitors during the key back-to-school shopping time. Management boosted its holiday season outlook, too, and now believes that the company could return to positive comps to close out the 2016 calendar year. The good news for shareholders is that the fastest gains are happening in its most profitable categories, including baby care and apparel.

Profits and dividends

As a result, Target's gross margin is improving, rising to 31% of sales in 2016 from 30% in the prior year. That compares well with Wal-Mart's 26% and also blows Costco's 13% figure away.

TGT Gross Profit Margin (TTM) Chart

TGT gross profit margin (TTM) data by YCharts.

Thanks to the stronger income profile, and the fact that Target, unlike Costco, isn't expanding its store footprint at an aggressive pace, the company has far more cash that it can send back to shareholders. Target is one of just a few Dividend Aristocrats that come from the retailing industry, which shows how seriously its management team takes its commitment to cash returns. It has raised its dividend for 45 consecutive years and its current 3.3% yield trounces Costco's 1.1% promise.

Finding value

Both stocks have ticked down over the last year even as the broader market surged higher, meaning the risk in overpaying for either company has dropped. But don't let their similar price-to-sales ratio convince you that Target and Costco are each valued equally. Despite its lower profitability, Costco has a more stable profit base that's tied to recurring subscription fees. Meanwhile, its (slowing) growth pace is still the fastest in its industry. Remember that rival Wal-Mart's Sam's Club hardly expanded at all over the last fiscal year.

Still, income investors might prefer Target over Costco due to its long track record of dividend boosts and its market-thumping yield. In the other key metrics of sales growth, earnings strength, and global market potential, though, the warehouse retailer comes out on top in this matchup. Thus, investors have plenty of good reasons to pay the premium and buy Costco over its retailing rival at today's prices.