Image credit: Getty Images.

When people choose what stocks to help them fund decades of retirement, Procter & Gamble (PG -0.36%) and Johnson & Johnson (JNJ -1.40%) are two of the most popular choices. And why not? Over the past 30 years, both have produced the kind of results that would please any retiree.

JNJ Total Return Price Chart

JNJ Total Return Price data by YCharts.

Which is the better stock to buy today? While you certainly aren't forced to pick just one stock, it is an interesting question. There's no way to get a definitive answer, but you can explore which stock you're more comfortable with by looking at both companies from three different angles.

Financial fortitude

Cash in the bank gets a bad rep. While many investors would like to see cash being returned to them, used for share buybacks, or reinvested in the business, cash that just sits there is incredibly important.

That's because every company, at some point in time, will experience difficulties. Whether those difficulties are self-inflicted or macro in nature doesn't really matter. Companies that have cash on hand have options -- to outspend rivals, keep paying dividends, or even make acquisitions -- while debt-heavy organizations are forced to scramble to just make ends meet.

Here's how these two stalwarts stack up; keep in mind that Johnson & Johnson is valued roughly 35% larger than Procter & Gamble.

Company

Cash

Debt

Net Income

Free Cash Flow

Procter & Gamble

$15.9 billion

$18.9 billion

$10.6 billion

$11.5 billion

Johnson & Johnson

$40.4 billion

$23.5 billion

$15.9 billion

$13.4 billion

Data source: Yahoo! Finance. Cash includes short- and long-term investments. Net income and free cash flow are presented on a trailing-12-month basis.

Before diving into which one of these two is "better," it's worth acknowledging that both of these companies are in excellent financial shape. The fact that each is able to pull in more than $10 billion in free cash flow each year is an excellent sign.

However, since this is a competition, I have to give the edge to Johnson & Johnson. Not only does the company bring in more income and free cash flow relative to its size, but it has a much more favorable cash-to-debt ratio.

Winner = Johnson & Johnson

Sustainable competitive advantages

At the end my of my investing career, I have little doubt that the most important factor driving results over the long run will be the sustainable competitive advantages of the underlying companies I invested in. Often called a "moat" in investing circles, a sustainable competitive advantage is essentially the special "something" that differentiates a company from its competitors.

Johnson & Johnson has three different divisions: consumer, pharmaceutical, and medical devices. The consumer division's moat is provided by the strength of its brands, like Band Aid and Tylenol. Patents protect the medical devices and pharmaceutical units. However, while the pharmaceutical unit can be lucrative, the patents on these drugs don't last forever. To stay competitive, Johnson & Johnson needs to reinvest in its drug pipeline and hope that at least a few compounds will not only reach FDA approval, but be a big hit with patients.

Procter & Gamble, on the other hand, relies almost solely on the strength of its brands. The company has 22 brands with over $1 billion in annual sales and 19 more with over $500 million. Among these names are Gillette, Bounty, Pringles, Tide, Crest, Pampers, and Duracell. Because these brands have been around for so long -- and gained people's trust for providing high-quality and reliable products -- the company has a pricing advantage to keep the competition at bay.

Because the strength of the moat around Procter & Gamble's brands division is more uniform across its sales, and because the patent moat for Johnson & Johnson's pharmaceutical division can be more variable, I give the nod here to Procter & Gamble.

Winner = Procter & Gamble

Valuation

To break the tie between these two, we turn toward valuation. While there's no perfect way to measure this, I've included three of my "go-to" figures below.

Company

P/E

P/FCF

PEG Ratio

Procter & Gamble

23

20

2.7

Johnson & Johnson

17

23

2.5

Data source: E*Trade, Yahoo! Finance. P/E is calculated using non-GAAP earnings, if applicable.

On this trait, the companies are in a virtual tie. Generally, I favor P/FCF over P/E, if only because it is less susceptible to accounting gimmicks. Even then, though, these two are awfully close.

To break the tie, I looked at each company's dividend. For each company, 64% of FCF had been used to pay the dividend over the past 12 months. That's a great metric, as it shows that the dividends are both safe and have room for growth. Procter & Gamble's, though, is yielding 3.2%, while Johnson & Johnson's offers a 2.9% yield.

While that's a relatively small margin, it was enough for me to give the nod to Procter & Gamble.

Winner = Procter & Gamble

Final call = Procter & Gamble

Clearly, investors really can't go wrong with either company. By choosing Procter & Gamble, you get a slightly higher dividend and a more stable moat. Johnson & Johnson's dividend is nothing to sneeze at, either, and if the company has a few big hits from the pharmaceutical division, it could prove to be the outperformer of the two.

As things currently stand, though, I'm siding with having one bird in the hand versus two in the bush.