Alphabet (GOOG 0.60%) (GOOGL 0.71%) and Amazon.com (AMZN 0.27%) knew exactly how to fire up investors earlier this year. Both tech giants announced 20-for-1 stock splits a few months ago -- Alphabet in February and Amazon in March. And both stocks jumped after the news.

Amazon's stock split will happen first, with trading on a split-adjusted basis expected to begin on June 6, 2022. Alphabet's stock split should be done soon afterward on July 15. But which stock is the better buy ahead of its stock split?

A smiling person looking at a laptop.

Image source: Getty Images.

Several similarities

We should first acknowledge several similarities between Alphabet and Amazon. For one thing, their respective stock splits won't really change anything about the underlying value of the companies. However, the splits could (and I'd argue probably will) attract more retail investors to both stocks.

Alphabet and Amazon are indisputable leaders in their respective core markets. No one can touch Alphabet's Google search apps -- even though several have tried. Amazon is without question the 800-pound gorilla in e-commerce.

The two companies are also alike in that they compete in some of the same markets. Although Amazon is the top player in the cloud hosting market, Alphabet's Google Cloud has gained significant traction. And while Google is No. 1 in online advertising, it's a fast-growing business for Amazon.

Their success stories have attracted rivals, though. Alphabet's YouTube faces stiff competition from TikTok. Shopify has emerged as a potential threat to Amazon's dominance in e-commerce.

Both stocks have also fallen quite a bit so far in 2022. Alphabet's shares are down around 20% year to date. Overall market headwinds combined with mixed first-quarter results weighed on the stock.

Amazon's shares have plunged even more and are now nearly 30% year to date. The stock was especially hit hard after Amazon reported disappointing Q1 results in April.

Differentiators

While Alphabet and Amazon are similar in several respects, there are also a few key differentiators between the two companies and their stocks. I'd put valuation near the top of that list.

Alphabet's shares trade at 20 times expected earnings. That's a cheap valuation for the stock compared to historical levels. Amazon's shares look much more expensive with shares trading at 42 times expected earnings. However, it's important to note that earnings-based metrics haven't been as helpful in valuing Amazon in the past because the company invests so heavily in its business.

One of these companies is also clearly growing faster than the other. Alphabet reported Q1 revenue soared 23% year over year in the first quarter of 2022. Amazon's Q1 revenue increased by only 7%. Wall Street expects that Alphabet will deliver stronger revenue growth than Amazon in full-year 2022 as well.

Both Alphabet and Amazon could face headwinds if the economy enters a recession. But Amazon already has an issue of overcapacity. CFO Brian Olsavsky said in Amazon's Q1 conference call that the effects of the excess capacity could "persist for the next several quarters."

Just Google it

Over the long term, I think that both Alphabet and Amazon will continue to be winners. Each of these companies has strong moats that should enable them to keep rivals from making huge inroads. They also each have major growth opportunities in new markets.

Alphabet is famous for its "other bets." I expect that its Waymo self-driving car unit will especially become a significant growth driver in the coming years. Amazon is also in the self-driving car business. However, my hunch is that the company's "Just Walk Out" technology that enables customers to buy products in stores with no check-out required could be an even bigger opportunity.

If I had to choose just one of these stocks ahead of its stock split, though, my pick would be Alphabet. Its valuation and near-term growth prospects are simply more attractive than Amazon's at this point. In the end, the answer is an easy one: Just Google it.