Investing is a long game, and the earlier you start, the more likely it is that you'll come out with some great profits. And through the effects of compounding, you also don't need to have a fortune ready to invest in order to build up some impressive gains.

If you can afford to invest $10,000 in the stock market and keep that money there for 25 years, it could end up being worth more than $600,000 -- without your having to do much except wait. Here's a look at how that could happen.

Investing in growth has paid off in droves

If you're investing for the long haul, then growth stocks can be incredibly attractive as they have the potential to rise significantly in value over time.

A good example is the Nasdaq Composite's performance over the past decade. This index is home to many of the top growth stocks in the world. In 10 years, the Nasdaq Composite has amassed a total return (which include dividends) of 302%. That averages out to a compound annual growth rate (CAGR) of 14.9%.

But suppose you wanted to focus on just the best of the best. Specifically, the top 100 stocks on the Nasdaq. You can gain exposure to these stocks by investing in an exchange-traded fund (ETF) called the Invesco QQQ Trust (QQQ 1.54%). This tracks the top 100 largest non-financial stocks on the Nasdaq. It includes such big names as Apple, Tesla, and Costco Wholesale.

While tech makes up the majority of its holdings, investors also gain exposure to other sectors, including consumer discretionary, healthcare, and telecom. Over the past decade, QQQ has generated total returns of 413%, for a CAGR of nearly 18%.

What $10,000 in QQQ could be worth in the future

Given its heavy exposure to tech and growth stocks in general, there will inevitably be fluctuations in the QQQ -- and years when it doesn't perform well. But in the long run, it can give investors a way to generate some potentially life-changing returns.

Suppose, for example, that over a period of 25 years it would continue to average an annual growth rate of 18%. That means that a $10,000 investment would eventually grow to a value of more than $626,000. Below is a breakdown of what the returns would look at slightly lower growth rates.

Growth Rate Investment Value After 25 Years
17% $506,578
16% $408,742
15% $329,190
14% $264,619
13% $212,305

Calculations by author.

Even if you aren't of sure what long-run growth rate the fund will average, you can see that even at a 13% growth rate you could have a 20-bagger investment if you hold on for a 25-year period. And the more that you're able to invest, the greater your investment can be worth in the future.

The Nasdaq-100 is a great index to be in

If you don't have $10,000 to invest right now, putting smaller amounts in the Invesco QQQ Trust can still be a great option for long-term investors. Since the ETF takes the guesswork out of picking growth stocks, you don't need to worry about which stocks are doing well or which ones are the best buys right now. Instead, it can act as a savings account for you, as a place to put money into on a regular basis. By doing so, you can generate significant long-term gains.

Investors who may need to withdraw their money in the near future (e.g., within five years) may not want to invest in the fund given the potential volatility that growth stocks can exhibit in the short term. But if your focus is on the very long term (25 years or more), then the fund can make for a great place to invest, either with a large lump sum today or with continued investments over time.