Amazon (AMZN -2.56%) and MercadoLibre (MELI -1.01%) are two titans in the world of e-commerce. Amazon stands as the clear industry leader in North America, Europe, and other regions. It has also spearheaded and continues to lead the cloud-infrastructure services market. Meanwhile, MercadoLibre is at the top of the online-retail space in countries including Brazil and Argentina, and it also has a fast-growing payment processing business. 

Which one of these stocks looks like the better buy at today's prices? Read on to see cases for both stocks and a determination on which company is likely to be the better fit for your portfolio.

Money in a miniature shopping cart.

Image source: Getty Images.

The case for Amazon

While Amazon's online retail segment still accounts for the large majority of its overall revenue, it's actually its cloud business that is its most important profit generator. E-commerce has always been a relatively low-margin business, and recent macroeconomic headwinds have elevated costs and hurt the company's earnings. But it's clear that Amazon is playing the long game, and the potential payoffs for its patient, long-haul strategy to the market are likely to be enormous. 

Advances in automation will likely significantly lower operating costs for Amazon's warehouse and delivery operations over time, paving the way for its e-commerce business to become significantly more profitable. With the company's online retail business already doing hundreds of billions of dollars in sales annually, margin improvement stands to have a transformative impact on the tech giant's bottom line. 

Amazon Web Services (AWS) should also continue to be a strong profit driver for the company. Even with rising energy, infrastructure, and employee costs last quarter, AWS still posted an operating income margin of 24% on revenue of $21.35 billion.

Despite the company's international e-commerce-focused segment posting an operating loss of roughly $1.25 billion, AWS' $5.12 billion contribution and $898 million from the North American segment pushed overall company operating income to $4.77 billion in the quarter.

Overall, Amazon remains a fantastic business, and it still has some huge growth opportunities. It's likely that the company will eventually be able to significantly improve its margins in e-commerce, and the long-term demand picture for AWS continues to look very strong.

The company is in the early stages of benefiting from the AI revolution, and its stock continues to look attractively valued at today's prices. 

The case for MercadoLibre

While Amazon grew sales just 9% year over year in the first quarter, MercadoLibre recorded a 58.4% increase in the first quarter to reach $3 billion in sales. Total merchandise volume conducted across its e-commerce platform rose 43.3% year over year on a currency-adjusted basis, and total payment processing volume soared 96.1% compared to the prior-year period.

Much of the Latin American e-commerce leader's more explosive growth comes down to it still being a much smaller company overall, but this dynamic could continue to work in the favor of growth-oriented investors. As the smaller company, MercadoLibre will have a much easier time delivering relative growth, and it still has a large and expanding addressable market to capitalize on. 

Crucially, the company is also posting margins that look very strong in the context of such rapid sales growth. MercadoLibre also posted an operating income margin of 11% in the quarter, coming in significantly ahead of Amazon's 3.7% operating margin. Not only is the Latin American e-commerce and payments specialist expanding at a brisk pace, it's also showing impressive levels of efficiency. 

MELI PS Ratio (Forward) Chart

MELI PS ratio (forward) data by YCharts. PS = price-to-sales ratio.

With a market cap of roughly $67 billion, MercadoLibre looks downright tiny next to Amazon's more than $1.2 trillion valuation, and it might have more appeal for investors seeking explosive stock performance. Given that the business is serving up such strong growth and still has plenty of long-term expansion potential, MercadoLibre looks like a smart buy for growth investors right now. 

So which stock is the better buy?

If you prefer larger, more established companies that are less likely to face significant valuation volatility, Amazon stock is probably the better fit for your portfolio. On the other hand, if you're willing to embrace more risk in pursuit of greater returns, MercadoLibre has more explosive potential. But you don't necessarily have to choose between these two e-commerce leaders. 

Amazon and MercadoLibre each look like good long-term investments at today's prices. If you're seeking broad exposure to e-commerce, cloud technologies, and payments services, or just want to add strong companies to your portfolio, buying both stocks could be the right move.