Dividend stocks outperform non-dividend-paying stocks over the long run. It happens in good markets and bad, and the benefit of dividends can be quite striking -- dividend payments have made up about 40% of the market's average annual return from 1936 to the present day.

But few of us can invest in every single dividend-paying stock on the market, and even if we could, we're likely to find better gains by being selective. Today, two of America's leading grocers will square off in a head-to-head battle to determine which offers a better dividend for your portfolio.

Tale of the tape
Founded in 1983, Costco Wholesale (COST 0.17%) is the biggest wholesale-club operator in the United States and is the seventh-largest retailer in the world. It is also ranked among the top 25 companies on the global Fortune 1000 list. Headquartered in Seattle, the company now operates more than 640 membership-only warehouse stores, mainly under the Costco Wholesale banner, and serves roughly 71 million members in more than 10 countries, including Australia, Canada, Mexico, Taiwan, and the U.K. Costco has a diversified product portfolio of more than 4,000 discounted offerings, ranging from fresh food and pharmaceuticals to liquors, appliances, and tires. Costco has been aggressively expanding into international markets, especially Asian countries, which offer a massive untapped base of potential new members.

Established in 1915, Safeway (NYSE: SWY) is one of the largest food and drug retailers in North America. Headquartered in Pleasanton, Calif., the company operates more than 1,400 stores that are mainly situated in the western, midwestern, and mid-Atlantic regions of the U.S. Safeway also owns a 49% stake in Casa Ley, which currently operates more than 190 food and variety stores in Mexico. The company also holds a 73% interest in Blackhawk Network Holdings, but it announced plans to divest its Canadian retail operations for more than $5 billion in 2013.

Metric

Costco

Safeway

Market cap

$51.2 billion

$7.8 billion

P/E ratio

25.3

13.3

Trailing-12-month profit margin

1.9%

1%

TTM free cash flow margin*

1.1%

1.8%

5-year total return 

153.3%

50.1%

Source: Morningstar and YCharts. *Free cash flow margin is free cash flow divided by revenue for the trailing 12 months.

Round one: Endurance (dividend-paying streak)
According to Dividata, Costco began quarterly dividend payouts in 2004, and has been paying ever since. On the other hand, Safeway has paid quarterly dividends since 2005. That's close, but Costco takes the endurance crown.

Winner: Costco, 1-0.

Round two: Stability (dividend-raising streak)
According to Dividata, Costco has been increasing dividend payouts at least once every year since 2005, while Safeway began increasing shareholder distributions in 2006. Chalk up another narrow victory for Costco here.

Winner: Costco, 2-0.

Round three: Power (dividend yield)
Some dividends are enticing, but others are merely tokens that barely affect an investor's decision. Have our two companies sustained strong yields over time? Let's take a look:

COST Dividend Yield (TTM) Chart

COST Dividend Yield (TTM) data by YCharts.

Winner: Safeway, 1-2.

Round four: Strength (recent dividend growth)
A stock's yield can stay high without much effort if its share price doesn't budge, so let's take a look at the growth in payouts over the past five years.

COST Dividend Chart

COST Dividend data by YCharts.

Winner: Safeway, 2-2.

Round five: Flexibility (free cash flow payout ratio)
A company that pays out too much of its free cash flow in dividends could be at risk of a cutback, particularly if business weakens. We want to see sustainable payouts, so lower is better:

COST Cash Dividend Payout Ratio (TTM) Chart

COST Cash Dividend Payout Ratio (TTM) data by YCharts.

Winner: Safeway, 3-2.

Bonus round: Opportunities and threats
Safeway may have come from behind to win the best-of-five on the basis of its history, but investors should never base their decisions on past performance alone. Tomorrow might bring a far different business environment, so it's important to also examine each company's potential, whether it happens to be nearly boundless or constrained too tightly for growth.

Costco opportunities

Safeway opportunities

Costco threats

 Safeway threats

One dividend to rule them all
In this writer's humble opinion, it seems that Costco has a better shot at long-term outperformance, thanks to generally unmatched customer loyalty, which allows it to generate operating profit 12 months in advance through annual membership fees. In addition, Costco continues to add new products in order to provide customers with a pleasant top-tier shopping experience and should gain millions of new members from its expansion into lucrative overseas markets.

By contrast, Safeway has been undergoing extensive restructuring at a time when competition and consolidation in the grocery sector continues to heat up -- the company may well face strong headwinds from Kroger and Whole Foods as these competitors continue to expand their domestic footprints.

You might disagree, and if so, you're encouraged to share your viewpoint in the comments below. No dividend is completely perfect, but some are bound to produce better results than others. Keep your eyes open -- you never know where you might find the next great dividend stock!