After the launch of ChatGPT, Microsoft (MSFT -1.00%) and Alphabet (GOOG -3.33%) (GOOGL -3.37%) emerged as top rivals, and that battle has persisted. Microsoft has aligned itself with ChatGPT parent OpenAI, while Alphabet has sought to challenge its leadership with products like Bard and later Gemini. So which artificial intelligence (AI) stock is the better buy? 

An AI chip on a circuit board.

Image source: Getty Images.

Microsoft has outfoxed the competition

Jeremy Bowman (Microsoft): The question of whether to build or buy is a common one in technology, and in generative AI, Microsoft and Alphabet have largely gone in different directions in this regard.

Microsoft has tied its fortunes to OpenAI, the ChatGPT parent, through a reported $13 billion investment, and that has enabled Microsoft to essentially use OpenAI's technology as its own. As a result, the tech giant has been able to implement OpenAI's technology in products like its Azure cloud infrastructure services, GitHub code repository, Office productivity suite, and Bing search engine.

Those moves are already having an impact as Microsoft said that AI added 6 percentage points to Azure's growth in the most recent quarter.

Microsoft's diversification also acts as a competitive advantage here. Unlike Alphabet, which makes a majority of its revenue from search advertising, Microsoft has a wide array of products that span enterprise software, video games, cloud computing, social media, and more, and that gives it more opportunities to leverage the power of AI.

Microsoft has also been more aggressive in AI than Alphabet has. CEO Satya Nadella has apparently been planning for this moment for years, as Microsoft first invested in back in 2019.

Alphabet has also been investing in AI for several years, but the company has been more hesitant to release new products, and when it has it hasn't always gone well. The initial presentation for Bard was sloppy and widely panned, and Gemini has been criticized for historical inaccuracies.

Microsoft shows no intention of slowing down in AI; it just hired Deepmind co-founder Mustafa Suleyman, who also co-founded the recently shuttered Inflection AI. Microsoft stock may be expensive, but it deserves to trade at a premium. It will be hard to catch the AI leader.

Alphabet's moonshot approach to reshaping tech

Anders Bylund (Alphabet): I have nothing but respect for Microsoft, but Redmond's finest can't measure up to Alphabet's ultimate long-term planning.

Alphabet's visionary approach and unwavering commitment to pushing the boundaries of innovation make it a compelling choice for investors seeking long-term growth. The company's core business -- online search and advertising under the Google banner -- dominates the search engine market. However, Alphabet's ambitions extend far beyond search, with the company consistently investing in cutting-edge technologies that have the potential to reshape entire industries.

One such area is artificial intelligence, where Alphabet's research and development efforts have produced groundbreaking advancements. From natural language processing to computer vision, Alphabet's AI technologies are being applied in diverse fields, from healthcare research to self-driving vehicles.

Moreover, Alphabet's commitment to moonshot projects through its X division showcases its willingness to take calculated risks in pursuit of revolutionary innovations. Projects like Intrinsic, Alphabet's industrial robotics project, and Loon, which aims to provide internet access to remote areas via high-altitude balloons, exemplify the company's audacious vision and long-term thinking.

Long story short, Alphabet is ready to roll with the punches as the tech market evolves. Furthermore, the stock is much more affordable than Microsoft, whose stock has soared on the wings of its deep OpenAI partnership. You can pick up Alphabet shares at the reasonable price of 6 times sales or 27 times free cash flow today. Double those numbers to get an estimate of Microsoft's ratios.

In my view, Microsoft's stock looks overdue for a correction while Alphabet is getting ready to run higher. That's an easy choice.