Johnson & Johnson (JNJ -0.46%) is a favorite of long-term investors everywhere, and it's no surprise why. Thanks to its diversified business, steady dividend payout, and an ultra-lengthy history of profitable operation, the stock is at home in most retirement portfolios.

As a result of that popularity, this stalwart just might be pricier than most investors realize. Let's analyze its valuation and find out if you are getting a deal when buying the stock right now.

Johnson & Johnson stock isn't cheap

With a price-to-earnings (P/E) ratio of 33, J&J's stock is on the pricey side in comparison to the pharma industry's average P/E of 23, as well as in comparison to the entire market's average P/E of 25. But whether it's overvalued is a bigger question. Hype surrounding new products, acquisitions, revenue models, or company leadership can often cause valuations to inflate temporarily. Take a look at this chart:

JNJ PE Ratio Chart

JNJ PE Ratio data by YCharts

As you can see, there is indeed a driver of the stock's valuation, making it a bit higher than normal. The likely culprit is the partial spinoff of Kenvue, the business unit formerly responsible for J&J's consumer healthcare products, which was completed on May 4 of this year. While Johnson & Johnson still owns 91% of Kenvue's shares, management has promised that it'll be able to grow its pharmaceutical and medical device segments faster thanks to the change. So it could make sense that its valuation is now a bit wider than before, as those benefits should, in theory, start to roll in for shareholders.

But will the company grow fast enough to justify its price tag? Probably not in the short term. Per Wall Street analysts, J&J's long-term earnings per share (EPS) growth rate is estimated to be around 4.4% annually. That pace is even slower than in 2019, before the spinoff was announced, when analysts estimated that it'd add to its EPS by around 8% per year. So it seems like the analysts don't buy management's arguments in favor of the spinoff.

There could still be an investing thesis for this business, however. With a 62-year-long history of annual dividend increases and management's stated commitment to continuing to pay shareholders competitively, holding on to J&J shares for the next few decades will likely lead to significant total returns.

In fact, if you'd bought shares in July 2003, you'd have experienced dividend growth of 395.8%, which is far greater than the increase of the market's average dividend, which only rose by 309.5%. And while its dividend yield near 3% today might not get your heart racing, after 20 years of having your cost basis reduced faster and faster each year by ever-rising dividend payments, assuming that you reinvest them, your opinion could be a lot different.

Know what you're paying for

Regardless of its slow near-term growth rate and potential to be a favorable investment to hold for a long time, one of the major appeals of Johnson & Johnson stock is its safety. It's one of the largest pharmaceutical and medical device manufacturers in the world, and with trailing-12-month (TTM) free cash flow (FCF) of $17.1 billion, it would take a series of calamities and persistently unfavorable headwinds before actually shrinking or being seriously threatened.

Still don't believe that it's stable? Its shares bounced back from the coronavirus crash in 2020 faster than the rest of the market, and they didn't lose as much value during the worst of it, either. Of course, it helped that J&J was one of three companies producing a COVID-19 vaccine, and the only one with a one-dose version.

In that light, another part of the premium valuation makes sense. Quickly growing companies are seldom stable or predictable, so they're often higher risk. But J&J is proven to be lower risk, even if its future returns will require a very long time to be realized, and even if most other investments will gain in value faster. 

J&J is probably still slightly overvalued. Nonetheless, if you're willing to be extremely patient and are looking for a stock that will let you sleep at night, its valuation shouldn't bother you whatsoever. After all, you're paying for quality, which is something that great investors like Warren Buffett often extol the virtues of.