It would be an understatement to say that artificial intelligence (AI) has taken the world by storm over the past couple of years. Although the technology has been around for a while, recent developments and the explosion in generative AI apps like ChatGPT have brought the technology to the mainstream.
This recent AI boom has benefited many companies and their stocks, as investors have rushed to pour money into these companies in hopes of benefiting from the expected growth opportunities. Two of the largest beneficiaries have undoubtedly been Palantir Technologies (PLTR +3.05%) and Nvidia (NVDA +1.49%). In the past three years, their stock prices are up 2,000% and 1,350%, respectively.
Despite their immense recent success, one stock stands out as the better investment between the two. Let's take a look at which one it is.

Image source: Nvidia.
What Palantir has going for it
Palantir is an AI data analytics company specializing in turning tons of data into actionable insights. For a while, Palantir was viewed as a niche government vendor that only appealed to intelligence and defense agencies. However, with the growth of its Artificial Intelligence Platform (AIP), this is no longer the narrative.

NASDAQ: PLTR
Key Data Points
Over the past few quarters, Palantir's U.S. commercial segment has been its fastest-growing segment. In the second quarter (Q2), its revenue increased 93% year over year to $306 million. It's still not as big as Palantir's U.S. government segment ($426 million in Q2), but its growth was key to Palantir achieving its first-ever billion-dollar quarter.
PLTR Revenue (Quarterly) data by YCharts
Palantir secured some attractive contracts that should continue to keep its revenue and earnings growth momentum going. Just this year, it inked new deals with the Army, Department of Veterans Affairs, Department of Defense, and the Space Force.
What Nvidia has going for it
Nvidia is the leading graphics processing unit (GPU) supplier, which is why it became so pivotal to the AI ecosystem. Without Nvidia's GPUs, you could make a strong case that the generative AI boom would suffer. Other companies are beginning to design their own AI chips to compete with Nvidia, but as it stands, the company has a stronghold on that market.
GPUs aside, Nvidia supplies other critical pieces that help power data centers, such as networking equipment. It's gotten to the point where Nvidia's data center segment has become the main focus of its business, and other segments (like gaming) have taken a back seat.
In Q2, Nvidia's data center revenue was $41.1 billion. That was up 56% from Q2 2024 and accounted for 88% of its total revenue. Its total revenue also increased 56% year over year to $46.7 billion.
NVDA Revenue (Quarterly) data by YCharts
Nvidia said it expects AI infrastructure spending to reach between $3 trillion and $4 trillion by the end of this decade. Many companies will get a piece of this spending, but Nvidia is positioned to be a huge beneficiary of it.

NASDAQ: NVDA
Key Data Points
So, should you invest in Palantir or Nvidia?
If you're choosing between the two companies, it's hard (and not advised) to ignore just how differently valued they are. At the time of this writing, Nvidia's forward price-to-sales (P/S) ratio -- which tells you how much you're paying per dollar of projected earnings over the next 12 months -- is around 21.5. Palantir's is just under five times that, at around 101.5.
NVDA PS Ratio (Forward) data by YCharts
Palantir's high valuation leaves it less room for error and comes with more risks. In order to justify its valuation, it would need to experience extraordinary earnings growth for many years. It's not impossible, but it's highly unlikely. Anything short of meeting these high expectations would likely lead to investors jumping ship and the stock experiencing a sharp revaluation.
Nvidia also comes with risks -- such as a slowdown in AI spending and increased competition -- but its business is much more scaled and mature. If I had to choose between the two, I would go with Nvidia.