Tech stocks have skyrocketed since the start of last year. The Nasdaq-100 index rose 67% in 2023, massively improving on the 40% plunge it took the year before.

An economic downturn in 2022 triggered a marketwide sell-off that affected countless tech stocks. However, Wall Street has grown bullish about the industry again thanks to a boom in artificial intelligence (AI). The launch of OpenAI's ChatGPT reinvigorated interest in AI and has been a leading growth driver in the tech market's recovery.

Data from Grand View Research shows the AI market hit nearly $200 billion last year and is projected to expand at a compound annual growth rate of 37% through 2030. Alongside tailwinds from several other high-growth sectors like cloud computing, virtual reality, and more, now is an excellent time to invest in tech.

As two of the biggest names in the industry, Alphabet (GOOG 9.96%) (GOOGL 10.22%) and Microsoft (MSFT 1.82%) are attractive options. These companies have reputations for delivering consistent gains over the long term and are investing heavily in AI.

So let's compare these two tech giants and determine whether Alphabet or Microsoft is the better tech stock right now.

Alphabet

Alphabet has become a tech behemoth, attracting billions of users to products like Android, YouTube, Chrome, and the many products under Google.

The popularity of these offerings has seen Alphabet snap up a leading 25% market share in the digital advertising market. Advertising has become the company's biggest growth catalyst, making up almost 80% of its total revenue.

However, all eyes have been on the tech giant's expanding AI efforts over the last year. The company impressed toward the end of 2023 by debuting Gemini, its large language model that looked likely to make Alphabet competitive against cloud rivals Microsoft and Amazon.

Yet the Google company's stock is down nearly 10% in the last month after a disappointing launch for Gemini. Alphabet held a presentation for the new AI model recently when Gemini gave inaccurate depictions of historical figures and failed to recognize key differences between other prominent figures.

The blunders forced Alphabet to take its AI image services offline while it works out the kinks.

Despite recent headwinds, Alphabet hit nearly $70 billion in free cash flow last year. The company has a mountain to climb to get its AI tech on track and keep up with competitors, but it is financially secure and has the funds to keep investing in its business.

Microsoft

Like Alphabet, Microsoft is home to a range of highly potent brands, including Windows, Office, Xbox, Azure, and LinkedIn. The company has leading positions across tech, with these brands granting it roles in operating systems, productivity software, cloud computing, and even social media.

The company's shares are up 65% in the last 12 months, and it recently surpassed Apple as the world's most valuable company, with its market cap currently at just over $3 trillion.

Microsoft has won over investors by becoming one of the biggest players in AI. Heavy investment in ChatGPT developer OpenAI led to a lucrative partnership and access to some of the most advanced AI models in the industry.

The Windows company has used OpenAI's technology to introduce AI features across its product lineup. In 2023, Microsoft added new AI tools to its Azure cloud platform, integrated aspects of ChatGPT into its Bing search engine, and boosted productivity in its Office software suite by adding AI features.

Microsoft achieved more than $67 billion in free cash flow last year, highlighting the business's reliability and value as a long-term investment.

Is Alphabet or Microsoft the better tech stock?

Alphabet and Microsoft each hold dominating positions in tech and are likely to prove assets to any portfolio over the long term.

However, earnings per share estimates show Microsoft might have slightly more stock growth potential than Alphabet in the near term.

MSFT EPS Estimates for 2 Fiscal Years Ahead Chart

Data by YCharts

This table shows Microsoft's earnings could hit nearly $16 per share over the next two fiscal years, while Alphabet's may reach close to $9 per share. When multiplying those figures by the companies' forward price-to-earnings ratios (Microsoft's 35 and Alphabet's 20), you get a stock price of $546 for Microsoft and $182 for Alphabet.

Considering their current positions, these projections would see Microsoft's share price rise 32% and Alphabet's 30% by fiscal 2026.

The differences aren't substantial. However, Microsoft's higher growth potential and a more reliable position in AI make it the better tech stock over Alphabet right now.