Palantir Was the Top-Performing Stock in the S&P 500 in 2024. But This Other Artificial Intelligence (AI) Powerhouse Has Been the Best S&P 500 Stock Over the Last 2 Decades.

Source The Motley Fool

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.

Upward and downward facing arrows behind blocks that spell out S&P 500.

Image source: Getty Images.

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.

The top performer in the S&P 500 over the long-run

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%

Data source: YCharts.

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.

NVDA Total Return Level Chart

NVDA Total Return Level data by YCharts

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.

Reasonably valued despite a soaring stock price

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.

NVDA Net Income (Quarterly) Chart

NVDA Net Income (Quarterly) data by YCharts

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.

Should you invest $1,000 in Nvidia right now?

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.

Disclaimer: For information purposes only. Past performance is not indicative of future results.
placeholder
AUD/USD: Current price action is likely the early stages of a recovery – UOB GroupAustralian Dollar (AUD) is likely to trade in a sideways range between 0.6220 and 0.6290. In the longer run, current price action is likely the early stages of a recovery phase that could potentially reach 0.6350, UOB Group’s FX analysts Quek Ser Leang and Lee Sue Ann note.
Author  FXStreet
Jan 22, Wed
Australian Dollar (AUD) is likely to trade in a sideways range between 0.6220 and 0.6290. In the longer run, current price action is likely the early stages of a recovery phase that could potentially reach 0.6350, UOB Group’s FX analysts Quek Ser Leang and Lee Sue Ann note.
placeholder
Five bullish Shiba Inu (SHIB) Price Predictions for April 2025SHIB price targets diverge as investors weigh Shibarium L3 upgrades, burn-rate surges, and altcoin market sentiment. Forecasts range from a conservative $0.000012 to a parabolic $0.00030.
Author  FXStreet
Apr 16, Wed
SHIB price targets diverge as investors weigh Shibarium L3 upgrades, burn-rate surges, and altcoin market sentiment. Forecasts range from a conservative $0.000012 to a parabolic $0.00030.
placeholder
Ethereum Price Stays Resilient — Upside Break May Be AheadEthereum price started a downside correction below the $1,780 level. ETH is now consolidating near the $1,800 zone and might aim for a move above $1,820.
Author  NewsBTC
Yesterday 03: 52
Ethereum price started a downside correction below the $1,780 level. ETH is now consolidating near the $1,800 zone and might aim for a move above $1,820.
placeholder
Gold price slides back closer to $3,300 amid tariff deals optimismGold price (XAU/USD) struggles to capitalize on the previous day's bounce from the vicinity of the $3,265-3,260 pivotal support and attracts fresh sellers during the Asian session on Tuesday.
Author  FXStreet
21 hours ago
Gold price (XAU/USD) struggles to capitalize on the previous day's bounce from the vicinity of the $3,265-3,260 pivotal support and attracts fresh sellers during the Asian session on Tuesday.
placeholder
EUR/USD ticks lower despite uncertainty over US-China tradeEUR/USD edges lower to near 1.1400 during European trading hours on Tuesday. The major currency pair ticks lower as the US Dollar (USD) steadies, but remains broadly on edge amid escalating uncertainty about the trade outlook between the United States (US) and China.
Author  FXStreet
18 hours ago
EUR/USD edges lower to near 1.1400 during European trading hours on Tuesday. The major currency pair ticks lower as the US Dollar (USD) steadies, but remains broadly on edge amid escalating uncertainty about the trade outlook between the United States (US) and China.
goTop
quote