C3.ai (AI 0.14%) and Palantir (PLTR 4.49%) often top the list of artificial intelligence (AI) investments. Each is heavily focused on providing its clients with top-notch AI tools, which has caused these two's popularity to explode as AI becomes more integrated with common business practices.

But which one of these is the better buy now?

Government clients are vital for both companies

While each has a comprehensive AI product suite, their products differ slightly. C3.ai takes a plug-and-play approach and has products that span multiple industries, including supply chain management for manufacturing, predicting opioid dependence in healthcare, and reliability prediction for utility companies.

However, most of its recent success has come from the military world, where C3.ai has won multiple contracts from the Department of Defense to assess combat readiness.

Palantir's products at first catered to the needs of government clients. Its big data platform would take inputs from several sources and churn out actionable insights. However, it has expanded the usage of those products to the civilian industry, which opens up more opportunities.

With advances in the generative AI space, it launched the Palantir AIP (artificial intelligence platform), which allows users to interact with an AI agent that recommends what should be done in a given situation. According to management, demand for Palantir AIP has been "unprecedented," which should help grow the business. 

Both companies have great products, but which makes for the better investment?

Palantir is far more profitable than C3.ai

Without any background information, you might guess that both of these companies are growing briskly because of AI interest. But you'd be wrong.

In their most recent quarters (Palantir's Q2, which ended on June 30, and C3.ai's fiscal 2024 Q1, which ended July 31), Palantir and C3.ai's revenue grew at a 13% and 11% year-over-year pace, respectively. But looking ahead to next quarter reveals growth acceleration, as Palantir expects 16% growth and C3.ai predicts 19%.

One thing to note about their revenue is the size difference between these two: Palantir's revenue last quarter was $533 million, while C3.ai's was $72 million. Palantir is a much more mature company, yet it is growing at around the same pace as C3.ai. This is a notch in Palantir's favor, as C3.ai is highly dependent on just a few customers (three customers accounted for 57% of revenue in its fiscal 2023).

Palantir's maturity starts to shine when investors look at profit margins. Palantir has slowly worked its way to profitability, posting a 5% profit margin in Q2 despite a 48% loss margin last year. C3.ai hasn't crossed the profitability threshold yet, as its profit loss margin was an abysmal 89%, although this is up from a 110% loss margin last year.

As previously mentioned, C3.ai isn't as mature, so these losses shouldn't be surprising as the company attempts to capture market share. However, it's much harder for unprofitable companies to survive in high interest rate environments, so C3.ai is fighting an uphill battle while Palantir is steadily cruising.

Finally, regarding valuations, both stocks aren't very cheap.

PLTR PS Ratio Chart

PLTR PS Ratio data by YCharts.

While each has seen its valuation slightly decline over the past few months, C3.ai has been hit harder than Palantir, and now sits around 10 times sales versus Palantir's 17.

This pricing difference makes this analysis incredibly difficult, as Palantir's financials are better, but C3.ai's valuation is more attractive. I'm not interested in either stock at these levels, as Palantir needs to grow much faster to justify its valuation of 17 times sales.

Still, AI demand is still growing, and Palantir may report a blowout quarter that makes its premium price tag worth it. But, if you had to make me choose one, I'd pick Palantir.

Although you won't find Warren Buffett buying either of these stocks, his advice still rings true: "It's far better to buy a wonderful company at a fair price than a fair company at a wonderful price." Because of that, I think Palantir is the better buy right now.