Imagine that you had bought $10,000 worth of Nike stock 20 years ago. Today, that investment would have grown to almost $160,000. Compare that with the S&P 500. A $10,000 investment there would still have grown, but only to $61,000. It goes to show that stock-picking works -- you just need to find the right stocks and give them time.

So, let's have a look at three stocks worth holding for a few decades to come.

One lit light bulb among a group of unlit ones.

Image source: Getty Images.

McDonald's

First up is the legendary fast-food giant McDonald's (MCD -0.91%). This company helps investors understand what's important when your time horizon is 20 years. Consider this: Shares of McDonald's have returned a staggering 1,860% over the last two decades, meaning an initial investment of $10,000 would have grown to more than $195,000 today.

Moreover, there's every reason to think McDonald's can keep growing over the next two decades. There are over 40,000 McDonald's locations worldwide, serving up coffee, shakes, fries, and, of course, cheeseburgers. And the company is still looking for ways to innovate and grow.

The company's fast-food empire generates a river of sales, profits, and cash flow. Over the last 12 months, McDonald's recorded $24 billion in revenue, $13 billion in gross profit, and $6 billion in free cash flow.

Those impressive figures allowed the company to pay out $6.08 per share in dividend income -- generating a dividend yield of 2.3%. Furthermore, McDonald's dividend is one of the best around, having increased every year dating back 47 years.

Granted, McDonald's has its challenges ahead. Rising labor costs, a potential recession, and changing customer tastes could all spell trouble for the company. However, McDonald's has shown resilience in the past, along with a unique ability to evolve.

Shopify

Next up is Shopify (SHOP 1.11%), a Canadian e-commerce platform that has only been a public company for eight years. While Shopify lacks a McDonald's long-term track record, it has something else valuable when investing: red-hot growth.

The company has most recently increased revenue by over 30% year over year as businesses flock to its online e-commerce platform. Shopify helps those businesses by building and optimizing online stores, managing promotions and discounts, and facilitating cross-border sales, among other tasks.

In its most recent quarter (ended June 30), Shopify's Merchant Solutions revenue jumped 35% to $1.3 billion as the company's gross merchandise volume (GMV) grew 17% to $55 billion. Shopify defines GMV as "the total dollar value of orders facilitated through the Shopify platform including certain apps and channels for which a revenue-sharing arrangement is in place in the period, net of refunds, and inclusive of shipping and handling, duty and value-added taxes."

In summary, Shopify's overall revenue is growing as its network of merchants becomes more successful at selling products through Shopify's platform. Over time, say several decades, Shopify should expect its revenue to grow by leaps and bounds as more merchants join and find success selling through its network.

That said, Shopify's rich valuation (its shares trade at a price-to-earnings multiple of 76) mean the stock isn't for every investor. What's more, an economic downturn could throw a damper on Shopify's rapid growth, which would certainly send its stock reeling.

Amazon

Finally, Amazon (AMZN 3.43%) has all the hallmarks of a stock investors should buy and hold for 20 years. Let's start with the company's vast size. Amazon's trailing-12-month revenue is already massive. With $538 billion in sales, it's second only to Walmart's $631 billion in terms of largest revenue from an American company.

The company's vast e-commerce empire is responsible for the bulk of that revenue, with online stores and third-party seller services making up the majority.

Sankey chart of Amazon's Q2 2023 income statement.

Image source: The Motley Fool.

There are, however, many other Amazon segments worth noting. Amazon Web Services, of course, is the company's fastest-growing unit and now makes up about 20% of the company's quarterly revenue. Similarly, Amazon's advertising segment is notable for its growth. Revenue within that area is surging by more than 22% year over year.

However, investors should be aware that its not all smooth sailing ahead for Amazon. The company has recently been sued by the Federal Trade Commission (FTC) over allegations of monopolistic practices. In addition, concerns over the company's dominance of the cloud services market has drawn attention from European regulators.

Nevertheless, Amazon remains well-equipped to fight in court. Lawsuits can be costly but that's the case for the governments that bring them, too. And it's part of the reason they're often settled out-of-court. All that said, growth-oriented investors should remain focused on Amazon. Its strong and diverse business units make it a name to consider holding for decades to come.