If a stock goes up roughly 19% per year for 18 years, it would go up about 20 times in value. On the first side of this equation, you have 19%, which looks like an ordinary number. On the other side you have an extraordinary 20-bagger, showing just how crucial the factor of time is when investing.

Finding a stock that can go up 19% in a given year is relatively easy. Finding a company that can sustain business success over nearly two decades is extremely difficult. For this reason, I'll stop short of guaranteeing any of the following stocks will achieve this feat. But I believe each of these five companies has the potential for longevity and the business fundamentals that can turn a $50,000 investment into $1 million by 2040.

An affluent younger person smiles while reading information on a computer.

Image source: Getty Images.

1. Latch

Property-technology company Latch (LTCH) is my highest-conviction stock to buy right now, and it's not even particularly close. Thanks to easy access to information, most great stocks are well known and understood. By contrast, Latch stock is dirt cheap because it's under-discovered and wildly misunderstood.

First, with a market capitalization below $800 million, Latch is a small-cap stock, and these are often passed over by the analyst community. But second, the company's financials look atrocious right now, which is why it's misunderstood.

Latch's primary product is a smart-lock hardware device that sells for less than what it costs to make. Needless to say, with this financial structure, it's burning through cash at an alarming rate: Cash from operations through the first three quarters of 2021 is negative $64 million.

Fortunately, Latch has plenty of cash on hand: $240 million as of the end of the third quarter of 2021, which is almost one-third of its market cap. So it's not in danger of running out of funds soon. Moreover, Latch is selling smart locks at a loss because it then charges for an ongoing operating-system software subscription, which comes with gross profit margins of around 90%.

Software subscriptions are picking up, so Latch believes it will be free-cash-flow (FCF) positive in 2023. With that date quickly approaching, I believe investors will soon realize how this company's financial structure is evolving for the better. And once the market catches on to its potential, it could cause the stock to break out.

Here's why I believe Latch will still be around and thriving in 2040: The company was brought public by Tishman Speyer, one of the biggest commercial real estate companies in the world. It uses Latch and wants to help it go global. Additionally, the company recently partnered with the Empire State Building, a top-caliber partner that's part of the Empire State Realty Trust. With customers like these, Latch is far more than a scrappy start-up. It's clearly recognized as a leader, making me comfortable with its long-term prospects.

2. The Trade Desk

Advertising technology company The Trade Desk (TTD -0.54%) is riding a massive global trend: Advertisers are switching from traditional channels to digital media because they get better results.

Consider that The Trade Desk's gross customer retention has been over 95% for eight consecutive years, including 2021 -- once you make the switch to digital ads, you don't want to go back. Moreover, the top 25 advertisers that use The Trade Desk's services increased their spending by 50% in 2021 compared to 2020, suggesting the company does a great job of delivering value for its customers. 

There are other ways to invest in the growth of digital advertising. For example, whereas The Trade Desk partners with advertisers on the buy-side of the equation, companies like Magnite and PubMatic partner with publishers on the sell-side. I like both Magnite and PubMatic, but if I had to pick only one of these three being around in 2040, I'd pick The Trade Desk.

The reason is simple: There are more potential advertiser customers than publishers, meaning The Trade Desk isn't exposed to concentration risk; Magnite and PubMatic are. At the end of the third quarter of 2021, PubMatic's largest customer accounted for 17% of its revenue. Likewise, Magnite's top two customers accounted for 33% of its revenue at the end of 2020. An update is forthcoming with its next financial report. 

Many investors recognize The Trade Desk's excellence but are worried about the future. Alphabet's Google is changing the third-party cookie and threatening to make digital ads less effective in general. However, it's possible investors are overestimating Google's significance to The Trade Desk. It's been rolling out new products to reduce its reliance on Google.

For example, it just launched its OpenPath product, which gives advertisers direct access to publisher ad inventory. The product allows The Trade Desk to stop using Google's Open Bidding product. In short, the company seems prepared to move forward without Google.

In 2021, The Trade Desk processed just over $6 billion in advertising volume, whereas it estimates the market opportunity at $1 trillion. At less than 1% penetration, this market leader has room to be a 20-bagger over the long haul.

3. Unity Software

For those who don't already know, Unity Software (U -1.06%) is the leader in 3D-image design. It estimates it has over half of the 3D image-creation space. This is only a fraction of the overall digital design market. But with growing applications in video games, the metaverse, and even manufacturing via the creation of digital twins, it's likely 3D image design will be a fast-growing space for years to come, if not decades.

For 2021, Unity generated $1.1 billion in revenue, which was up 43% year over year. Revenue growth in 2022 is expected to remain stellar at 35%. And this revenue comes with a very high gross profit margin of 78% and 77% in 2020 and 2021, respectively. 

