The artificial intelligence (AI) industry is enjoying explosive growth, making it a great area to invest in. Forecasts estimate the AI market will expand from $244 billion in 2025 to $1 trillion by 2031. Two standout stocks in the sector are Palantir Technologies (PLTR -0.18%) and Nvidia (NVDA 2.47%).
Palantir shares have rocketed more than 400% over the past 12 months through the week ending June 20. Nvidia is seeing its stock surging back from a 52-week low of $86.62 in April to near its January peak of $153.13.
Both companies offer reasons to invest in their stocks, but if you had to choose one, which would be the better AI investment for the long run? Here's a look at Palantir and Nvidia to arrive at an answer.

Image source: Getty Images.
The case for Palantir stock
Palantir is a compelling investment choice because of the massive success of its Artificial Intelligence Platform (AIP). Since AIP's launch in 2023, the company's business has been booming.
For instance, in the first quarter, revenue rose 39% year over year to $883.9 million. Ryan Taylor, Palantir's chief revenue and legal officer, stated, "Unrelenting demand for AIP continues to drive outperformance despite Q1 historically being our slowest quarter due to business seasonality."
Its strong start to 2025 contributed to the company raising its full-year sales guidance from $3.7 billion to $3.9 billion. This represents a substantial increase from 2024's $2.9 billion in revenue.
Not only is AIP successful, the company is expanding its revenue opportunities by offering new AI products. One is Warp Speed, which uses AI to boost U.S. manufacturing efficiencies, such as handling resource planning and anticipating supply chain changes.
About Warp Speed, CTO Shyam Sankar noted, "Both the adoption and the rate of product development has exceeded expectations."
Palantir's sales growth has translated into strong financials. Its Q1 net income reached $217.7 million, more than double 2024's $106.1 million. The company's free cash flow (FCF) of $370.4 million is an impressive 42% year-over-year increase.
Reasons to consider Nvidia stock
The rationale for Nvidia's attractiveness as an AI investment begins with its leadership in semiconductor chips for AI. Its market share in this area is estimated to exceed 70%.
Nvidia's popular AI chips helped sales grow 69% year over year to $44.1 billion in its fiscal Q1, ended April 27. The company isn't resting on its laurels.
Nvidia introduced its latest AI computing architecture, Blackwell, last year and has already announced Vera Rubin as Blackwell's successor. Vera Rubin is expected to arrive in 2026.
What makes Nvidia's new tech compelling for customers is that it's designed for the age of AI reasoning in which AI can more closely mimic human thinking. This ability is essential for agentic AI, which refers to AI systems capable of making decisions and completing tasks on their own.
Nvidia's popular hardware is only part of its strength. It also provides software called the Compute Unified Device Architecture (CUDA). CUDA is an essential tool to customize Nvidia's hardware when building AI systems, and this makes switching costs higher.
Like Palantir, Nvidia's financials are excellent. Fiscal Q1 net income rose 26% year over year to $18.8 billion, while FCF hit $26.1 billion, a 75% increase from the prior year's $14.9 billion.
However, Nvidia's global leadership in AI chips took a step back in China because of U.S. government restrictions on selling AI components to the country. News reports indicate Nvidia is revising its hardware specs to gain approval to commence sales into China once again.
Even without China, Nvidia is poised for years of growth as businesses and governments rush to build AI capabilities. Nvidia CEO Jensen Huang noted, "Countries around the world are recognizing AI as essential infrastructure -- just like electricity and the internet -- and Nvidia stands at the center of this profound transformation."
Deciding between Palantir and Nvidia
Because Palantir and Nvidia are both strong businesses, choosing between them is a challenge. Stock valuation is one factor that can aid in this decision.
Here's a look at each company's price-to-earnings (P/E) ratio, which tells you how much investors are willing to pay for a dollar's worth of a company's earnings based on the trailing 12 months.
Data by YCharts.
As the chart shows, Nvidia's P/E multiple is just a fraction of Palantir's, indicating Nvidia is the better value. In fact, Palantir's P/E ratio has climbed higher in recent months, suggesting the stock is overpriced.
This key factor makes Nvidia's stock the superior investment over Palantir. Beyond valuation, Nvidia's established leadership in AI and its ongoing push to evolve its AI tech positions the company for years of sustained success.