Amazon's commerce business helps fund AWS' growth.
Microsoft is benefiting from AI spending in two ways.
Predicting what will happen 20 years from now is nearly impossible. If you rewind 20 years from today, you'd be in 2006. Several unseen events occurred from 2006 to 2026, ranging from the great financial crisis to a global pandemic to the rise of generative artificial intelligence (AI). It's anyone's guess what will happen in the next 20 years, but I think there are a few general conclusions that investors can draw.
As we enter the age of AI, there are a handful of companies that are primed to excel, and I think the ones building the AI infrastructure are most likely to cash in.
Where to invest $1,000 right now? Our analyst team just revealed what they believe are the 10 best stocks to buy right now, when you join Stock Advisor. See the stocks »
Two that I'm a huge fan of are Microsoft (NASDAQ: MSFT) and Amazon (NASDAQ: AMZN). Each of these companies is building a huge amount of AI infrastructure, and both look like great stocks to buy now and hold over the next 20 years.
Image source: Getty Images.
Amazon is a two-faced company that will likely be just fine over the next 20 years. The primary part of Amazon that most consumers interact with is its commerce business, and buying items online is a trend that likely won't reverse anytime soon. However, that's not what I'm most excited about.
Instead, I'm focused on Amazon's cloud computing platform, Amazon Web Services (AWS). AWS is increasingly becoming a popular place to run AI workflows, and investors are seeing that effect in two areas. First, its growth rate. In the first quarter, AWS' growth rate was 28%, the best in 15 quarters.
Its custom AI chip business also grew at a triple-digit year-over-year pace, making another exciting growth wing for Amazon.
CEO Andy Jassy noted in his shareholder letter that the infrastructure Amazon is spending $200 billion on this year has a useful life of over 30 years, with computing equipment lasting about five years. If Amazon can deliver a strong return on investment for the $200 billion it spent, then Amazon shareholders will have a massive return as well. Amazon believes it can convert this into massive free-cash-flow growth, and over the next few years, investors should see this metric explode higher.
If Amazon can deliver that, it makes sense to buy and hold onto it for a long time. AI compute isn't going anywhere, and Amazon is one of the top companies to capitalize on this trend.
Microsoft is a similar story to Amazon, except that its core business is also benefiting from AI. Microsoft has integrated AI capabilities into its various business productivity software tools, and this has resulted in a $37 billion business, which is growing at a 123% pace.
Similar to Amazon, Microsoft's cloud computing business, Azure, is also doing quite well. Azure's revenue rose 40% in its latest quarter, showcasing huge AI computing demand.
Cloud computing is a great business because it's a usage-based model. So, whenever a client runs a workload on Amazon's or Microsoft's servers, they pay a toll. As more AI workloads come online, this revenue stream rises. This is also sustainable, because AI workloads will need to use tokens every time they're run, which leads to long-term revenue streams for both Microsoft and Amazon.
Additionally, each of these companies has formed deep ties with pure-play AI companies, with Microsoft partnering with OpenAI and Amazon connecting with Anthropic.
So, it doesn't really matter which company has the best generative AI model, as long as some of the workloads are being run on either Microsoft's or Amazon's servers.
These workloads aren't going anywhere over the next two decades. As AI becomes more deeply integrated into daily lives and business workflows, these two will be some of the biggest beneficiaries. Combined with the strength of their core businesses, that makes Amazon and Microsoft no-brainer buy-and-hold investments for the next 20 years.
Before you buy stock in Amazon, consider this:
The Motley Fool Stock Advisor analyst team just identified what they believe are the 10 best stocks for investors to buy now… and Amazon wasn’t one of them. The 10 stocks that made the cut could produce monster returns in the coming years.
Consider when Netflix made this list on December 17, 2004... if you invested $1,000 at the time of our recommendation, you’d have $417,305!* Or when Nvidia made this list on April 15, 2005... if you invested $1,000 at the time of our recommendation, you’d have $1,293,148!*
Now, it’s worth noting Stock Advisor’s total average return is 936% — a market-crushing outperformance compared to 207% for the S&P 500. Don't miss the latest top 10 list, available with Stock Advisor, and join an investing community built by individual investors for individual investors.
See the 10 stocks »
*Stock Advisor returns as of June 20, 2026.
Keithen Drury has positions in Amazon and Microsoft. The Motley Fool has positions in and recommends Amazon and Microsoft. The Motley Fool has a disclosure policy.