Nvidia (NVDA -0.42%) has skyrocketed in value over the last three years to become the world's first $4 trillion company. The 10x-plus increase in value from three years ago was fueled by the massive spending on artificial intelligence (AI) infrastructure, of which Nvidia's graphics processing units (GPUs) are a key component.

Nvidia's dominance of the AI chip market faces some challenges, though. Competing GPU makers are catching up in price performance, and Nvidia's biggest hyperscale customers are leaning more on their custom silicon designs for generative artificial intelligence (AI) applications. That could weigh on its continued growth.

Meanwhile, another AI giant could quickly follow Nvidia into the $4 trillion club and climb to $4.5 trillion within a year, according to analysts at Oppenheimer. And right now, the stock looks even more attractive than Nvidia.

Two people walking through a data center pointing at server racks.

Image source: Getty Images.

Can Nvidia remain the most valuable company in the world?

Nvidia has established itself as the clear leader in developing chips for AI training. Its competitive position is bolstered not just by maintaining more advanced technological capabilities than its next-closest competitor, though. It also leans on its proprietary software, CUDA, making it unlikely another chipmaker can supplant its position.

That said, some of Nvidia's biggest customers, like Meta Platforms (META 0.37%) and Microsoft (MSFT -0.33%), are wary of becoming overly reliant on Nvidia for their AI training hardware needs. Meta, for example, is taking its Meta Training and Inference Accelerator platform and applying it to more and more generative AI applications. The next version of its chip is designed to replace Nvidia chips in AI training for its Llama foundation model. It's already using its own chips in some AI inference cases.

Microsoft has similar aspirations for its Maia chips, but recently pushed back the timeline for its next-generation AI training chip to 2026 instead of this year. These types of setbacks have hit other hyperscalers in the past, including Meta, resulting in them putting in massive orders with Nvidia. However, as the big tech companies improve their design processes, they could displace a large portion of their demand for Nvidia's chips over time.

For now, Nvidia's position looks well protected. That's especially true after news that the U.S. will reverse its ban on the sale of the throttled-down H20 chips in China. Nvidia wrote down $4.5 billion in inventory last quarter after the policy went in place. As a result, the company should produce strong earnings growth through the rest of the year, fueled by China and the hyperscalers.

Still, the stock trades for a premium, approaching 40 times forward earnings estimates. At its current price and long-term hurdles, it might not be able to keep climbing as fast as some of the other big AI companies.

The one company that could soon take Nvidia's crown

Few companies even come close to the size of Nvidia at this point. There are just 10 companies with a market cap exceeding $1 trillion as of this writing, and just three of them are worth $3 trillion or more, including Nvidia itself.

But Microsoft is the next-closest to Nvidia at about $3.8 trillion as of this writing, and it could join the $4 trillion in the near future, according to analysts at Oppenheimer. They put a $600 price target on the stock, implying a market cap of about $4.5 trillion and 19% upside from its price as of July 15.

There are a couple of reasons Oppenheimer's analysts are bullish. First, they see acceleration in Microsoft's Azure cloud computing revenue. Azure has become the growth engine at Microsoft, fueled by demand for compute power needed for AI development. Microsoft's stake in OpenAI not only gives it a huge customer for Azure, but it also brings key tools for other AI developers.

That's fueled significant growth in demand. And despite spending $80 billion on capital expenditures, mostly going toward building and outfitting new data centers, Microsoft's management says demand continues to outstrip supply. Even so, Azure is growing faster than any of the three big public cloud platforms.

The other reason the analysts are bullish on Microsoft is the potential of its Copilot Studio. While they note demand for Microsoft's native AI assistant Copilot for Microsoft 365 is relatively tepid, the demand for its custom AI assistant platform Copilot Studio could produce much better results. That enables Microsoft to increase prices for its enterprise software suite while increasing retention rates. That should produce even more cash for the company to plow back into Azure and its massive capital return program, fueling earnings-per-share growth through higher earnings spread across fewer shares.

Shares of Microsoft have grown relatively expensive in their own right, with the stock trading for about 33 times forward earnings. But that's a reasonable multiple to pay for the stock of a company that's leading the AI industry on two fronts with its cloud computing and enterprise software businesses.

It's worth noting that Oppenheimer analysts updated their price target for Nvidia following the news that Nvidia expects the U.S. to reverse its ban on exporting chips to China. They now expect it to reach $200 per share, implying a market cap of $4.9 trillion. But for my money, I think Microsoft is the more attractive investment at the current price.