The stocks for Nvidia (NVDA -0.36%) and Palantir Technologies (PLTR 0.44%) have delivered impressive gains over the past year as investors buy these stocks to take advantage of growing spending on artificial intelligence (AI) hardware and software.

While Nvidia stock has gained 193% in the past year, Palantir's gains stand at 72%. Both stocks have far outperformed the Nasdaq-100 Technology Sector index's gains of 37% during this period.

If you only have the funds available to buy one of these two AI stocks right now, which one would be a better bet?

The case for Nvidia

Nvidia is one of the best ways for investors to capitalize on the massive investments that tech companies are making in AI hardware. It has built a terrific position for itself in AI processors, a market that's growing at an incredible pace. Specifically, Nvidia recently estimated its market share at more than 90% in AI chips. So it's in the driver's seat of a market that DataHorizzon Research forecasts will grow at an annualized rate of more than 40% through 2032 to reach more than $1.1 trillion.

That dominant position in a fast-growing AI chip market means that it is clocking stunning growth. In its fiscal 2025 first quarter (ended April 28, 2024), Nvidia's revenue increased 262% year over year to $22.6 billion. The company's revenue guidance of $28 billion for fiscal Q2 points toward another quarter of its top line more than doubling on a year-over-year basis.

That upbeat guidance makes sense. Companies such as Meta Platforms, Microsoft, Alphabet, Amazon, Oracle, and Baidu have been lining up to buy Nvidia's AI graphics processing units (GPUs) to train and power their AI models. These tech giants are on track to significantly increase their capital spending in 2024 to shore up their AI infrastructure. Meta, for instance, plans a 38% increase in capital spending in 2024, while Alphabet and Microsoft say they plan to increase theirs by 91% and 66%, respectively.

There is a strong chance that much of this increased spending will be directed toward obtaining Nvidia's chips. Management pointed out on its May earnings conference call that the demand for Nvidia's flagship Hopper H200 GPU and the new Blackwell line of chips is "well ahead of supply, and we expect demand may exceed supply well into next year."

At the same time, there has been growing interest in Nvidia's chips from governments around the globe. The company expects its government-related revenue to come in at almost $10 billion this fiscal year, up from nothing in fiscal 2024. In that light, it is easy to see why analysts expect Nvidia's top line to nearly double in the current fiscal year to $120.5 billion, and estimate 33% growth in fiscal 2026 to $160 billion.

Meanwhile, its earnings are expected to more than double in the current fiscal year from fiscal 2024 levels of $1.30 per share, with further impressive growth anticipated over the next couple of years.

NVDA EPS Estimates for Current Fiscal Year Chart

NVDA EPS Estimates for Current Fiscal Year data by YCharts.

As such, Nvidia should remain a top AI stock pick.

The case for Palantir Technologies

The demand for AI software is also set to take off in the long run as the models that are trained using the chips manufactured by the likes of Nvidia are deployed in the real world. S&P Global Market Intelligence estimates that generative AI software sales could grow at an annualized rate of 58% over the next five years to $52 billion in 2028.

Palantir has already started making the most of this opportunity, and its commercial business is seeing a significant acceleration. The company's remaining performance obligations (RPO) were up 39% year over year in the first quarter to $1.3 billion. Palantir's RPO, which refers to the total value of future contracts that are yet to be fulfilled, primarily consists of its commercial contracts.

It is worth noting that its total commercial revenue grew 27% year over year in Q1 to $299 million. The faster RPO growth means that the company has significantly improved its commercial revenue pipeline, which should translate into faster growth as it fulfills these contracts.

More specifically, Palantir's commercial customer count increased by an impressive 53% year over year in the first quarter. Meanwhile, its government-related business is also getting an AI boost. The company has been regularly signing contracts with U.S. government agencies of late to deploy its AI software platform.

All this resulted in Palantir's remaining deal value (a metric that refers to the "total remaining value of contracts as of the end of the reporting period") jumping by 22% last quarter to a solid $4.1 billion. Given that Palantir generated $2.33 billion in revenue in its past four reported quarters, this metric indicates that its growth rate should accelerate in the coming years.

Management expects revenue this year to grow by 21% to approximately $2.68 billion. However, it raised that forecast when it released its Q1 report in May, and its fast-improving revenue pipeline thanks to a smart go-to-market strategy may lead to further guidance boosts as the year progresses.

The verdict

Nvidia is growing at a much faster pace than Palantir, which explains why it commands a loftier sales multiple of 39 as compared to Palantir's reading of 24. However, Nvidia is the more attractive bet of the two based on the forward-looking sales and earnings multiples.

NVDA PS Ratio (Forward 1y) Chart

NVDA PS Ratio (Forward 1y) data by YCharts.

Palantir's forward sales multiple is slightly lower than Nvidia's. However, Nvidia sports a much higher current sales multiple, and the fact that the forward sales multiples of both companies are very close suggests that Nvidia's sales are expected to grow at a faster pace than Palantir's. Moreover, the latest quarterly earnings reports of both companies tell us that there is indeed a big gap regarding their earnings growth rates.

So Nvidia looks like the better AI stock of the two to buy now based on the impressive growth it has been delivering and which it may sustain. However, it would be wise to keep an eye on Palantir as well since it is improving commercial business and the adoption of AI by governments could lead to strong long-term growth.