I don't think investors need to wonder about whether this industry will grow substantially from now until 2040. The question is whether Unity will maintain its leadership position.

I believe it will keep its top-dog spot. For starters, it didn't get to the top spot by accident; its software is very good at what it does and highly desired among users. And the company astutely offers its software for free for those starting out, charging once customers hit certain thresholds. This ties Unity's success to that of its customers and lowers the barrier to gaining new users. This should keep the company at the top.

And if Unity can gain and retain customers, it can offer more and more services over time. This is indeed what is already happening. In the fourth quarter of 2021, Unity had a net-dollar expansion rate of 140%. In other words, customers from the fourth quarter of 2020 spent 40% more on average this year compared to last year. 

Therefore, Unity's industry is poised to grow, the company is poised to keep (or even gain) market share, and existing customers should spend more over time. For these reasons, this is the kind of stock that can create wealth over decades.

4. Zoom Video Communications

When Zoom Video Communications (ZM -0.99%) filed papers with the Securities and Exchange Commission to go public in 2019, it used the words "happy" and "happiness" a combined 53 times. That wasn't an accident; the company is intentionally building what it calls a "culture of happiness."

Many companies talk about having a strong corporate culture, but Zoom really makes it a major point of emphasis. It starts with employee happiness, where the company appears to be excelling based on its strong reviews on third-party site Glassdoor. And this has allowed the company to attract top talent during this hypergrowth phase of its business.

When Zoom went public, it had about 1,700 employees. Now, two years later, it has surpassed 4,400. If its strong culture allowed it to attract and retain the best of the best, I feel good about its chances for shareholder-value creation in the coming years.

Back to the topic at hand, you might be surprised to learn Zoom's market opportunity could actually be big enough for it to grow 20 times in value. It cites third-party research suggesting it will have an addressable market of $91 billion by 2025. For perspective, it's on pace for roughly $4 billion in revenue for its fiscal 2022, providing plenty of upside.

Consider how much Zoom can still grow among deep-pocketed customers. For example, the Forbes Global 2000 is a list of the 2,000 largest companies in the world. Only 36% of these were spending more than $10,000 annually with Zoom as of the second quarter of its fiscal 2022. Only 5% were spending over $1 million. These clients can increase spending through the new products Zoom is rolling out, to say nothing of winning new customers.

Finally, remember that Zoom's revenue is high margin and throws off a lot of FCF. Through the first three quarters of its fiscal 2022, it has generated almost $1.3 billion in FCF and has roughly $5.4 billion in cash and marketable securities. That's a lot of firepower for a company with a market cap of $38 billion and could provide optionality for growth in ways we can't envision right now.

A laptop displays a sticker of the Coinbase logo in an office setting.

Image source: Coinbase Global.

5. Coinbase Global

This stock is probably the most speculative of the five, but cryptocurrency exchange Coinbase Global (COIN -0.34%) could go up 20 times in value over the next 18 years. The caveat here is that the cryptocurrency market is young and governments are still grappling with how to regulate it. However, barring outright bans by major global powers, Coinbase should be at the center of whatever cryptocurrency's future is.

Coinbase has 73 million registered users as of the third quarter of 2021. But only about 10% of these users are making monthly transactions. However, it generates the majority of its revenue from the trades these retail investors make. And trading activity has been decreasing lately.

This is why Coinbase stock has the cheapest valuation of the stocks mentioned here, with a price-to-sales (P/S) ratio of eight and a price-to-earnings (P/E) ratio of just 14. This downright cheap valuation reflects the market's doubt that the company can grow, given that its main revenue stream appears challenged.

But grow it can. Most of Coinbase's revenue comes from trading, yes. But it's quickly building out different long-term revenue streams. One promising source is by offering custodial services to corporations, something that could grow in importance as businesses diversify their balance sheets into cryptocurrencies. Coinbase will also soon launch a marketplace for non-fungible tokens (NFTs), a corner of the market experiencing mind-bending growth.

Coinbase is expanding globally, constantly supporting trading for new cryptocurrencies, providing crypto services to businesses, and developing new revenue streams. Considering it's a leader in this growing space, has a solid financial position of $6.4 billion in cash, and trades at a cheap valuation, this stock has a real chance of being a 20-bagger by 2040.

Enjoy the million-dollar journey

While I can't guarantee it, I do believe Latch, The Trade Desk, Unity Software, Zoom Video Communications, and Coinbase Global all have what it takes to turn $50,000 into $1 million by 2040. But don't forget to invest Foolishly if you do decide to take a chance on these stocks. And investing Foolishly includes holding through market volatility.

We're currently experiencing a lot of volatility in the market. But we will undoubtedly experience much, much more at some point over the next 18 years. However, as long as these companies are executing on their business plans, you should hang on and enjoy the ride.