Following a terrific performance in 2023, the S&P 500 and Nasdaq Composite posted another year of generous gains in 2024. Among the market's biggest gainers over the last two years have been megacap technology stocks -- collectively referred to as the "Magnificent Seven."
However, last year a smaller player actually outperformed each and every one of its peers by a considerable margin. In 2024, shares of data analytics firm Palantir Technologies (NASDAQ: PLTR) soared by 340% -- making it the top performer in the S&P 500 index.
Start Your Mornings Smarter! Wake up with Breakfast news in your inbox every market day. Sign Up For Free »
With that said, Palantir's soaring share price has resulted in some considerable expansion of its valuation. By most traditional valuation metrics, Palantir stock should be considered pricey and overbought at the moment.
Below, I'll reveal which artificial intelligence (AI) stock has been a superior performer in the S&P 500 over the long run. Additionally, I'll explain why this stock should be considered reasonably valued and could make for a tempting buy right now.
According to data compiled by YCharts, semiconductor stock Nvidia (NASDAQ: NVDA) has been the top performer in the S&P 500 over the long run. In the table below, I've broken down Nvidia's total return over the last five, 10, 15, and 20 years.
Metric | 5 Years | 10 Years | 15 Years | 20 Years |
---|---|---|---|---|
Nvidia total stock return | 2,130% | 28,650% | 32,990% | 82,830% |
To put these percentages into perspective, if you had invested even just $1,000 into Nvidia 20 years ago then you would have over $800,000 today.
There are a few ideas I'd like to explore given the figures above. Every now and again a game-changing company comes along and turns a modest investment into generational wealth. However, returns of this magnitude are quite uncommon.
The broader theme I'd like to drive home is the importance of long-term investing. Berkshire Hathaway CEO and world-renowned investor Warren Buffett once said, "If you aren't thinking about owning a stock for ten years, don't even think about owning it for ten minutes." Clearly, holding onto Nvidia stock over the last two decades has been a wise decision.
Nevertheless, just because you decide to buy a stock and hold it for many years does not guarantee market-beating returns. Whether people want to admit it or not, there is always some degree of luck involved in the world of investing.
In the chart above, you can see that the majority of Nvidia's gains took place over the last couple of years. The reason? Because AI became the next megatrend in the stock market, and Nvidia's critical role in the space has fueled an epic period of prolonged buying activity.
Ultimately, while those who bought Nvidia stock 20 years ago and actually held it have a lot to be happy about, it's highly unlikely those people were thinking about AI when they took a position in the company.
In 2024 alone, shares of Nvidia rose by 171% and the company gained over $2 trillion in market capitalization. Yet despite this unprecedented pace of valuation growth, Nvidia stock remains reasonably valued.
The chart above illustrates an interesting dynamic between Nvidia's revenue and profitability. Specifically, while AI tailwinds have fueled record growth for the company across the board, Nvidia's net income and free cash flow are accelerating at a faster pace than the company's market value.
This means that even though Nvidia stock has climbed exponentially over the past few years, shares remain at a reasonable price point when looked at through the lens of profit-based valuation metrics such as price-to-earnings (P/E) or price-to-free-cash-flow (P/FCF) ratios.
Right now, Nvidia stock trades at a forward price-to-earnings ratio of 31.7 -- nearly identical to where it was trading this time last year. Considering 2025 is looking like it will be yet another milestone year for the company thanks to its new Blackwell chip architecture, I suspect Nvidia's profit margins are in a good position to continue expanding.
So long as the current dynamic illustrated in the chart above continues to hold, Nvidia stock should remain fairly priced -- making it a screaming buy for investors with a long-term time horizon.
Before you buy stock in Nvidia, consider this:
The Motley Fool Stock Advisor analyst team just identified what they believe are the 10 best stocks for investors to buy now… and Nvidia wasn’t one of them. The 10 stocks that made the cut could produce monster returns in the coming years.
Consider when Nvidia made this list on April 15, 2005... if you invested $1,000 at the time of our recommendation, you’d have $807,495!*
Stock Advisor provides investors with an easy-to-follow blueprint for success, including guidance on building a portfolio, regular updates from analysts, and two new stock picks each month. The Stock Advisor service has more than quadrupled the return of S&P 500 since 2002*.
See the 10 stocks »
*Stock Advisor returns as of January 13, 2025
Adam Spatacco has positions in Nvidia and Palantir Technologies. The Motley Fool has positions in and recommends Berkshire Hathaway, Nvidia, and Palantir Technologies. The Motley Fool has a disclosure policy.