The stock market may be volatile and unpredictable at times, but it's also a wealth-generating powerhouse. Long-term investing is one of the most effective ways to make money in the stock market. Even low-cost index funds can see substantial returns over time, and the longer you hold your investments, the more you stand to earn.

An S&P 500 exchange-traded fund (ETF) or index fund can be a fantastic option for many people. It's not only one of the safest investments out there, but it can also help you make a lot of money over decades. If you had invested $5,000 in an S&P 500-tracking fund 10 years ago, here's what it would be worth today.

Watching your money grow

Over the past decade, the S&P 500 has experienced both a phenomenal bull run, as well as significant volatility. The index is still down nearly 14% from its peak in January 2022 and has been in and out of bear market territory over the past year.

However, despite all of this turbulence, the S&P 500 is still up by more than 161% over the past 10 years. If you had invested $5,000 in April 2013, it would be worth just over $13,000 today.

^SPX Chart

^SPX data by YCharts.

While those are already substantial gains, keep in mind that 10 years isn't that long when it comes to the stock market.

If you had invested the same amount of money 20 years ago, it would be worth close to $22,500 today. By investing 30 years ago, you'd have more than $47,000 by now.

The simplest way to supercharge your savings

These calculations assume you're not making any additional contributions -- you're simply investing your initial $5,000 and then not touching that money for decades. While there's nothing wrong with that approach, you could earn exponentially more by investing even a little each month in addition to your initial contribution.

For example, say you invest $5,000 today in an S&P 500 index fund and will earn a 10% average annual return (which is in line with the index's historic average). Let's also say you're investing an additional $100 per month. Here's approximately how much you could accumulate over time:

Number of Years Total Savings
10 $32,000
20 $102,000
30 $285,000
40 $757,000

Source: Author's calculations via Investor.gov.

Time is your most valuable resource when it comes to building wealth in the stock market. The sooner you get started, the easier it will be to create a portfolio worth hundreds of thousands of dollars.

Is an S&P 500 index fund right for you?

An S&P 500 index fund or ETF is a smart option for those who want a low-maintenance investment that's also safe and reliable. The index has been around for many decades and has recovered from the most brutal recessions, bear markets, and crashes during that time. No matter what the future may hold, it's extremely likely an S&P 500 index fund will be able to rebound -- making it a great choice for those who are concerned about volatility.

It's also a well-diversified fund as it contains stocks from 500 of the largest and strongest companies across a wide variety of industries. You never need to worry about choosing stocks with an S&P 500 index fund, and it makes a fantastic "set it and forget it" investment.

Perhaps the biggest downside, though, is that it's impossible to beat the market. An S&P 500 index fund aims to follow the market, so it can't earn above-average returns. If beating the market is a goal of yours, you may be better off investing in individual stocks.

The stock market can be daunting at times, but it's also a powerful way to generate long-term wealth. While the S&P 500 index fund won't be right for everyone, it can be a strong investment for those looking for an effortless way to grow their savings over time.