Amazon (AMZN 3.43%) and Alibaba (BABA 0.59%) stand as the world's two largest e-commerce companies. Each company also stands as the largest provider of cloud infrastructure services in the core markets in which it operates.

Even though the two online retail and cloud computing giants share some key similarities, performance for their respective stocks has been starkly different in 2023. While Amazon stock has soared roughly 72% year to date, Alibaba's share price is roughly flat across the stretch. 

Will investors score better returns by putting their money behind the red-hot Amazon or the more conservatively valued Alibaba? Read on to see why two Motley Fool contributors have opposite takes on which stock is the better buy right now. 

Ready for a reset

Jeremy Bowman (Alibaba): It might seem hard to like Alibaba stock right now.

The Chinese tech giant has been through the wringer in recent years as a crackdown prompted by off-color remarks by founder Jack Ma, the impact of China's Zero Covid policy, and a weak economy in China have all weighed on the business. The stock is now down 72% from its peak nearly three years ago.

However, there are signs of an emergent recovery at Alibaba. Beijing's crackdown on the tech sector and the Zero Covid policy are now over, and Alibaba's revenue accelerated to 14% in its most recent quarter, its fastest pace in several quarters.

The company also restructured its business into six divisions, with its e-commerce marketplaces Taobao and Tmall at its core. Investors cheered the move as it potentially sets up Alibaba to spin off those businesses, creating shareholder value.

Additionally, Alibaba just appointed Eddie Wu as its new CEO and also the CEO of the Cloud Intelligence Group as it prepares to spin off the cloud unit.

Wu has said his two top priorities are artificial intelligence and user experience, which could breathe new life into the company, especially as price competition has intensified with other Chinese e-commerce companies like Pinduoduo and JD.com

Alibaba remains highly profitable, and the stock trades at an attractive multiple at a price-to-earnings ratio of just 10. While Amazon may be the safer choice as it doesn't face the risks of operating in China, Alibaba has considerable upside potential if it can continue to reaccelerate its revenue growth and execute on its restructuring plan.

Amazon is the total package

Keith Noonan (Amazon): Based on earnings multiples, there's no doubt that Alibaba looks cheaper than Amazon right now. The Chinese tech giant's forward price-to-earnings ratio sits just a hair under the double-digit range, while the U.S.-based company's stock looks significantly more expensive, trading at roughly 67 times this year's expected profits. 

BABA PE Ratio (Forward) Chart

BABA P/E Ratio (Forward) data by YCharts.

But even though price-to-earnings ratios might suggest Alibaba is the better buy, I think Amazon presents a much smaller risk profile while still offering attractive return potential. 

While the Chinese government has relaxed policies geared toward stopping the spread of the coronavirus and curbing the power of large tech companies, it's hard to predict what its next moves will be. Priority currently seems to be focused on aiding the country's economic recovery, but there's plenty of uncertainty on the horizon.

Amid rising tensions between the U.S. and China, the emergence of new COVID strains, and a wide range of other factors, there are good reasons to be cautious about Chinese stocks right now. Alternatively, there are plenty of reasons to be excited about Amazon. 

Following a stretch of sluggish performance in 2022 as pandemic-driven demand receded and macroeconomic headwinds depressed performance on multiple fronts, the business seems to be rebounding. Even with year-over-year growth for its profit-driving Amazon Web Services (AWS) segment slowing to 12% in the second quarter, total revenue climbed roughly 11% in the period. 

Along with improvements in the company's e-commerce business, Amazon's digital advertising business continued to serve up excellent results. Ads revenue grew 22% year over year in the second quarter to reach $10.1 billion despite a sluggish overall backdrop for the digital ads industry, and it looks like the unit has plenty of room for long-term expansion still ahead. 

Between solid growth across its key businesses and cost-cutting initiatives, the company's profitability is soaring. Operating income rose roughly 132% year over year to hit $7.7 billion last quarter, even though lingering macroeconomic headwinds have created a challenging growth backdrop for AWS. Amazon has shown that it can withstand pressures, and it's poised to deliver impressive returns for long-term shareholders. 

Which stock is the better buy?

Choosing between Alibaba and Amazon should come down to your personal portfolio goals and prioritization of risk and profit opportunities. For investors seeking cheaply valued stocks trading at low earnings multiples, Alibaba fits that profile right now. On the other hand, Amazon looks like the better buy if you want exposure to the e-commerce and cloud-services markets and are wary about the Chinese market right now. 

But investors don't necessarily have to choose between the two stocks. If you're not deterred by the respective risk factors that come with each company, it's possible that owning both could be the right move.