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
Pepe Predicted To Overtake Shiba Inu But This Crypto Could Leave Both Behind With 100x GainsSince early 2024, meme coins have expanded their dominance as the fastest-moving crypto assets. We’ve seen assets like PEPE, Floki, Dogecoin, Dogwifhat, Shiba Inu, and BONK leading the pack as some of the most successful meme coins. However, while 2024 saw PEPE rise over 3000%, moving from a low of 0.00000091 to 0.00002825, the Shiba […]
Author  Cryptopolitan
7 hours ago
Since early 2024, meme coins have expanded their dominance as the fastest-moving crypto assets. We’ve seen assets like PEPE, Floki, Dogecoin, Dogwifhat, Shiba Inu, and BONK leading the pack as some of the most successful meme coins. However, while 2024 saw PEPE rise over 3000%, moving from a low of 0.00000091 to 0.00002825, the Shiba […]
placeholder
Could Amazon Be Your Ticket to Becoming a Millionaire by 2030?Amazon (NASDAQ: AMZN) has certainly made early investors rich. The tech juggernaut's share price has rocketed 222,100% higher in the past 28 years. An investor that put just $451 i
Author  The Motley Fool
7 hours ago
Amazon (NASDAQ: AMZN) has certainly made early investors rich. The tech juggernaut's share price has rocketed 222,100% higher in the past 28 years. An investor that put just $451 i
placeholder
WTI trades near $78.50 after pulling back from six-month highsWest Texas Intermediate (WTI) Oil price retreats after reaching six-month highs, gaining more than 3%, in the previous session, trading around $78.50 per barrel during the European hours on Thursday.
Author  FXStreet
7 hours ago
West Texas Intermediate (WTI) Oil price retreats after reaching six-month highs, gaining more than 3%, in the previous session, trading around $78.50 per barrel during the European hours on Thursday.
placeholder
Litecoin ETF may be near SEC approval after Canary Funds amends the filingCanary Capital’s Litecoin ETF could receive the Security and Exchanges Commission’s approval soon.
Author  Cryptopolitan
9 hours ago
Canary Capital’s Litecoin ETF could receive the Security and Exchanges Commission’s approval soon.
placeholder
U.S. SEC files last-minute opening brief against Ripple challenging 2023 rulingThe U.S. SEC is willing to continue its years-long battle with the blockchain-powered cross-border remittance provider Ripple. However, Ripple’s chief legal officer Stuart Alderoty termed the case as noise and believes the case will be dismissed in the next administration.
Author  Cryptopolitan
10 hours ago
The U.S. SEC is willing to continue its years-long battle with the blockchain-powered cross-border remittance provider Ripple. However, Ripple’s chief legal officer Stuart Alderoty termed the case as noise and believes the case will be dismissed in the next administration.
goTop
quote