Can you believe that 20 years ago, social media wasn't even a thing? When first-year students arrived at their college campus, there was a literal "face book," made of paper, with each student's name, headshot, and dorm number on it.

Mark Zuckerberg and Facebook (META 0.43%) have changed all that. And the movement has spawned tons of rivals in its wake. Foremost among those is Twitter (TWTR), which -- thanks to constant communications from the White House -- seems to be in the news every day. Both technology stocks are favored by growth-minded investors.

A hand holding up a smartphone showing several social media icons

Image source: Getty Images

Between these two giants, which is the better buy today?

While we can't know with 100% certainty, we can dig deeper for a better idea. Let's compare these companies in three vital areas.

Financial fortitude

The only thing I want to know when looking at a company's financial statements is this: Would it be hurt over the long run by a recession...or could it actually be helped by one?

How can a company be helped by a recession?

Those with lots of cash on hand, little debt, and strong cash flows can take advantage of others' misfortune during a downturn. They can buy back their own stock at depressed prices, acquire agile start-ups, or simply lower their prices so much that the competition is driven out of business.

Keeping in mind that Facebook is valued at almost 17 times the size of Twitter, here's how the two stack up.

Company Cash Debt Free Cash Flow
Facebook $48.6 billion $0 $18.0 billion
Twitter $6.7 billion $1.8 billion $1.1 billion

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

Both of these companies have strong financials. But if forced to choose, the scales are decidedly tipped in Facebook's favor. Not only does the company not have any long-term debt to speak of, but even after increased spending on platform safety, it is raking in $18 billion in free cash flow.

Winner = Facebook

Valuation

Next we have to take a look at how cheap or expensive these stocks are, relative to each other. There's no one metric to help us here. Instead, it's best to consult a number of different data points to build out a more complete picture.

Company P/E P/FCF P/S PEG Ratio
Facebook 30 28 8.0 1.3
Twitter 16 30 9.5 1.5

Data source: Yahoo! Finance, E*Trade. Non-GAAP earnings used for P/E when applicable. P/S = price to sales ratio. PEG = Price to earnings growth.

Here I would call it a tie. While Twitter's price-to-earnings (P/E) ratio appears smaller, this has more to do with accounting practices than actual free cash flow (FCF). On the rest of the metrics, these two are close enough that I'm willing to say the differences are negligible.

Winner = Tie

Sustainable competitive advantages

The final comparison is the most important. A sustainable competitive advantage -- or "moat" -- is the most important thing for any investor to evaluate. In its simplest form, a moat is what protects a company from competition coming in and stealing away business.

These two companies have very similar business models. They both benefit from two primary moats: brand value and the network effect. As they collect more users, each company takes the data and the time users spend on the site and offers up ads for businesses to create sales.

A company's brand is what draws users into its ecosystem. The more you hear about Facebook (or its subsidiaries: WhatsApp and Instagram) or Twitter, the more likely you are to join the service.

But when it comes to leading brands, there's a clear winner. According to Forbes, Facebook owns the fifth most-valuable brand in the world, worth nearly $50 billion. Twitter, on the other hand, doesn't crack the Top 100.

And then there's the network effect. The way this works is that each additional user of a service makes the overall service that much more valuable. This makes sense: What's the point of joining either social network if the people you want to connect with aren't already on it?

Again, we have a clear winner. Facebook owns not one, but two of the most popular sites in Facebook and Instagram. Even though its users total 2.7 billion people globally, the company has still been able to increase its daily active users by 8%. Twitter -- working off a much smaller base of 139 million -- grew "monetizable daily active users" by 14%. Given the enormous size difference between their bases, Twitter's growth would have to be much stronger to beat Facebook.

Winner = Facebook

And my winner is...

So there you have it: While both are relatively close in valuation, Facebook has a better financial position and a wider moat. If you had to pick one, I would go with Facebook.

That being said, I own shares of both companies. Combined, they represent roughly 8% of my real-life holdings. They are both worth considering. But when deciding how much to allocate to each, remember the results from above.