Tech giant Microsoft (NASDAQ:MSFT) is primarily known for its ubiquitous Office productivity software, Windows operating system, and Explorer internet browser, while Amazon's (NASDAQ:AMZN) claim to fame is its dominant e-commerce business. Each company has invested in other areas of significant growth, like cloud computing.

The debut of Amazon Web Services (AWS) in late 2006 ushered in an era of digital transformation that continues today. While the two companies compete head-to-head in the cloud migration that is still ongoing, when deciding to invest in one of these companies you must look beyond this one area of competition, and assess the overall health and strength of each business. Let's take a look to see which is a better buy now.

Runners crossing the finish line.

Image source: Getty Images.

Financial fortitude

While both Microsoft and Amazon are extremely successful at what they do, the proof, as they say, is in the pudding. Let's review a number of financial metrics to see how they compare.

Metric

Amazon

Microsoft

Revenue (TTM)

$208.13 billion

$110.36 billion

EBITDA (TTM)

$21.66 billion

$49.47 billion

Net income (TTM)

$6.28 billion

$16.57 billion

Operating cash flow (TTM)

$21.86 billion

$43.88 billion

Free cash flow (TTM)

$8.83 billion

$32.25 billion

Cash and short-term investments

$27.05 billion

$133.77 billion

Long-term debt

$24.74 billion

$76.24 billion

Data source: YCharts and company financial reports. TTM = Trailing 12 months.

While Amazon has produced nearly twice as much revenue over the preceding 12 months, Microsoft has a rock solid balance sheet, has moved much more of its revenue to the bottom line, and produced much greater free cash flow. It's important to note that Amazon is investing heavily in growth, but for now, Microsoft has the edge in terms of financial fortitude.

Advantage: Microsoft.

Growth 

While Amazon and Microsoft have both generated impressive growth, the comparison is particularly lopsided, as Amazon's growth has accelerated in recent years.

AMZN Revenue (TTM) Chart

Data by YCharts.

That dominance is expected to continue, as analysts expect Amazon's earnings per share to grow 46% annually over the coming five years, compared to just 12% for Microsoft. That isn't all that surprising, considering Amazon continues to gain e-commerce market share both domestically and around the globe, and AWS remains the dominant cloud provider.

Advantage: Amazon.

Valuation

Any better-buy scenario would be remiss if it didn't include a review of valuation. Comparing several different widely used valuation metrics will give us a sense of which company might represent a better value. Here's a look through the lens of price-to-earnings (P/E) and price-to-free-cash-flow (P/FCF) ratios.

Metric

Amazon

Microsoft

Trailing P/E

152

52

Forward P/E

111

25

P/FCF

108

26

Data source: YCharts.

By every metric, Microsoft is significantly less expensive than Amazon. It's important to note that Amazon's higher multiples are a reflection of investors' lofty expectations that the company's impressive growth will continue, but for those shopping the bargain bin, Microsoft is clearly a better value.

Advantage: Microsoft.

Final tally

Based on the metrics reviewed here, Microsoft is a better buy.

Things aren't as cut-and-dry as they may seem, though. The overall trend toward e-commerce has only just begun. Online shopping currently accounting for 10% of global retail sales in 2017, but is expected to account for more than 17% of sales by 2021. Amazon will clearly benefit from that ongoing shift and might be a more appropriate choice for investors with a greater tolerance for risk looking for more potential for future rewards.

Microsoft is clearly the better value and therefore deserving of the title. The company even pays a dividend that currently sports a 1.5% yield, and provides a greater margin for safety for risk-averse investors. Ultimately, though, the choice investors make between these two stalwarts will likely be determined by their personal investing style and aversion to risk.

John Mackey, CEO of Whole Foods Market, an Amazon subsidiary, is a member of The Motley Fool's board of directors. Teresa Kersten is an employee of LinkedIn and is a member of The Motley Fool's board of directors. LinkedIn is owned by Microsoft. Danny Vena owns shares of Amazon. The Motley Fool owns shares of and recommends Amazon. The Motley Fool has a disclosure policy.