A mere handful of companies can say they've remained at the top of their industries for decades, and Microsoft (MSFT 0.73%) is one of them. It has dominated the technology sector since launching the Windows operating system in 1985, and it owes its continued success to a relentless focus on innovation. 

Windows used to be the company's defining product, and although it's still used by billions of people today, Microsoft has evolved. It has built a robust hardware business, a market-leading cloud computing platform, and now it's dominating a new frontier: artificial intelligence (AI).

AI is Microsoft's most valuable opportunity so far, and it has already established itself as a leader in the field. Here's how the company is applying the technology and why its stock is a screaming buy right now.

A digital rendering of a circuit board with a chip in the center, with AI inscribed on it.

Image source: Getty Images.

Microsoft has rapidly transformed into an artificial intelligence company

It's safe to say the hype surrounding AI has exploded this year, but the boom in this new industry appears to be very real. A private company called OpenAI lit the fuse in November 2022 when it released the newest version of its ChatGPT online chatbot, which is capable of answering complex questions and even writing computer code.

Microsoft was an early investor in OpenAI, injecting $1 billion into the start-up in 2019. Amid its more recent success, the tech giant agreed to a new multiyear deal worth a rumored $10 billion. The partnership is completely transforming Microsoft's product portfolio already.

Microsoft has integrated ChatGPT with its Bing search engine in an attempt to snatch market share from Alphabet's Google. In just two months since launching, installs of Bing's mobile application soared fourfold, and the search engine has amassed 100 million daily active users. 

Revenue in Microsoft's search segment rose just 10% in the fiscal 2023 third quarter (ended March 31), suggesting it will take some time for advertisers to come aboard. However, management did say Bing successfully added to its U.S. market share in Q3. 

Also in the quarter, the Microsoft Teams collaboration platform reached a record-high 300 million active users. The company continues to see uptake of the Teams Premium version, which uses ChatGPT-powered AI to automatically generate meeting notes, with additional features soon to roll out. 

The cloud shines again with the help of OpenAI

The most valuable Microsoft-OpenAI integration (for now) might be with the Azure cloud platform. It places OpenAI's most advanced GPT-4 language model at the fingertips of Azure's business customers, helping them develop applications using the most advanced technology in the world. 

GPT-4 was released in March, and it's a massive step above its GPT-3 predecessor. In an early demonstration, the GPT-4 model was fed a sketched image, and it was asked to write the computer code required to create a website that looked exactly like the sketch. It obliged and succeeded.

Azure was the growth leader for Microsoft yet again in Q3, with revenue increasing 27% year over year, though it marked a slowdown compared to Q3 last year, where revenue grew by 46%. However, the AI piece of the cloud platform did blistering numbers this time around -- Azure reported having 2,500 OpenAI customers, up a whopping 1,000% compared to just one quarter ago. 

It's important for Microsoft's cloud business to do well because its consumer segments are struggling amid the tough economic climate. The company saw a 30% year-over-year drop in its Xbox hardware revenue and a 30% decline in its devices revenue, which includes its Surface line of notebook computers and tablets. Additionally, Windows revenue fell 28% on the back of weak demand for personal computers.

Microsoft stock soared on its quarterly results, and it's still a buy

Microsoft stock soared 7.5% the day after it reported Q3 earnings. While that doesn't sound overly impressive, it's now a $2.2 trillion company, and that increase added more than $150 billion to its valuation. 

The company beat the high end of its revenue forecast for all three of its business segments, and its $2.45 in earnings per share (profit) comfortably topped analysts' expectations of $2.24. 

Microsoft has now generated $9.22 in earnings per share over the last four quarters, and based on its recent share price of $296, its stock trades at a price-to-earnings (P/E) ratio of 32.1. That's 20% more expensive than the Nasdaq-100 index, which trades at a P/E ratio of 26.7, but AI presents so much financial potential that it warrants paying a premium for Microsoft stock. 

According to Ark Investment Management, which is run by top tech investor Cathie Wood, AI companies could be sharing a revenue pool worth $14 trillion by 2030, creating $90 trillion in enterprise value. Microsoft has already established itself as a leader in the industry, so if those financial estimates come to life, it could capture a substantial share of that value.

Many pure-play AI companies right now are still at a very early stage, but Microsoft presents investors with an opportunity to gain exposure to this transformative technology through a safe, blue chip name. That's why its stock is a buy right now.