Amazon.com (AMZN -2.50%) and Facebook (META -3.69%) are among the best-known businesses in the world. Whether you're messaging a friend on Facebook or buying that friend a gift on Amazon, the companies' platforms have a presence in billions of lives every day.

As a result, Amazon and Facebook have produced incredible returns for investors, soundly beating the market for years. But which of these tech companies is the better investment for the next three to five years? Let's take a look.

Amazon Prime delivery truck

Image source: Amazon.

Recent results

Despite its massive size, Amazon continues to grow at an impressive rate. In its most recent quarter, revenue was up 24% year over year to $70 billion, although operating income (down 14%) and net income (down 26%) both declined.  

On the surface, the profit figures could be cause for concern, but there's a reason behind the decline: Amazon is investing in its future. The company is transitioning its Prime service from two-day delivery to one-day. The move benefits the company both by better serving customers and simultaneously putting pressure on the competition.

Facebook also continues to grow. In its most recent quarter, Facebook reported a 29% increase in revenue. Operating earnings were up 24% and net income grew 19%. Facebook's advertising revenue rose to $17.4 billion, despite a 6% decrease in ad prices. 

AMZN Chart

AMZN data by YCharts

The decline in ad prices was offset by a 37% increase in ad impressions -- more people are seeing those ads. Daily active users (DAUs) on Facebook grew 9% to 1.62 billion and monthly active users (MAUs) were up 8% to 2.45 billion. Across all its platforms -- Facebook, Instagram, WhatsApp, and Messenger -- the company now has 2.2 billion DAUs and 2.8 billion MAUs.

Advantage: Tie.

Valuation

Facebook and Amazon both have market capitalizations exceeding half a trillion dollars and are among the 10 most valuable publicly traded companies in the world. Facebook's market cap is approximately $570 billion, and Amazon's is around $880 billion. Here's a look at a few valuation metrics for these technology titans.

Company P/E ratio P/S ratio P/FCF ratio
Amazon 77 3.3 37
Facebook 31 8.4 29

Data sources: Yahoo! Finance for P/E ratio and P/S ratio; Amazon and Facebook earnings reports for P/FCF. Data through Nov. 20, 2019. Ratios are for trailing 12 months. 

Facebook is less expensive based on its price-to-earnings ratio and price-to-free-cash-flow ratio. Amazon is a better value based on the price-to-sales ratio.

Both companies produce incredible cash flow. For the trailing 12 months, Facebook has $19.1 billion in free cash flow and Amazon $23.5 billion. That provides both with flexibility to make investments in their future.

Advantage: Facebook.

Future prospects

With billions of users and 7 million advertisers, Facebook's properties have grown into a massive advertising machine. The company receives more than 20% of all U.S. digital advertising spending, trailing only Google's 37%, according to research firm eMarketer

Facebook's revenue has continued to accelerate, although the company has been warning of a slowdown and forecasts revenue growth in the mid- to high-single-digit percentage range in the fourth quarter. Meanwhile, costs are rising as Facebook invests heavily in platform safety, threatening to pinch profitability.

More than 98% of Facebook's revenue comes from advertising, and that's an important distinction with Amazon, which has continued to diversify its revenue streams. It has grown from an online bookseller to a retailing superpower that is also a cloud computing titan and growing force in digital advertising.

About 75% of Amazon's revenue has come from retail sales this year. Amazon Web Services, which didn't exist until 11 years after the company's 1995 launch, has become a business unto itself. AWS produced $25.1 billion in revenue, 13% of the company's total, in the first nine months of this year. 

Amazon's digital ad revenue also is soaring, having reached about $9 billion through the first nine months of the year. eMarketer reported that Amazon's U.S. digital advertising market share will continue to grow, from about 4% this year to 7% in 2020. While that's well behind next year's estimates for Google (35%) and Facebook (21%), Amazon is mounting a challenge.

Advantage: Amazon.

Leadership

For long-term investors, there may be no more important factor than a company's leadership. You put your faith in leaders to execute a vision, and Amazon and Facebook both have visionary founder CEOs.

Facebook CEO Mark Zuckerberg has created a social network phenomenon that reshaped how the world communicates. The platform has produced massive amounts of money, but it's also come with issues. Facebook's platform has been abused with fake news and privacy violations. Management's slow response to the problems, and images of Zuckerberg sitting in Congressional hearings, have damaged its brand.

Amazon CEO Jeff Bezos has transformed his company the last 20 years. In the late 1990s, this was one of Amazon's biggest goals: If a book was in print, it would be in stock and ready to ship to online customers. Amazon still sells books, and you can use your Echo to have Alexa order one. It can be delivered to your home the next day with Prime, or you can simply get it directly on your Kindle. The company has become entrenched in lives as Bezos has continually kept it evolving.

Advantage: Amazon.

Final call

Amazon and Facebook have been great investments, and both continue to grow impressively. If you're deciding between the two, however, Amazon has the edge. Bezos has repeatedly found ways to keep customers happy and add significant new revenue sources. As long as he's at the helm, there's no reason to believe that will change.