Data from Grand View Research shows the artificial intelligence (AI) market is worth $137 billion, and is projected to expand at a compound annual growth rate of 37% through 2030. The technology has massive potential in numerous industries, from manufacturing to healthcare, consumer products, education, and more. As a result, tech companies are rushing to claim their spots in the sector, and developing products to meet the rising demand for AI services.

While chipmaker Nvidia has been at the forefront of AI excitement this year, investing in the software companies creating these products could be the best way to profit from the booming industry over the long term. Companies like Microsoft (MSFT -1.00%) and Alphabet (GOOG -3.33%) (GOOGL -3.37%) are gradually adding AI upgrades across their software lineup. With brands like Google, Android, Windows, and Office between the two companies, these tech giants will likely play a crucial role in getting AI into the hands of millions of consumers.

So let's assess whether Microsoft or Alphabet is the better AI stock.

Microsoft

Microsoft has emerged as one of the biggest names in AI this year after being an early investor in the industry. The company invested $1 billion in ChatGPT developer OpenAI in 2019, and increased that figure by another $10 billion this year. It now boasts a 49% stake in the start-up, which grants it control of some of the most powerful AI technology in the industry.

The Windows company has exclusive licenses on some of OpenAI's AI models, which it has integrated into popular services such as Word, Excel, Azure, and Bing. Microsoft aims to reinvent productivity with the technology, with plans to soon introduce a range of new AI tools on its subscription-based platform Microsoft 365. The productivity service reported operating income growth of 12% in fiscal 2023, and could deliver another boost to profits by attracting more users with AI.

In addition to productivity software, Microsoft is making headway in the business sector with its cloud service Azure. The platform holds the second-largest cloud market share after Amazon Web Services, and is the best way for companies to access ChatGPT. Microsoft has carved out a solid position in AI, and has shown no signs of slowing its growth in the sector.

Alphabet

Like Microsoft, Alphabet has amassed a massive user base between YouTube, its various Google products, and its Android operating system. In fact, the company revealed in May that its 15 Google platforms serve at least over half a billion people, with six catering to more than 2 billion users each.

Meanwhile, Alphabet has ramped up development on AI services this year. The technology has been a major focus for the company since 2016. However, increased interest from consumers and businesses this year has the company quickening its pace. In March, Alphabet launched its own version of ChatGPT, which it calls Bard. The chatbot didn't have the most successful launch, with developers later saying it was prematurely launched.

However, Alphabet is playing the long game in AI and betting that the potency of its services and significant user base will grant it a strong position in the industry. One of its biggest focuses this year is to improve Google Search with AI, which should help it retain its 80% market share after Microsoft integrated aspects of ChatGPT into Bing.

Additionally, Alphabet recently unveiled "Duet for Workspace," which will bring AI upgrades to Google Docs, Gmail, Sheets, and more. 

Which is the better AI stock?

If you're looking to add an AI stock to your portfolio this month and are stuck between these two companies, Microsoft is the better buy. Its partnership with OpenAI gives it a better standing in the industry, with its larger market share in cloud computing only boosting its long-term prospects. Meanwhile, Microsoft 365's Office suite has already attracted millions of subscribers, and could significantly increase earnings with AI.

GOOG PE Ratio Chart

Data by YCharts

Moreover, the chart above shows Alphabet's price-to-earnings ratio (P/E) is only slightly better than Microsoft's. Alphabet's lower P/E indicates it's a better value, but Microsoft will likely offer bigger gains over the long term with its firmer position in AI.

Microsoft and Alphabet are tech behemoths that have delivered significant stock growth over the last five and ten years. However, Microsoft's dominance in productivity services and access to OpenAI's technology makes it too good to pass up.