Microsoft and Amazon enjoy sustainable competitive edges in their respective industries.

The stock market’s benchmark S&P 500 index reached another all-time record high of 5,321.41 on May 21. Since then, the index has seen a small pullback, but the ongoing momentum in artificial intelligence (AI) stocks amid an improving economy and stabilizing interest rates could buoy the index to new highs. In fact, according to Fundstrat Global Advisors Managing Partner Tom Lee, the S&P 500 could reach 5,500 by the end of June.

While investors can take such forecasts with a pinch of salt, there is no denying that historical patterns favor the index continuing its rally.

Although some investors may be hesitant to invest when the market is at such a high level, picking up shares of quality companies with robust growth potential — companies like Microsoft (MSFT -0.16%) and Amazon (AMZN -0.38%) — can still be a profitable strategy in the long run.

Microsoft

Thanks to its partnership with ChatGPT developer OpenAI, technology titan Microsoft has successfully launched multiple AI-powered services in tandem with its core offerings, among them Azure AI services and the Copilot assistant, which is now available across an array of productivity titles.

Microsoft’s results for its fiscal 2024 third quarter, which ended March 31, were stellar, and AI played a major role in its performance.

Revenues from Azure and other cloud services grew 31% year over year in the quarter, with AI contributing 7 percentage points of that growth. Enterprises have increasingly opted to migrate their formerly on-premises digital workloads to the Azure platform, and are using it for custom AI projects as well. Azure OpenAI service is already being used by more than 65% of Fortune 500 companies. The number of $100 million-plus Azure deals also grew by over 80% year over year in the fiscal third quarter. All this has culminated in a rapid expansion in Azure’s customer base and growth in per-customer utilization of Azure services.

Microsoft is also focused on expanding Copilot’s user base and increasing its usage intensity across applications such as Microsoft 365, Dynamics 365, Power Platform, and GitHub, as well as third-party platforms from Salesforce, ServiceNow, and Zendesk.

Copilot was available on nearly 225 million Windows 10 and Windows 11 devices in fiscal Q3, almost doubling on a quarter-over-quarter basis. Copilot has also opened up an opportunity for Microsoft to introduce a new category of AI-optimized devices. Piper Sandler analysts expect Copilot to contribute more than $10 billion in annual revenue by 2026.

Microsoft is trading at 13.1 times sales and 36 times trailing-12-month earnings. Although those are not cheap valuations, the stock has potential to rise due to the numerous multibillion-dollar AI opportunities the company hopes to exploit. Hence, the stock still appears to be a worthwhile long-term investment for retail investors now.

Amazon

Shares of e-commerce and cloud computing giant Amazon are currently near their record high, and the company’s growth shows no signs of slowing down.

According to a forecast from Grand View Research, the global e-commerce market will grow from $25.9 billion in 2023 to $83.26 billion in 2030 — a compound average rate of 18.9% annually. Although Amazon has long been a dominant player in this market, its profit margins from this business have always been slim. However, lately, the company has launched several initiatives to reduce its e-commerce costs. These include regionalizing the fulfillment network, consolidating more units in fewer boxes, optimizing inventory placement and inbound logistics, and expanding its lower-cost same-day fulfillment centers.

Its cloud computing business, Amazon Web Services, has also picked up the pace, as companies are now focusing on cloud migrations and modernizing their IT infrastructure. Customers are using AWS’ generative AI capabilities, which include GPU resources, a fully managed Amazon Bedrock service for accessing and customizing multiple top-tier large language models, and several generative AI-powered applications. AI has already contributed several billion dollars to the company’s annual revenue, and management expects generative AI to be a huge growth opportunity in the next 10 to 20 years.

In the first quarter, AWS’ revenue grew by 17.2% year over year, up from a 13.2% growth rate in 2023’s final quarter. Its annualized revenue run rate is already over $100 billion. With over 85% of the global IT spending still focused on on-premises infrastructure, there is huge growth potential for AWS in the coming years.

Advertising has emerged as a major growth catalyst, with first-quarter ad revenue soaring 24% year over year to $11.8 billion. Sponsored products and Prime Video ads have become significant growth opportunities.

Considering the rapid progress of Amazon’s high-margin cloud computing and advertising businesses, and its increased focus on e-commerce profitability, its stock seems to be a compelling pick for retail investors.

John Mackey, former CEO of Whole Foods Market, an Amazon subsidiary, is a member of The Motley Fool’s board of directors. Manali Pradhan has no position in any of the stocks mentioned. The Motley Fool has positions in and recommends Amazon, Microsoft, Salesforce, and ServiceNow. The Motley Fool recommends the following options: long January 2026 $395 calls on Microsoft and short January 2026 $405 calls on Microsoft. The Motley Fool has a disclosure policy.

Source link