Tech stocks have gotten off to a rough start this year. For instance, the tech-heavy Nasdaq Composite index is down 5% so far.

If this continues into full-blown correction territory, widely considered a 10% decline, investors can pick up certain tech stocks at good valuations. That's because a broad sell-off affects most stocks, even those of high-quality companies. Fortunately, these three companies have strong long-term earnings prospects, making them ideal candidates for buy-and-hold investors.

A person looking at a price chart heading down.

Image source: Getty Images.

1. Alphabet

Alphabet (GOOG 1.45%) (GOOGL 1.59%) is so much more than a search engine. Its products also include Android, Chrome, Google Maps, YouTube, and Google Cloud. In other words, very popular offerings that drive advertising revenue and user fees.

Fortunately, management continues to push the company forward, allowing it to evolve rather than grow stale like many other tech companies. For example, Alphabet continues to improve its search engine. Instead of typing a query into a simple search bar, users can now speak into multiple devices to find what they need. The company continues to look for ways to improve the function to make sure it returns appropriate and reliable information. Alphabet's search business continues to grow, including a 46% revenue increase in the first nine months of 2021 to $105.7 billion. There are also its YouTube ads and Google cloud offerings, which experienced 57% and 48% revenue growth to $20.2 billion and $13.7 billion, respectively.

These are part of the vision management laid out to become an artificial-intelligence-first company. A person can see how well its plans are working by looking at Alphabet's results, which have shown continued strong revenue and income growth. Excluding foreign-currency effects, its third-quarter revenue grew by 39% to $65.3 billion. And its operating income nearly doubled to $21 billion.

Advertising made up 82% of the quarterly revenue, and the outlook for digital ads remains strong. Google generates ads on its sites, including search plus other properties like Gmail and Google Maps. These involve paid clicks and impressions. YouTube has traditional advertising.

With a price-earnings ratio (P/E) of 27, the stock isn't as expensive as it was a few months ago when it was above 30. This also isn't much off of the S&P 500's P/E of 29. Considering Alphabet's strong growth prospects, the stock doesn't appear richly valued.

2. Microsoft

Microsoft (MSFT 1.64%) remains at the top of its game. Its three businesses, productivity and business processes (including Office and LinkedIn), intelligent cloud, and more personal computing (Windows, devices, and gaming, among other products), continue to do well.

And management continues to bolster Microsoft's strong market position. This includes acquiring Nuance Communications last year for $19.7 billion, strengthening its cloud offerings. In particular, the deal boosted Microsoft's offerings to the healthcare industry, which it only began providing in 2020. Nuance's products include speech-enabled artificial intelligence, helping reduce paperwork. This already uses Microsoft's Azure cloud platform, which is among its several other cloud services..

In the fiscal first quarter, which ended on Sept. 30, 2021, the intelligent cloud business experienced a 30.6% increase in revenue to nearly $17 billion. Overall, Microsoft's quarterly revenue grew by 20% after removing the effects of foreign currency translations, to $45.3 billion. This drove operating income 24% higher to $20.2 billion. Its operating margin expanded by 1.9 percentage points to 44.7%

Microsoft's P/E stands at 34, down from above 38 at the end of 2021. With all of the company's services and products showing significant growth on top of the new opportunities, any chance to get the stock at its relatively "lower" P/E could pay off.

3. Nvidia

Nvidia (NVDA 3.66%) makes graphics cards. In fact, it is one of the dominant companies in the space. This innocuous-sounding description doesn't do it justice, however. Its products allow devices like computers to have high-quality graphics. It has also been pushing into other popular areas. These include artificial intelligence, autonomous vehicles, augmented reality, and virtual reality.

The company is poised to continue meeting the strong demand for high-performance laptops used by game aficionados, including a new 30 series graphics card. Meanwhile, it also plans on releasing a lower-end product. The market typically welcomes Nvidia's releases, and it has been anxiously awaiting a less expensive offering.

Nvidia continues to operate on all cylinders. Its fiscal third-quarter revenue rose by 50% to $7.1 billion, and operating income increased by 91% to $2.7 billion. The company's operating margin was 37.6%, eight percentage points higher than a year ago.

Investing in tech stocks presents challenges in a fast-moving world. But these companies have proven staying power. Better still, with an eye to the future, each should continue staying relevant to its customers and continue driving revenue growth. While tech stocks have had a rough start to the year, these three will prove long-term winners, and investors should view any overall decline in the sector as a good opportunity to buy shares.