Having a million dollars by the time you retire is a good target to aim for in investing. Whether you put that money into dividend stocks that can help generate recurring revenue or you slowly take funds out, you'll have lots of options available for enjoying your retirement.

The key in investing for retirement is to put money into low-risk stocks that will keep your money safe while at the same time provide ample opportunity for it to rise in value over the years.

Johnson & Johnson (JNJ 0.57%) is a big-name healthcare stock to own, and it has risen more than 150% over the past decade. But is it a stock that could potentially help you retire a millionaire?

J&J stock has performed on par with the S&P 500

When including dividend income, shares of Johnson & Johnson have risen by 234% over the past 10 years, which is nearly identical to the S&P 500's total returns of approximately 230%. The good and bad news for investors is that the company hasn't been performing any better than the broader markets.

While that's good for stability, it may not give investors much of an incentive to pick the stock over other, comparable investments. Without a big growth catalyst, there may not be much of a reason to expect Johnson & Johnson to outperform the markets over the long haul.

It is going to focus on higher-growth segments

Last year, Johnson & Johnson announced that it would be spinning off its consumer health segment into a separate business. The company expects the new company to go public by November 2023. Deploying the move could make Johnson & Johnson a more attractive growth investment. Sales from its consumer segment were flat last year while the pharmaceutical business grew by 14% and medical device revenue jumped by 18%. 

There's also the added incentive of getting away from a business that's been a constant headache for executives. From legal issues surrounding talc-based baby powder to recalls of its Neutrogena and Aveeno products last year, the company may pose less risk to investors by focusing on pharmaceuticals and medical devices. 

Further acquisitions may be a possibility, too

In 2021, Johnson & Johnson's revenue topped $93.8 billion -- an all-time high for the company. And what's encouraging is that the company anticipates more growth ahead. This year, it projects that sales will come in between $94.8 billion and $95.8 billion.

One way the company can accelerate its growth is via acquisitions. A couple of years ago, it completed a $6.5 billion acquisition of Momenta Pharmaceuticals, which makes novel therapies and can help expand J&J's pipeline and growth potential. With the company consistently generating close to $20 billion in free cash flow in each of the past three years, it is in a great position to take on more deals in the future.

The stock can make you a millionaire -- if you invest enough

To become a millionaire, you need an investment that can drive a lot of growth. Over the past 10 years, J&J's stock has averaged a compound annual growth rate of approximately 12.8% when you include its dividend. If it were to continue growing at that rate for 25 years, your investment would be worth more than 20 times what it is today. Thus, a $50,000 investment would be enough to get you to $1 million -- assuming, of course, that you have at least 25 years left before you retire.

It's not an unreasonable growth rate to assume since the stock pays a dividend that yields 2.7% and its business generates plenty of cash to enable more long-term expansion. High-margin businesses like Johnson & Johnson that bring in billions in cash can make for solid long-term buys. And so I'm inclined to say that it can make you a millionaire if you're willing to invest at least $50,000 into the stock and hold on to it for the long haul.