There are no guarantees in the stock market, but investing in industry leaders with a track record of above-average growth is a relatively safe way to grow your savings over time.

Google parent Alphabet (GOOGL 0.97%) (GOOG 0.89%) and Microsoft (MSFT -0.49%) are solid companies that generate billions in profits every year. An investor can buy one share of either stock for less than $500. Here's why these two stocks are compelling buys right now.

1. Alphabet (Google)

Shares of Alphabet have continued to hit new highs in 2024. Google Search and YouTube are seeing improving revenue growth as the digital advertising market recovers, which is how the company makes most of its money. But the company is also developing new revenue streams beyond advertising that points to a bright future.

An improving digital advertising market is a key catalyst for the stock price in the near term. Ad spending slowed in 2022 amid macroeconomic headwinds, but revenue grew 15% year over year in the first quarter, largely driven by growth in Google Search. Google ultimately attracts the lion's share of online ad spending due to having more than 2 billion users across six products.

Google's investments in artificial intelligence (AI) will allow users and advertisers to do more with less, and that should ultimately strengthen the Google brand and benefit shareholders.

Alphabet is also developing other sources of revenue beyond advertising. The Google One subscription service now has more than 100 million subscribers, while YouTube has more than 100 million music subscribers and over 8 million TV subscribers. Revenue from subscriptions, platforms, and devices, grew 18% year over year in the first quarter.

Growth in subscription revenue will only enhance the company's already stellar profitability. Alphabet converted all these revenue streams, including its burgeoning cloud services business, to $73 billion of profit on $307 billion of revenue over the last year. Assuming the stock is still trading at the same price-to-earnings (P/E) ratio in five years, the stock could be worth $346, or more than double the current share price, based on analysts' forward earnings estimates.

2. Microsoft

Microsoft is a top brand that is widely familiar to individuals and businesses all over the world. It is well positioned to deliver returns from the booming demand for AI, which promises to significantly improve what the company does best: build productivity software and other services to help people work more efficiently.

The stock reached a high of $430 earlier this year, but investments in new AI features across its product offerings are just starting to pay dividends.

Microsoft is seeing gains on both the consumer and enterprise side, as the company rolls out new AI features. Copilot is the company's generative AI search feature that is now available on nearly 225 million Windows 10 and Windows 11 PCs. This is double the number of PCs using Copilot over the previous quarter.

On the enterprise side, Microsoft's Azure cloud service is currently No. 2 behind the leader Amazon Web Services, but Microsoft has been consistently growing faster than Amazon in the cloud market. Revenue from Azure and other services grew 31% year over year in the March-ending quarter, driven by an acceleration in customers migrating data over to Azure.

The growth in the cloud market is one of the best reasons to consider buying shares, especially with demand for AI services contributing more to Azure's growth. Microsoft has an enormous growth runway in cloud computing, considering the number of Azure deals valued at more than $100 million grew 80% over the year-ago quarter, while smaller deals more than doubled.

Microsoft is even more profitable than Alphabet, generating $86 billion of profit on $236 billion of revenue. The consensus analyst estimate has Microsoft's earnings growing at an annualized rate of 14% over the next several years, but that estimate has been increasing over the last year. Microsoft reported 20% year-over-year earnings growth in the recent quarter. At this pace, the stock could double in the next five years assuming it still trades at the same P/E.