Artificial intelligence could push the economy to new productivity levels over the coming years, but most businesses won't be doing it on their own. Instead, they'll enlist help from companies like C3.ai (AI 3.02%) and Palantir Technologies (PLTR 3.73%), which develop AI software solutions for organizations.

Both stocks have been big winners this year; C3.ai has soared a staggering 234% since January, while Palantir has followed closely behind with 141% in gains. But which is the better buy today and moving forward?

Here, I've peeled back the layers of each company to examine which has the advantage in growth, financials, and valuation. The numbers seem to point toward a decisive winner. 

Read on to find out more.

Introducing our competitors

C3.ai helps companies develop and deploy AI software applications. It offers a development platform to design and roll out applications and turnkey programs customers can integrate into their operations. Its software applies to many industries, from energy to supply chain and defense. The company's done $266 million in revenue over the past four quarters.

Palantir Technologies helps government organizations and enterprises build and deploy custom software applications through its platforms Gotham (private sector), Foundry (government), and AIP (artificial intelligence). The company's roots begin with the U.S. government, where it works with many agencies. It's also expanding its commercial business. Palantir generated $2 billion in revenue over the past four quarters.

Round one: Growth

Both companies have seen revenue growth slow over the past 18 months but for potentially different reasons. C3.ai has changed its billing method to a usage-based model and expects growth to accelerate as the company implements new customer programs. The company ended its fiscal year 2023 at the end of May and reported 126 agreements throughout the year, a 52% increase over fiscal year 2022.

Meanwhile, Palantir generates more than half its revenue from government customers (primarily the U.S.) which can ebb and flow with politics and government spending trends. However, defense spending has historically moved higher over time. Investors should see if Palantir's growth bounces back with the recent debt ceiling drama resolved. Palantir grew its number of U.S. enterprise customers by more than 50% year over year in its most recent quarter, a good sign for potential future growth.

AI Revenue (Quarterly YOY Growth) Chart.

AI Revenue (Quarterly YOY Growth) data by YCharts.

Verdict: Palantir gets the nod here until C3.ai puts up numbers showing its billing change is supporting growth.

Round two: Financials

The two companies are in different financial classes at the moment. C3.ai is growing a much smaller revenue number. That trickles down to its cash flow, which is still negative. On the other hand, Palantir turned cash-flow positive in 2021 and has begun posting positive generally accepted accounting principles (GAAP) profits too.

Both companies are well-funded and carry zero long-term debt on their books.

AI Free Cash Flow Chart.

AI Free Cash Flow data by YCharts.

Verdict: This is an easy win for Palantir, which is well funded and still generating hundreds of millions of dollars in free cash flow.

Round three: Valuation

Since C3.ai isn't yet profitable, one can start by comparing their valuations based on revenue via the price-to-sales (P/S) ratio. Right now, both stocks trade at roughly the same valuation -- but should they?

Palantir is not only profitable but is reaching the point where expenses are leveling out (often called operating leverage), which will supercharge earnings growth as the company keeps expanding. Analysts believe the company's earnings will grow by an average of 60% annually moving forward.

C3.ai's management team is targeting positive operating margins over the next year, but that's still a potential ways off from bottom-line profits. Analysts currently believe the company will turn its profit by April 2025.

AI P/S Ratio Chart.

AI P/S Ratio data by YCharts.

Verdict: Palantir's more attractive at its price because of the expected earnings growth over the coming years.

And the winner is...

Palantir took all three categories, which makes the stock the seemingly obvious better buy for investors. Now, what was the point of this exercise? It shows that investors can't base their decisions on price action alone. C3.ai stock has performed significantly better than Palantir's over the past six months, but it could be Palantir that is the better investment five years from now.

Investors should always consider a company's fundamentals as their North Star in building their portfolio. In this case, Palantir is the stock you want to buy for today and the future.