In this article, two of the world's top technology companies face off. Alphabet (GOOG 9.43%) (GOOGL 9.71%) -- better known by its popular subsidiary, Google -- dominates search and advertising throughout the world. Alibaba (BABA 0.90%) is one of the leading e-tailers in all of Asia, particularly in China.

Both of these companies have been solid investments, each doubling over the past five years -- while the broader market is up 44% in the same time frame. But between the two, which is a better buy today?

Yellow arrow splitting and pointing in two directions

Image source: Getty Images.

Obviously, I can offer no guarantees. But if we compare these companies on three important criteria, we can get a better idea which one you might be more comfortable putting your money behind today.

Financial fortitude

Financial fortitude means that when a crisis hits, you not only survive, but you can grow stronger. If you have lots of cash and strong cash flows when all of your competitors are struggling during a recession, you can grow stronger in the long run. This can take many forms: acquiring distressed rivals, grabbing market share with lower prices, or simply buying back your own shares.

Keeping in mind that Alphabet is valued 80% higher (by market cap) than Alibaba, here's how the two stack up.

Company Cash Debt Free Cash Flow
Alphabet $123 billion $4 billion $23 billion
Alibaba $64 billion $17 billion $12 billion

Data source: Yahoo! Finance. Cash includes long and short-term investments. Free cash flow presented on trailing 12-month basis.

One thing is clear: Both companies have very healthy balance sheets. While I'm going to give my nod to Alphabet here -- the company has far more flexibility in a downturn given its $120 billion net cash position -- don't take it as a serious knock against Alibaba. It, too, would fare well given its war chest and healthy cash flows.

Winner = Alphabet

Valuation

Next we have valuation. It can be very tricky to try to pin down which stock is "cheaper" or "more expensive." As such, I like to use a wide range of metrics to build a more accurate picture.

Company P/E P/FCF P/S PEG Ratio
Alphabet 28 37 6.3 1.9
Alibaba 35 39 9.4 1.0

Data source: Yahoo! Finance, E*Trade, Gurufocus.com. 

Neither one of these companies is in "screaming buy" territory, but neither looks abjectly expensive, either. Alphabet's price appears cheaper on the basis of earnings, free cash flow, and sales. But when we consider growth prospects, Alibaba actually appears to be trading at a significant discount compared with Alphabet.

Given the lack of a clear indication as to which is cheaper -- and the fact that the earnings and free cash flow ratios are so close -- I'm calling this one a draw.

Winner = Tie

Sustainable competitive advantages

Finally, we have what I consider to be the most important aspect of an investment: the sustainable competitive advantages -- otherwise known as a moat.

Alphabet benefits from several moats, but low-cost production is foremost among them. "What does the company produce at such low cost?" you might ask. The answer: data. Google has eight different products with over 1 billion active users (search, GMail, maps, Chrome, Android, YouTube, Play Store, and Drive). Most of those products are free to use and require little investment once they become that popular. Google can turn around and offer that data to advertisers that want placement in front of the right eyeballs at the right time.

It's true that Amazon.com has recently started eating into Google's advertising growth, but it isn't a major concern yet. It is, however, something that investors should continue to monitor.

The company also benefits from some secondary moats. Google's brand, for instance, is rated as the second-most-valuable in the world by Forbes, at over $130 billion. It also benefits from moderate switching costs, as those who have their Android devices synced with their Google Drive might think twice about a competing product. 

Alibaba's chief advantage, on the other hand, is the network effect. The company's Taobao marketplace connects buyers and sellers at scale. If you want to buy or sell something from your home, Taobao is the place to go. 

That advantage, however, is somewhat under threat as rival JD.com has stepped in and offered direct-to-consumer (instead of consumer-to-consumer) options that eliminate the need to worry about product quality. JD also has an extensive fulfillment and delivery network to guarantee fast delivery.

Alibaba has countered by building out its own Cainiao fulfillment network. It also is protected by network effects that came from its payment option (AliPay) and high switching costs from its cloud services.

Adding these things together, I'd argue that this would normally be a tie. However, I've learned the hard way that investing in China can be riskier than it might seem, and will give Alphabet the slight edge thanks to this.

Winner = Alphabet

And my winner is...

So there you have it. While it was a close battle between two fairly valued stocks, Alphabet came out ahead. The company's balance sheet gives it more flexibility in times of crisis, and -- as far as I'm concerned -- its global presence outside of China gives it a slightly wider moat.