Stock market crashes sometimes offer opportunities for long-term investors. I like to set aside a little bit of cash just in case a stock market crash gives me a chance to buy excellent stocks at bargain prices. 

In another step of preparation, I have picked two tech stocks to buy if a market crash causes them to sell at a discount. Meta Platforms (NASDAQ:FB) and Alphabet (NASDAQ:GOOGL) (NASDAQ:GOOG) are two excellent companies dominating the digital advertising landscape. Their stocks are already selling at reasonable prices; a crash could drop them to the territory of absolute bargains. 

A person on their laptop.

Image source: Getty Images.

Profits are snowballing at Meta Platforms 

Meta Platforms, otherwise known as Facebook, is the biggest social media company on the planet when measured by monthly active users. At 3.5 billion and growing, the company reaches almost half the people in the world, an enticing proposition for advertisers.

Its uniquely broad scale has allowed Meta's revenue and profits to snowball. Between 2015 and 2020, it expanded revenue from $18 billion to $86 billion. Meanwhile, operating profits grew from $6.2 billion to $32.7 billion. There are very few places an advertiser can reach such a large population of customers. And those marketing efforts are proving worthwhile, or else advertisers would not continue pouring billions of dollars into marketing on Facebook's family of apps.

To make the investment more attractive, Meta is trading at a price-to-earnings (P/E) ratio of 22.7. That's near the lower end of its historical average, and it has sold below this price only once in the last five years.

The search engine giant has no match

Alphabet is a similarly powerful advertising platform. The company dominates the market for internet search queries. If you're going to start a search for something online, chances are you begin with Google.

According to Statista, Google's share of the worldwide online search market was 86.6% as of September 2021. Although difficult to prove, that might be the most significant share any business has of any market.

As with Meta, that dominance has allowed Alphabet to grow revenue and profits to incredible size. From 2015 to 2020, it increased annual revenue from $75 billion to $182.5 billion. It did this while maintaining an operating profit margin of over 20% through those years. Many companies can increase sales by sacrificing profit margins; Alphabet grew sales by over $100 billion while sustaining profit margins.

The stock is not expensive, either. Trading at a P/E of 27.7, it's near the lower end of its historical average. Overall, Alphabet and Meta Platforms are excellent businesses dominating their fields. Their stocks are currently trading at fair valuations, but a crash could turn them into steals. They are two tech stocks I am buying in the next market crash for those reasons.

This article represents the opinion of the writer, who may disagree with the “official” recommendation position of a Motley Fool premium advisory service. We’re motley! Questioning an investing thesis -- even one of our own -- helps us all think critically about investing and make decisions that help us become smarter, happier, and richer.