Key Points
Microsoft and Oracle both hold key contracts with OpenAI and other generative AI developers.
Cash flow could be a key factor in the race to build out capacity.
One has a much more attractive valuation than the other, presenting less risk for investors.
The advancements made in artificial intelligence (AI) over the last few years have required exponentially growing amounts of computing power. That's been a huge boon for GPU makers like Nvidia, but Nvidia's biggest customers have also benefited by renting out those GPUs to companies training large language models and developing new AI applications.
Microsoft (NASDAQ: MSFT) and Oracle (NYSE: ORCL) are two of the biggest cloud computing companies benefiting from growing demand for compute. Both are seeing tens of billions of dollars in revenue growth thanks to spending from developers like OpenAI, which has contracts with both cloud providers.
Where to invest $1,000 right now? Our analyst team just revealed what they believe are the 10 best stocks to buy right now, when you join Stock Advisor. See the stocks »
But one company's stock stands out as a better buy right now.
Image source: Getty Images.
The big contract that put Oracle on the map
Oracle made headlines last month when it forecast a huge jump in demand for its cloud computing service, Oracle Cloud Infrastructure (OCI). It expects the business's total revenue to climb 14-fold from last year through the end of the decade. That's supported by a huge backlog of $455 billion.
That backlog got a boost from OpenAI, which committed to spending $300 billion over five years starting in 2027. That may be surprising for some investors who know Microsoft has a close relationship with OpenAI, after making an initial investment of $1 billion in OpenAI in 2019, adding $2 billion a bit later, and $10 billion in 2023.
But OpenAI and Microsoft changed their relationship at the start of the year. Microsoft is no longer OpenAI's exclusive cloud provider. Instead, OpenAI gives Microsoft the right of first refusal. If Microsoft cannot or will not be able to meet OpenAI's needs, the LLM developer is free to shop around.
That means OpenAI came to Microsoft before it went to Oracle with its $300 billion contract, and Microsoft didn't want to take on the business. That may be because Microsoft already has a huge backlog of customers and management has reiterated on multiple earnings calls that growth in demand is outpacing its growth in supply despite heavy capital spending on Azure capacity. It may also be because the terms OpenAI wanted weren't attractive, and Microsoft could demand higher margins from other customers.
In other words, Microsoft is operating from a place of strength, while Oracle is doing whatever it can to catch up to Microsoft and the other hyperscalers. That's even more evident in how the two companies are building their cloud computing businesses.
Image source: Getty Images.
The race to build enough capacity to meet insatiable demand
Microsoft is spending more than just about everyone to build new capacity for Azure. Management expected last quarter's capital expenditures to come in around $30 billion, which is up from $24.2 billion in the prior quarter.
Despite the massive cash outlays for data center capacity, Microsoft's free cash flow continues to climb. It brought in $25.6 billion during its fiscal fourth quarter, and $71.6 billion for the full year. That's up from $59.5 billion two years ago and $45.2 billion five years ago.
That cash flow's supported by its massive enterprise software business and other ancillary businesses, which brought in around $200 billion in revenue in fiscal 2025. That cash cow supports the massive spending required to build out Azure's data centers.
By comparison, Oracle is spending heavily on its data centers, with plans to increase spending 18% this year to $35 billion in capital expenditures. Unlike Microsoft, however, Oracle must take on debt to build that much. Its cash flow turned negative over the trailing four quarters, with the company burning $5.9 billion.
Building out capacity to meet demand, most of which comes from OpenAI, is a big risk for Oracle. Not only is it leveraging its business with debt, but it's also heavily reliant on OpenAI to make the investment pay off. If OpenAI is unable to meet its commitment, Oracle could find itself with excess capacity, especially considering the LLM developer is something of a bellwether for the industry.
That only adds to the stability of Microsoft as an investment over Oracle.
The better buy is clear
What makes the case for Microsoft even clearer is its relative valuation.
Shares of Microsoft currently trade for about 33 times forward earnings estimates. That's certainly a premium to the overall market, but considering the strength of its business and the growth it's experiencing from both Azure and its enterprise software business, it's worth the price.
By comparison, Oracle stock now trades for 43 times forward earnings after the stock price jumped following its first-quarter earnings report last month. That means investors are paying a higher price for a riskier stock, making the investment even riskier.
Investors looking for a solid AI stock to build a portfolio around should choose Microsoft.
Should you invest $1,000 in Microsoft right now?
Before you buy stock in Microsoft, consider this:
The Motley Fool Stock Advisor analyst team just identified what they believe are the 10 best stocks for investors to buy now… and Microsoft wasn’t one of them. The 10 stocks that made the cut could produce monster returns in the coming years.
Consider when Netflix made this list on December 17, 2004... if you invested $1,000 at the time of our recommendation, you’d have $657,979!* Or when Nvidia made this list on April 15, 2005... if you invested $1,000 at the time of our recommendation, you’d have $1,122,746!*
Now, it’s worth noting Stock Advisor’s total average return is 1,060% — a market-crushing outperformance compared to 187% for the S&P 500. Don’t miss out on the latest top 10 list, available when you join Stock Advisor.
See the 10 stocks »
*Stock Advisor returns as of October 13, 2025
Adam Levy has positions in Microsoft. The Motley Fool has positions in and recommends Microsoft, Nvidia, and Oracle. The Motley Fool recommends the following options: long January 2026 $395 calls on Microsoft and short January 2026 $405 calls on Microsoft. The Motley Fool has a disclosure policy.