Microsoft (MSFT 0.37%) and Alphabet (GOOGL 0.55%) (GOOG 0.74%) are two of the most impressive businesses in the world today. These tech titans enjoy powerful competitive advantages that help them dominate massive global markets. In turn, they've seen their market value grow to a combined $1.6 trillion, creating vast wealth for their shareholders along the way.

But which is the better buy today? Let's find out.

Two rhinoceros with their horns pointing toward each other

Who will come out ahead in this battle of behemoths? Image source: Getty Images.

Moat

With eight products -- Search, Android, Gmail, Chrome, Google Maps, Google Drive, Google Play Store, and YouTube -- that each boasts more than 1 billion monthly active users, Alphabet's scale and reach is unrivaled, other than perhaps by Facebook. The company's Google internet search engine lies at the core of Alphabet's empire, growing ever more intelligent and valuable with each new query conducted on its ubiquitous websites and mobile apps. Google's dominant ad platform generates copious amounts of cash, which Alphabet then uses to further expand its ecosystem of products and services. In this way, Alphabet has built a wide economic moat -- one that seemingly gets stronger every day.

Like Alphabet, Microsoft enjoys powerful competitive advantages in many of its key markets. The software giant dominates the business productivity segment with its Office franchise, and Windows is still the most popular operating software on personal computers worldwide. Yet Microsoft plays second fiddle to Amazon.com (AMZN -1.64%) in what is perhaps its most important market: cloud computing. To be sure, Microsoft's Azure cloud platform is growing at a torrid rate and has even been gaining share on Amazon in recent quarters. But unlike Google, whose market share routinely checks in at around 90% of the global internet search industry, Microsoft's share of the cloud infrastructure market currently checks in at less than 20%. While that leaves plenty of room for growth for Microsoft, it also points to a less competitively advantaged position than that of Google in search. For this reason, I'd argue that Alphabet has a wider moat.

Advantage: Alphabet

Financial strength

Let's now review some key financial metrics to see how Microsoft and Alphabet compare.

Metric

Microsoft

Alphabet

Revenue

$118.46 billion 

$129.87 billion 

Operating cash flow

$46.13 billion

$45.25 billion

Free cash flow

$31.90 billion

$21.42 billion

Cash

$127.66 billion 

$109.14 billion 

Debt

$73.17 billion 

$4.01 billion 

Data sources: Morningstar, company filings.

Both Alphabet and Microsoft are financial powerhouses, with each generating more than $45 billion in annual operating cash flow. Yet I was tempted to give Microsoft the edge here because of its superior free cash flow generation, which is due in part to its lower capital expenditure requirements compared to Alphabet. But after looking at their balance sheets, it's clear that Alphabet currently has the advantage in terms of financial fortitude. Though Microsoft has $18 billion more in cash reserves, it also has nearly $70 billion more debt. That places its net cash position at about $55 billion, compared to more than $105 billion for Alphabet. So while Microsoft's financial strength is impressive, Alphabet's is even more remarkable.

Advantage: Alphabet

Growth

Alphabet is also growing at a faster clip. Wall Street expects the search king's earnings to rise by more than 16% annually over the next five years, fueled by the continued growth of digital advertising. Microsoft's profits, meanwhile, are forecast to increase by 14% annually during this same time, driven by its cloud computing initiatives.

A 2-percentage-point difference in annual growth rates isn't much, but it's enough to give Alphabet the edge here.

Advantage: Alphabet

Valuation

Finally, let's take a look at some stock valuation metrics, including price-to-free-cash-flow (P/FCF), price-to-earnings (P/E), and enterprise value-to-EBITDA (EV/EBITDA) ratios.

Metric

Microsoft

Alphabet (Class A Shares)

P/FCF

25.71 

36.53 

Forward P/E

21.38 

24.02 

EV/EBITDA

15.68 

16.79 

Data sources: Morningstar, Yahoo! Finance.

All three metrics suggest the same thing: Microsoft's stock is the better bargain. Whether on the basis of free cash flow or earnings, Microsoft's shares are significantly less expensive than Alphabet's. This is true even when we account for Alphabet's larger net cash position, as we do by comparing their enterprise value-to-EBITDA ratios. Thus, Microsoft's stock is more attractively priced.

Advantage: Microsoft

Check out the latest Microsoft and Alphabet earnings call transcripts.

The better buy is...

Microsoft and Alphabet are both elite enterprises that are well positioned to deliver market-beating gains to their shareholders in the coming years. But while Microsoft's stock may currently be cheaper, Alphabet's powerful competitive moat, superior balance sheet strength, and greater growth prospects make it the better long-term investment.