Technology affects just about every sector of the global economy. As the world becomes more computerized, it drives up demand for high-powered chips and software. 

The latest tech trend having an impact is the growing interest in artificial intelligence (AI). Organizations need the most powerful chips and software to power AI and distill intelligent insights from the ever-growing amount of data out there. As a result, top AI stocks are surging, with Nvidia (NVDA 6.18%) trading up 207% year to date, while C3.ai (AI 3.02%) has soared 152%.

Nvidia is the top supplier of data center chips and systems, while C3.ai provides mission-critical software to help companies design applications that take advantage of AI technology. But which of these AI leaders is the better investment for long-term investors? Let's find out.

Nvidia sees tremendous demand for its AI chips

Nvidia just wrapped up another impressive quarter of growth. Major cloud service providers are investing in Nvidia's H100 Tensor Core graphics processing units (GPUs) to expand their AI infrastructure. Management's efforts to increase chip supply suggest demand could remain high for the foreseeable future, which is consistent with long-term forecasts for AI spending by the International Data Corp. (IDC).

Worldwide spending on AI-centric systems, such as hardware, software, and services needed for AI, is projected to grow nearly 27% this year to reach $154 billion, according to IDC. It's expected to exceed $300 billion by 2026.

The opportunity for Nvidia is massive. As IDC said in its report, "Companies that are slow to adopt AI will be left behind." It's no surprise that Nvidia's revenue grew 101% year over year in the most recent quarter. Data center revenue specifically hit a new record of $10.3 billion and increased 171% versus the year-ago quarter. Companies are indeed terrified of being outmaneuvered by competitors, which is working to Nvidia's benefit. 

The quarter exceeded management's expectations, but executives' discussion on the recent earnings call about working with supply partners to meet demand suggests that growth could remain quite robust into 2024. CFO Colette Kress described the demand as "tremendous and broad-based across industries and customers." 

Nvidia's chips are driving many areas of the economy that consumers might take for granted, like product recommendations, customer service chatbots, and faster product development cycles. The company is also involved in other markets that could provide solid growth over the long term, including making chips for gaming, autonomous driving, and graphics development for metaverse applications.

Analysts expect Nvidia to report total revenue of $16 billion this year, which is in line with company guidance. For the full year, revenue is on pace to roughly double over last year, and analysts see the company growing the top line another 48% next year. 

C3.ai sees a big opportunity in generative AI

C3.ai helps corporations and government agencies develop and manage large-scale AI applications. It serves leading companies across energy, financial services, utilities, defense, and more.

However, by focusing almost exclusively on large organizations, the company might be limiting its growth compared to Nvidia. We can see this in the numbers. After posting a revenue increase of 38% in fiscal 2022 (which ends in April), revenue growth slowed to just 5.6% in fiscal 2023. The company recently reported flat sales for the first quarter of fiscal 2024. 

The one area of strength for C3.ai has been U.S. defense, where bookings jumped 39% year over year in the most recent quarter. Management said its relationship with the U.S. Department of Defense is "extensive and rapidly expanding." That suggests more growth is ahead, but the rest of the business is clearly not performing up to expectations.

One factor contributing to slowing growth is C3.ai's shift to a consumption-based model, where customers spend only on the resources they use. This means it is more exposed to the recent headwinds impacting cloud service providers as companies tighten their spending budgets on new services amid an uncertain economy.

Still, the growth from U.S. defense shows that C3.ai's technology is absolutely mission-critical. Many organizations will surely find the company's technology valuable, too, so C3.ai should see revenue accelerate again over the next few years. Businesses need to find ways to speed up data analysis, optimize resources, and make smarter forecasts, and that's basically what C3.ai's enterprise software provides.

Analysts currently anticipate revenue growing 15% this year before accelerating to about 20% in fiscal 2026. One big opportunity the company is seeing is in generative AI, which is behind popular text and image-based apps that are powered by AI like OpenAI's ChatGPT and DALL-E. During the recent earnings call, management noted that more companies and military leaders are interested in how they can use this technology to improve operational efficiency. C3.ai has closed 12 generative AI agreements so far, with a pipeline of over 140 more opportunities. 

Invest in the more profitable business

C3.ai can grow much faster than it is right now, but Nvidia is clearly the stronger of the two. What makes Nvidia a much better business is evident by looking at the profit it generates from sales of its products. Over the last year, Nvidia converted $0.31 of every dollar of revenue into a net profit. That's a high profit margin of 31%. Meanwhile, C3.ai produced a net loss of $261 million on $274 million of revenue. 

Both stocks have expensive valuations, but Nvidia's forward price-to-earnings ratio of 41 based on analysts' earnings estimates is fair. Buying growth stocks at a P/E less than the percentage growth in earnings (its PEG ratio) can sometimes signal an undervalued stock.

All told, Nvidia is the better buy. It is more dominant in the AI chip market than C3.ai is in the AI software market. This explains why Nvidia's business is growing faster, is more profitable, and is generating better returns for shareholders.