When it comes to tech stocks riding the artificial intelligence (AI) wave, both Amazon (AMZN -0.68%) and Alibaba (BABA -3.34%) are in strong positions. Each is leaning into AI to help drive growth for cloud computing and e-commerce businesses that both companies operate.
Let's see which stock is the better buy.

Image source: Getty Images.
Alibaba: A turnaround with big AI ambitions
Alibaba has been working hard to turn around its core e-commerce business. It has been investing heavily in Tmall and Taobao to reaccelerate gross merchandise volume (GMV) growth and is now beginning to monetize that higher GMV more effectively through a small software fee and its AI-powered marketing tool, Quanzhantui. Last quarter, its e-commerce revenue rose 9% year over year, while third-party revenue jumped 12%. More importantly, segment earnings before interest, taxes, and amortization (EBITA) climbed 8%.
At the same time, Alibaba is seeing strong momentum in its cloud computing business. Its Cloud Intelligence segment revenue increased by 18% year over year last quarter, as AI-related revenue more than doubled for the seventh consecutive quarter. Impressively, its adjusted EBITA surged by 69%, demonstrating the segment's strong operating leverage.
Alibaba's AI push is being driven by its Qwen series of models. In addition to a strong foundation model, it's rolled out versions specifically built for tasks like coding and math. Its latest release, Qwen3, is a new class of "hybrid reasoning" models that combine traditional large language model capabilities with more advanced, dynamic reasoning. Meanwhile, Alibaba scored a huge win earlier this year when Apple chose its models to power Apple Intelligence in China, although the deal has been delayed by Chinese regulators. Nonetheless, it's a clear sign that Alibaba's AI efforts are gaining traction despite the U.S. chip export ban.
In addition to its core e-commerce and cloud computing businesses, Alibaba also has a big opportunity with its international commerce segment (AIDC), which includes AliExpress and Turkey-based Trendyol. This segment grew revenue by 22% last quarter, and management expects it to turn profitable within the next year. Flipping AIDC into the black could be a major tailwind for earnings growth going forward.
Despite its recent rally, Alibaba still looks incredibly cheap. The stock trades at around 12 times forward earnings, with nearly $20 billion in net cash and another $57 billion in equity investments on its balance sheet. If sentiment around Chinese equities continues to improve, there could be meaningful upside in the stock from here.
Amazon: An efficient growth machine
Amazon is less of a turnaround story and more of a manual on relentless operational execution. It's already a $2 trillion market cap behemoth, but it's still finding ways to increase revenue growth and drive margins higher.
Its cloud computing unit, Amazon Web Services (AWS), remains its crown jewel. Revenue jumped 17% year over year last quarter to $29.3 billion, while operating income grew even faster, up 23%. AI is a big reason for this. Amazon is seeing strong demand for its Bedrock and SageMaker solutions, which help customers build, fine-tune, and deploy AI models. At the same time, it has also developed its own custom AI chips, which can boost performance and use less energy. This helps reduce costs, which could be a key long-term differentiator.
However, Amazon isn't just leaning into AI to drive growth at AWS; it's using AI across its entire ecosystem to drive efficiencies. In its warehouses, Amazon is developing AI-powered robots that can do everything from lifting heavy boxes to spotting damaged goods. On the logistics side, it is using AI to optimize delivery routes, navigate large apartment complexes, lower fuel costs, and improve customer satisfaction. In e-commerce, Amazon is using AI to help third-party merchants create stronger, more effective product listings, while on the advertising side, it's using AI to drive improved campaign performance through better targeting and more compelling ad content.
All of this is leading to improved operating leverage in the e-commerce business. In Q1, its North American revenue rose 8%, while operating income jumped 16%. However, given that Amazon is still in the early innings of rolling out these AI initiatives, the best is yet to come.
From a valuation perspective, Amazon trades at a forward P/E of 34.5 times, which is obviously much higher than Alibaba.
Which stock is the better buy?
Both Alibaba and Amazon are e-commerce leaders with strong, growing cloud computing businesses. Both have also embraced AI and are looking to be leaders in the field.
In my view, Alibaba has more potential upside. It appears to be successfully turning around its e-commerce business, is an AI leader in China domestically, and has a big potential earnings driver with its AIDC business. Most importantly, it trades at a deep discount to Amazon.
That said, Amazon is the safer play. Alibaba faces more risks from geopolitical tensions, tougher domestic competition, and a murky regulatory environment in China. Amazon, meanwhile, is a proven compounder that has shown time and again that it's willing to invest heavily in order to win big. While it faces typical retailer risks related to consumer spending, this is a company that I have little doubt will be a long-term AI winner.
As such, for investors looking for more potential upside, Alibaba is the clear choice. However, from a risk-reward perspective, investors can't go wrong with Amazon.