It's always hard to buy a stock that's trading at an all-time high. Nobody wants to pay top-dollar for shares only to find out that they couldn't have picked a worse time to invest.

Yet with so many of the top-performing stocks in the market, you simply can't wait for a big bargain opportunity to arise. If you're not willing to buy shares at or near all-time highs, then you might never get a chance to invest, and you'll miss out on a huge opportunity to boost your overall returns.

Rising bar graph with an arrow pointing up and the number 2021.

Image source: Getty Images.

Below, we'll reveal three well-known companies that just hit all-time highs. Even though their share prices have already risen sharply, each of them has more room for future growth -- and a strong track record of extraordinary business execution.

GOOGL Chart

GOOGL data by YCharts.

1. Alphabet

Alphabet (GOOGL 0.55%) (GOOG 0.74%) is a favorite among tech investors, largely because of the dominant position that its Google division has in online search and advertising. As one of the original FAANG stocks , Alphabet has seen its stock soar since its 2004 IPO.

Alphabet continues to retain its huge advantage in internet search, with recent states giving the tech giant a 92% share of web searches. In addition, Google's Android operating system has become the standard for the majority of smartphones across the globe, with only Apple's (AAPL 1.27%) iOS mounting any considerable challenge to Alphabet's supremacy.

Looking ahead, Alphabet has plenty of growth drivers. Google will continue to be a cash cow and should benefit from a recovery in the advertising market. Development in areas like artificial intelligence and autonomous vehicles is going well, and despite regulatory pressure, the business overall remains solid.

Perhaps best of all, even though Alphabet has risen to all-time highs, its stock performance has lagged that of other FAANG stocks. Even just catching up to the higher returns that Apple and others have generated would give Alphabet shareholders a nice payoff in 2021 and beyond.

JNJ Chart

JNJ data by YCharts.

2. Johnson & Johnson

Johnson & Johnson (JNJ -0.69%) is arguably the most important company in the healthcare industry. J&J's pharmaceutical division is the biggest part of the company, with plenty of ground-breaking treatments that have helped millions of patients around the world. It also has a large consumer-health segment that's responsible for well-known brands like Tylenol pain relievers and Band-Aid bandages. Johnson & Johnson's medical-device segment is also an industry leader.

Over the long run, pharmaceuticals have been the largest driver of growth, as new pipeline-candidate treatments have consistently gained approval to replace older treatments losing their patent protection. Yet much of the recent hype about J&J has come from its role in developing a coronavirus vaccine that could potentially become the first to provide protection from COVID-19 with a single dose.

Even conservative investors can appreciate Johnson & Johnson. It's the only stock on this list that pays a dividend, and with a yield of 2.5%, shareholders can count on ample income. Moreover, J&J's track record of dividend growth goes back for decades. Add all that up, and Johnson & Johnson makes a healthy choice for anyone's portfolio even at all-time highs.

MELI Chart

MELI data by YCharts.

3. MercadoLibre

Finally, MercadoLibre (MELI -1.79%) is the high-flyer among these three stocks recently. The Latin American e-commerce king has seen its stock nearly triple in the past year, and it's up 18% just since the beginning of 2021.

Even before the COVID-19 pandemic struck, MercadoLibre was a leader in the fast-growing e-commerce industry. Serving Brazil and other key Latin American nations, MercadoLibre's online marketplace was rapidly transforming the way people shop. Moreover, add-on services like the Mercado Pago payment network and the Mercado Envios shipping platform were gaining traction in their own right.

The challenges of the pandemic helped accelerate the movement toward internet-based shopping around the world, and MercadoLibre took advantage of the moment. Now that more and more people have come to see the convenience of online shopping, electronic payments, and the other important features available on the MercadoLibre platform, the sky's the limit for the stock to reflect the company's growing dominance of the region.

Don't be afraid

There's always a chance when you buy a stock at an all-time high that your timing will have turned out to be poor. However, in the long run, it's the strength of the underlying business that determines whether stock prices rise or fall. MercadoLibre, Johnson & Johnson, and Alphabet all have the staying power to deliver solid returns to investors over the long run.