Microsoft (MSFT 0.34%) is now the most valuable company in the world, with a market capitalization of just over $3 trillion. The proliferation of artificial intelligence (AI) has played a central role in helping the tech giant reach this position.

Shares of Microsoft have jumped more than 72% since the beginning of 2023 when the AI revolution started taking hold. The stock's performance has matched that of the Nasdaq-100 Technology Sector index during this period. Microsoft's impressive rally seems well-deserved considering that the company has been quick to monetize its partnership with OpenAI and is offering a wide range of AI-focused solutions across its software portfolio.

AI has started moving the needle for Microsoft already, with the company witnessing growth in lucrative markets such as cloud computing. Looking ahead, Microsoft could remain a solid AI play thanks to adoption of the technology in the workplace collaboration, cloud, gaming, and personal computer (PC) markets.

However, Microsoft itself expects AI to only make a gradual contribution to its growth. Meanwhile, analysts at investment banking firm Evercore predict that AI could add $100 billion to Microsoft's annual revenue by 2027. The company's trailing-12-month revenue of $575 billion suggests that AI could give Microsoft's top line a 17% boost over the next three years based on Evercore's estimate.

This probably explains why analysts are expecting Microsoft's earnings to increase at 16% a year for the next five years. While that's a decent pace of growth, there are other AI stocks that are anticipated to clock much faster growth over the next five years, and they may even become more valuable than Microsoft.

We are going to take a look at one such name in this article.

Amazon could be a big winner of the AI revolution

Amazon (AMZN 1.37%) is the sixth-largest company in the world, with a market capitalization of $1.9 trillion. Like Microsoft, the e-commerce and cloud computing giant has been aggressively incorporating AI elements into its various offerings.

For instance, the company is bolstering its cloud computing business -- Amazon Web Services (AWS) -- by offering customers "the most expansive collection of compute instances." AWS customers can not only get access to chips from chip giant Nvidia to train and deploy AI models on its cloud computing platform, but they can also access Amazon's in-house chips for their AI needs if they are looking for performance on a budget.

Amazon management pointed out on the company's February earnings conference call that "several customers [use] our AI chips, including Anthropic, Airbnb, Hugging Face, Qualtrics, Rico, and Snap." That's not surprising, as different companies have different needs when it comes to developing AI applications, and not everyone needs the power of an expensive Nvidia graphics card.

Amazon has recognized this, and is looking to capitalize on its position as the leading cloud computing provider to win more AI-related business. AWS controlled 31% of the cloud infrastructure market at the end of last year. The integration of AI tools into its platform is a smart move by Amazon, as the demand for AI services in the cloud could grow at an annual rate of 36% through 2032, generating $887 billion in annual revenue at the end of the forecast period.

The good news for Amazon investors is that the cloud isn't the only area where the company is deploying AI to power its long-term growth. It has introduced e-commerce-focused AI tools as well. Amazon has harnessed the power of generative AI to help sellers create product pages on its e-commerce platform with just a link to their websites. Sellers won't have to go through a lengthy and tedious process to populate product pages manually.

That's why it isn't surprising to see that more than 100,000 of the company's selling partners have already used this tool, which simplifies the process of creating listings on the platform. The ease of creating product pages could help Amazon attract more sellers and allow it to corner a bigger share of the e-commerce market in the future.

At the same time, Amazon has rolled out a generative AI-powered assistant known as Rufus to help improve product discovery for customers shopping on its platform. Amazon has trained Rufus using its "extensive product catalog, customer reviews, community Q&As, and information from across the web." As a result, the company could encourage more customer spending on its platform by using AI to recommend the right products.

All in all, it is easy to see why analysts are expecting Amazon to clock a healthy annual earnings growth rate of 30% for the next five years. But will this be enough to make it bigger than Microsoft five years from now?

Can Amazon overtake Microsoft?

Amazon finished 2023 with earnings of $2.90 per share. If its earnings indeed grow at 30% a year for the next five years, Amazon's bottom line could jump to $10.77 per share. The stock is currently trading at 44 times forward earnings. That's in line with the U.S. technology sector's earnings multiple. Given that Amazon's earnings growth is forecast to accelerate over the next five years compared to the 10% growth it has clocked in the last five, the market could reward it with a richer multiple.

But even if Amazon maintains its forward earnings multiple in five years, its stock price could jump to $474. That would be a 158% jump from current levels, indicating that Amazon's market cap could increase to $4.9 trillion after five years.

Microsoft's projected earnings growth rate of 16% could take its bottom line to $20.60 in five years (using its fiscal 2023 earnings of $9.81 per share as the base). Microsoft is currently trading at 31 times forward earnings, which is a slight premium to its five-year average forward price-to-earnings (P/E) multiple of 29.

Considering that Microsoft is predicted to clock slower earnings growth than Amazon, we are going to assume that it will trade at a discount to Amazon and maintain a P/E multiple of 29 in five years based on its five-year average. So Microsoft stock could jump to $597 after five years. That would be a 43% jump from current levels, indicating that its market capitalization could rise to $4.4 trillion after five years.

As such, the possibility of Amazon becoming a bigger company than Microsoft in five years cannot be ruled out, which is why investors looking to buy an AI stock that can deliver healthy long-term gains should keep it on their radars.