Earnings season is in full swing, with countless stocks on the move. As is often the case, there's been a lot of fluctuation in the tech market. Easing inflation and advances in artificial intelligence (AI) have made investors bullish on the companies profiting most from these developments. In fact, the Nasdaq-100 Technology Sector has risen 50% in the last 12 months.

Alphabet (GOOG 1.06%) (GOOGL 1.08%) and Microsoft (MSFT -0.18%) have delivered some of the biggest gains, with their shares up 55% and 32% over the last 12 months. These companies host some of the most widely used online services, and likely have bright futures in the budding AI market over the next decade.

Alphabet and Microsoft will likely prove to be assets to any portfolio over the long term, and are worth considering right now before it's too late. So let's look closer at Alphabet and Microsoft's businesses and determine which is the better stock to invest in tech.

Alphabet

Alphabet released its earnings for the first quarter of 2024 on April 25, posting revenue growth of 15% year over year to $81 billion. The company beat sales forecasts by $2 billion. Meanwhile, earnings per share estimates hit $1.89, outperforming Wall Street projections by $0.38.

Glowing quarterly results saw Alphabet's share price spike 14% in extended trading on April 25. The quarter illustrated the potency of Alphabet's business, with solid growth in its advertising business and signs that its investment in AI is beginning to pay off.

During the quarter, Google advertising sales jumped 14% year over year, while its AI-focused Google Cloud segment posted growth of 28%.

User-rich platforms like YouTube, Android, Chrome, and the many services under Google have seen Alphabet become an advertising powerhouse, and now it looks like these services could help the company take on a crucial role in AI.

The AI market is projected to hit a valuation nearing $2 trillion in 2023, up from just under $200 billion last year. Meanwhile, Alpahbet's leading role in tech and $69 billion in free cash flow suggests it has the financial resources and brand power to flourish in the sector in the coming years.

Microsoft

Microsoft also posted earnings on April 25, revealing results for its Q2 2024 (ending March 2024). Like Alphabet, Microsoft delivered glowing results. During the quarter, revenue increased by 18% year over year to $62 billion, outperforming expectations by $1 billion.

The Windows company enjoyed gains in multiple segments, with its productivity and business processes division posting a 12% year-over-year rise in sales and Intelligent Cloud revenue popping 21%. Additionally, personal computing sales increased by 17% year over year, reflecting continued improvements in the PC market and signs that its acquisition of game developer Activision Blizzard last year is paying off.

As the home of brands like Windows, Office, Azure, Xbox, and LinkedIn, Microsoft's reach in tech is vast. The company holds leading positions in multiple markets, making its stock one of the best ways to invest in the industry.

In fact, Microsoft holds the second-largest market share in the cloud market (after only Amazon Web Services) and is gradually edging closer to the top spot. Microsoft's partnership with ChatGPT developer OpenAI and expanding role in cloud computing have made it one of the biggest threats in AI, supported by impressive growth in its cloud segment in Q2 2024.

Is Alphabet or Microsoft the better tech stock?

The choice between investing in Alphabet or Microsoft is not easy. Their stocks have delivered stellar growth over the last five years, with Alphabet's rising 164% and Microsoft's 209%. Meanwhile, both companies are coming out of impressive quarters, outperforming forecasts on multiple fronts. Even their free cash flows are in similar positions, with Alphabet's at $69 billion and Microsoft's at $70 billion.

Consequently, it's worth comparing the value of their stocks to determine which is the better buy right now.

MSFT PE Ratio (Forward) Chart

Data by YCharts

This chart compares Alphabet and Microsoft using three key valuation metrics, and the Google company appears to win on all three fronts. For each of these metrics, the lower the figure, the better the value. As a result, Alphabet's lower forward price-to-earnings (P/E) ratio, price-to-free cash flow, and price-to-sales ratio indicate that Alphabet shares are the better bargain.

Alongside its lucrative digital advertising business and expanding position in AI, Alphabet is a tech stock worth buying over Microsoft this month. However, it's still worth keeping Microsoft on your radar to strike when the time is right.