Investing in the stock market is a long-term strategy. It can take decades to see a substantial amount of growth, but it's still one of the most effective ways to generate wealth.

To be a successful investor, you don't need to be a stock market expert. In fact, by investing consistently and leaving your money alone for as long as possible, you can accumulate hundreds of thousands of dollars.

It's crucial to invest in the right places, however, to see these types of returns. And there's one type of investment that can take you from $0 to $400,000 if given enough time.

Four stacks of dollar bills

Image source: Getty Images.

Investing for the long term

When it comes to the stock market, there's no safe way to make a lot of money in a very short amount of time. Investing isn't a get-rich-quick scheme, and if any investment promises explosive returns overnight, you risk losing more than you gain.

Investing for the long term is a much safer strategy, and one of the best long-term investments available is the S&P 500 index fund. An index fund is a collection of stocks or bonds that mirrors a particular stock market index, such as the S&P 500.

S&P 500 index funds are generally safer than other types of investments because they follow the market as a whole. While this means your money is subject to short-term volatility, it also means that you're nearly guaranteed to see positive returns over the long run.

^SPX Chart

^SPX data by YCharts

Since its inception, the S&P 500 has earned an average rate of return of around 10% per year. Although it's impossible to predict future returns, because S&P 500 index funds mirror the index itself, your investments are likely to earn average returns of around 10% per year over time as well.

Say you're just starting your investing journey and are investing $200 per month (or around $7 per day) in S&P 500 index funds. Assuming you're earning a 10% annual rate of return, here's approximately how much you'd accumulate over time:

Number of Years Total Savings
5 $15,000
10 $38,000
20 $137,000
30 $395,000
40 $1,062,000

Data source: author's calculations.

If you have 30 years left to save, you could potentially accumulate nearly $400,000 by investing consistently. But the longer you leave your money alone, the more you can earn. Given enough time, you could build a portfolio worth $1 million or more.

Getting started

So you're ready to start investing in S&P 500 index funds. You have several options to choose from, and all are good choices:

  • iShares Core S&P 500 ETF (NYSEMKT:IVV): This fund has a rock-bottom expense ratio of just 0.03%, meaning that for every $10,000 you invest, you'll pay $3 per year in fees. It also has a long track record, as it was established in 2000.
  • SPDR S&P 500 ETF Trust (NYSEMKT:SPY): This fund also has a low expense ratio of just 0.03%, and it was created in 1993 -- making it one of the oldest ETFs in existence. It also has more than $345 billion in assets under management, which makes it one of the largest S&P 500 index funds.
  • Vanguard S&P 500 ETF (NYSEMKT:VOO): Like the other two funds, this one also has an expense ratio of 0.03%. Established in 2010, it's younger than the other funds. But Vanguard is a powerhouse in the industry, and this fund has just as much potential as the others.

All three of these funds track the S&P 500, so they contain the same stocks. You can't go wrong with any of them, so all three are great options whether you're an experienced investor or are just starting out in the investing world.

It's possible to make a lot of money in the stock market, but patience is key. By investing consistently and leaving your investments alone for as long as you can, you could potentially accumulate hundreds of thousands of dollars or more.

This article represents the opinion of the writer, who may disagree with the “official” recommendation position of a Motley Fool premium advisory service. We’re motley! Questioning an investing thesis -- even one of our own -- helps us all think critically about investing and make decisions that help us become smarter, happier, and richer.