Amazon (AMZN -1.65%) and Alibaba (BABA 0.64%) are the world's two biggest e-commerce companies and, in many ways, the companies are mirror images of one another.

In addition to operating the world's leading e-commerce marketplaces, both companies have large cloud infrastructure business, logistics operations, and exposure to digital entertainment through video streaming, among other satellite businesses.

A view from below of tall trees

Image source: Getty Images.

These are giant companies, but they've managed to maintain strong top-line growth rates, and their stocks have outperformed the market in recent years, as the chart below shows. 

AMZN Chart

AMZN data by YCharts

In this battle between two global tech giants, which is the better buy today? Let's take a look at what each stock has to offer today in order to answer that question. 

Amazon in peak form

Few companies have ended up benefitting from the economic effects caused by the coronavirus pandemic as much as Amazon. Amazon revenue jumped more than $100 billion last year. That increase is more than what only a handful of U.S. companies normally generate in revenue annually. Nearly all of its businesses, including video streaming, cloud computing, and voice-activated technology, have gotten some kind of tailwind from the crisis, but its e-commerce business has really shined over the last year. 

North American e-commerce sales jumped 38% in the year to $170.8 billion as the company became a lifeline for consumers during the pandemic. International e-commerce sales surged 40% to $104.4 billion, and it flipped from a $1.7 billion operating loss into a $717 million operating income.

An open Amazon box

Image source: Amazon.

Amazon's competitive advantages are manifest as its Prime loyalty program locks in customers, and it has layered on high-margin services to its e-commerce business like its third-party marketplace, fulfillment, and advertising. As those segments and its cloud business have taken off, profits have soared. Net income nearly doubled last year to $21.3 billion even as the company absorbed billions in COVID-19-related costs.

Amazon is at a turning point with CEO Jeff Bezos set to step down in the third quarter, but the company's many competitive advantages won't be easily undone. Profit margins should continue to ramp up as the company approaches $500 billion in annual revenue.

Alibaba: The best of growth and value 

Alibaba shares were rocked in recent months by rumors that founder Jack Ma was "missing" and after Chinese officials announced an antitrust investigation into the company. Those events underscore some of the risks facing Chinese stocks like Alibaba, but the stock's recovery once Ma made a public appearance is a reminder that those risks are often exaggerated.

Like Amazon, Alibaba has put up strong growth during the pandemic even as China rebounded much faster than the U.S. from the crisis. The company's revenue jumped 37% in its most recent quarter to $33.9 billion and it finished the year with 779 million active annual consumers, showing the value of operating in a massive market like China. 

A rock with the Alibaba logo outside of an office.

Image source: Alibaba.

Because its core business is an e-commerce marketplace, Alibaba is also highly profitable, collecting commissions on sales on its marketplaces like TMall and Taobao. Over the last year, it passed $1 trillion in gross merchandise volume (GMV), making it the biggest online marketplace by GMV in the world. In its most recent quarter, adjusted EBITDA increased 22% to $10.5 billion, giving it a 31% adjusted EBITDA margin. Alibaba's other businesses like cloud and logistics saw revenue growth of 50% or better in the recent quarter, and the company is also continually expanding through partnerships with businesses like Farfetch and Dufry, leveraging other companies' assets and increasing its competitive advantages. Alibaba is an attractive partner for almost any brand looking to do business in China.

Alibaba's base in China also sets it up for strong growth. China has become the world's biggest retail market, and consumer spending will continue to grow as more Chinese move into cities and join the middle class, paving the way for long-term growth.

Amazon and Alibaba: Head-to-head

Both Amazon and Alibaba have similar businesses and enjoy competitive advantage through network effects and their leading positions in e-commerce in their respective geographies.

The major difference between the two stocks comes down to valuation. Amazon trades at a price-to-earnings valuation of 75, while Alibaba is valued at just 26, making it nearly three times as cheap as Amazon. Given the risks in China, including the vagaries of the ruling communist party, Chinese stocks tend to trade at a discount to their American counterparts. However, Amazon also faces a similar set of risks as antitrust investigations have mounted against the company and other FAANG stocks.

Considering the significant valuation gap between the two stocks, Alibaba is the better buy today. While both of these stocks look poised to outperform the S&P 500 over the coming years based on their competitive advantages and growth momentum, Alibaba is the better value of the two. Its lower price tag gives investors assurance that even if growth stocks fall -- a distinct possibility in the economic reopening -- Alibaba shares will remain solid.