(AMZN -0.38%) is the do-everything store. It continues to attract new loyal customers through its Prime membership service -- over 100 million and growing. The company has expanded its expertise from selling stuff to a host of other services, including Amazon Web Services, Prime Video and Music, and the dynamic duo of Alexa and Echo in smart-home devices. A $1,000 investment in Amazon stock in March 2009 would be worth $24,700 today. 

Facebook (META 0.81%) boasts 2.7 billion users across all its social media platforms, including Facebook, Instagram, WhatsApp, and Messenger. The rapid growth of digital ad spending has been a boon for the company in recent years, with the stock up 333% since its initial public offering in 2012. 

Both stocks have been big winners for shareholders. But which stock should you buy today? Let's find out.

Two small silver figurines of a bear and a bull facing each other while standing on top of a stock price graph and a list of stock quotes.


Competitive moat

Amazon has a wide moat derived from its vast selection and low prices on, well, everything. The company has branched out from selling books and electronics to emerge as the world's most dominant cloud service provider with Amazon Web Services (AWS). Additionally, Prime Video is a formidable foe in the video streaming market, and the company is currently trying its hand at disrupting grocery, video games, and healthcare, too.

Another area where Amazon sees tremendous growth is advertising. Digital advertising makes up 98% of Facebook's revenue, and Amazon is emerging as a competitor in the space. Amazon's share of the digital ad market is projected to expand from 4.1% in 2018 to 7% by 2020, according to eMarketer. Meanwhile, Facebook's share is expected to remain roughly flat at 20.8%, while Alphabet's Google could drop a few points down to 35.1% of the digital ad pie.

Companies are finding Amazon a particularly valuable ad partner because it allows them to put their products in front of millions of shoppers directly on the Amazon site. Nearly half of internet users are now starting their online shopping by searching on Amazon first, which makes Amazon a more direct way for advertisers to lure customers than Facebook's social media platform, where users are sometimes more interested in connecting with others than clicking an ad to buy something.

However, Facebook is still a crucial piece of the puzzle of companies' advertising budgets. After all, 2.7 billion users is a lot of eyeballs, and social shopping has become a thing lately. CEO Mark Zuckerberg is excited about the long-term opportunity to grow commerce through Instagram

In the fourth quarter, Facebook's revenue climbed 30% year over year. However, this is a deceleration compared to previous quarters. The social media giant has had to spend time and billions of dollars to shore up its data and security issues amid concerns about privacy on its platforms, which has weighed on profit growth and kept management from spending time on growth projects. Facebook's operating margin declined from 57% in the fourth quarter of 2017 to 46% in the most recent quarter, causing operating income to increase by only 6% year over year in the fourth quarter of 2018. 

On the other side, Amazon saw its operating margin improve from 3.2% in the fourth quarter of 2017 to 5.2% in the most recent quarter, as the more profitable and faster-growing AWS business now makes up 11% of total revenue. 

Overall, I think Amazon is in a stronger position right now. After more than 20 years of dazzling investors with huge returns, Amazon continues to find areas to disrupt, and it looks like the digital ad duopoly of Facebook and Google could be in the online retailer's crosshairs.

Check out the latest earnings call transcripts for Amazon and Facebook.

Growth expectations

Facebook has grown revenue faster than Amazon, but Amazon has impressed investors with its recent surge in profitability. Here's a look at both companies' change in revenue since 2014:

Company 2014 Revenue 2018 Revenue % Change $88.9 billion $232.9 billion 162%
Facebook $12.5 billion $55.8 billion 348%

Data source: Company financial filings. 

And here's a look at the companies' growth in operating income:

Company 2014 Operating Income 2018 Operating Income % Change $178 million $12.4 billion 6,878%
Facebook $4.9 billion  $24.9 billion 399%

Data source: Company financial filings.

While Amazon's fourth-quarter revenue growth of 20% year over year was lower than Facebook's 30%, analysts expect Amazon to grow earnings faster than Facebook. The current estimates call for Amazon's earnings to increase by 44% per year over the next five years, while analysts expect Facebook's earnings to grow by 16% annually. 

The higher expectations for Amazon's earnings growth is reflected in the stock's relatively higher price-to-earnings (P/E) ratio of 85 compared to Facebook's P/E of 22. Amazon stock has historically traded at very high earnings multiples, at least in the years when the company has actually reported a profit. But investors have been willing to give the company credit for its soaring revenue growth and its ability to generate healthy levels of free cash flow. 

Which is the better buy?

Amazon's revenue growth may cool off over the next decade, which wouldn't be surprising given it's a massive company with $233 billion in annual sales. But with higher-margin businesses, including AWS and potentially advertising, starting to contribute more to Amazon's bottom line, the stock still looks like a good investment even as the company approaches a total market value of $1 trillion.

Amazon's free cash flow exploded last year to $19.4 billion, up from $8.3 billion in 2017. That gives the company ample ammunition to aggressively invest for international expansion. Overall, it highlights Amazon's competency to make money in different areas of commerce. By contrast, Facebook is mainly dependent on digital ad spending -- an area where Amazon is poised to take market share.

For these reasons, I believe Amazon is the better buy for investors today.