Better Buy: Microsoft Corporation vs. Amazon.com, Inc.

They are two of the strongest companies in the world. Before you go to bed each night, you've likely spent time using both Microsoft's (NASDAQ: MSFT) suite of technology products, and bought, received, or streamed content via Amazon.com (NASDAQ: AMZN).

An investment of $1,000 in Microsoft or Amazon back in 1997 would now be worth $8,000 or $540,000, respectively! While there's a big gap between the two, both are impressive returns.

But which is the better buy today? To be honest, you can't go wrong buying either one of these companies. If forced to choose, however, here are three different lenses through which you can evaluate the question and decide for yourself.

Image source: Getty Images

Sustainable competitive advantages

If you're going to choose to forgo the safe route of buying index funds and try your hand at investing in individual stocks, there's no variable you should spend more time focusing on than a company's sustainable competitive advantage. Often called a "moat" in investing circles, a company's sustainable competitive advantages are what keep customers coming back, year after year and decade after decade.

For Microsoft, the moat is pretty easy to define. The company owns some of the most widely used applications in the world, including the Microsoft Office Suite and Windows. While the company also has hardware products available and its Azure cloud competing service is growing rapidly, the moats provided by these offerings are much narrower.

Amazon, on the other hand, has a host of moats. First, the company's impressive network of fulfillment centers allows it to deliver packages quicker than anyone else. And it would cost billions in upfront investments for any company to come close to touching this. Second, the company's membership rolls in Amazon Prime -- while not publicly disclosed -- are likely over fifty million.

But perhaps most importantly, the company has begun to benefit from the network effect: as Prime membership grows, the number of third-party vendors using Amazon's fulfillment services is swelling. With each new Prime member, a vendor is incentivized to use Amazon's platform. And with each new vendor, a potential customer is incentivized to shop on Amazon. That creates a very powerful moat.

While I hardly think Microsoft is in trouble, I'm giving the edge here to Amazon.

Winner = Amazon

Financial Fortitude

It's great to see money returned to you every quarter in the form of dividends. It's even better to see cash being reinvested for exciting growth opportunities in the future. But at the end of the day, there's no substitute for boring old cash sitting in the bank.

That's because every company, at some time, will face economic difficulties. Those that face such times with cash in the bank have options: they can outspend rivals into oblivion, buy back shares on the cheap, or even make acquisitions.

Debt-heavy companies are in the opposite boat, forced to narrow their focus just to meet the demands of their creditors.

Here's how Amazon and Microsoft stack up in terms of financial fortitude.

Company

Cash

Debt

Net Income

Free Cash Flow

Microsoft

$132 billion

$59 billion

$16.8 billion

$27.5 billion

Amazon

$26 billion

$8 billion

$2.4 billion

$9.7 billion

Data source: Yahoo! Finance

As I said at the outset, these are two of the strongest companies in the world. That is reflected in their balance sheets. If I were forced to choose a winner here, however, Microsoft would take the crown. The company creates massive free cash flow from its core Windows and Office platforms, and it is one of only two companies left that have AAA credit ratings from Standard & Poor's.

Amazon's no slouch either. But CEO/Founder Jeff Bezos is (in)famous for playing the uber-long game -- reinvesting revenue into the business to further build an impenetrable moat around the company.

Winner = Microsoft.

Valuation

Finally, we have valuation. While this isn't an exact science, there are some straightforward metrics we can consult to give us an idea of how expensive each stock is.

Company

P/E

P/FCF

PEG Ratio

Dividend

FCF Payout

Microsoft

22

18

2.3

2.4%

42%

Amazon

176

40

2.9

N/A

N/A

Data source: Yahoo! Finance, E*Trade. P/E represents figures from non-GAAP earnings.

Given Bezos' aforementioned penchant for trading a dollar today for the potential of earning ten dollars tomorrow, Amazon looks very expensive. This has almost always been the case. And investors that have passed on Amazon because of it have paid the price in missed returns the whole time.

That being said, it's hard not to give the valuation edge to Microsoft. The company trades for a reasonable valuation, and it offers a solid and sustainable dividend.

Winner = Microsoft

And the winner is...Microsoft

So there you have it: While Amazon has a more impressive moat, Microsoft has both a better balance sheet and a more reasonable valuation. That being said, it would be disingenuous of me not to mention that Amazon is by far my largest personal holding, accounting for a whopping 19% of my family's real-life holdings.

That's not necessarily because we've invested a lot in the stock. Rather, it's because shares have appreciated by so much since we first bought shares back in 2010. That being said, this type of review encourages me to look further at making a purchase of Microsoft, which has a lot going for it as well.

10 stocks we like better than MicrosoftWhen investing geniuses David and Tom Gardner have a stock tip, it can pay to listen. After all, the newsletter they have run for over a decade, Motley Fool Stock Advisor, has tripled the market.*

David and Tom just revealed what they believe are the 10 best stocks for investors to buy right now... and Microsoft wasn't one of them! That's right -- they think these 10 stocks are even better buys.

Click here to learn about these picks!

*Stock Advisor returns as of February 6, 2017

Teresa Kersten is an employee of LinkedIn and is a member of The Motley Fool's Board of Directors. LinkedIn is owned by Microsoft. Brian Stoffel owns shares of Amazon. The Motley Fool owns shares of and recommends Amazon. The Motley Fool has a disclosure policy.