Can you put your money in nothing but boring S&P 500 index funds and grow your retirement nest egg to seven figures? The short answer is yes.

While the performance of the S&P 500 can vary dramatically from year to year, it is surprisingly consistent over multidecade periods. Depending on the exact period you're looking at, the total return (including dividends) of the S&P 500 has historically averaged 9%-10% per year. For our purposes, we'll use the middle of this range -- 9.5% -- to keep things simple. If you're relatively young and buy a low-cost S&P 500 index fund like the Vanguard S&P 500 ETF (VOO -0.07%), it's reasonable to expect this type of return over time.

While a gain of 9.5% in a single year might not sound thrilling, consider this: If you were to invest $65,700 in a S&P 500 index fund and averaged a 9.5% return each year, you'd have a million-dollar investment value in 30 years.

Older couple dancing in the kitchen.

Image source: Getty Images.

How much should you invest to reach seven figures?

Obviously, not everybody reading this has more than $65,000 just sitting around to put into an S&P 500 index fund.

With that in mind, here's how much you should plan to invest monthly in S&P 500 index funds to retire a millionaire at age 65. If you're relatively young, it might be less than you think.

Your Current Age

How Much to Invest Each Month

25

$216

30

$379

35

$557

40

$913

45

$1,540

50

$2,729

Data source: Author's own calculations, using annual 9.5% compounding. Rounded to the nearest dollar.

If $1 million isn't your goal, you can adjust these higher or lower. For example, if your goal is a $2 million nest egg, simply double the monthly savings account.

Two big caveats

No investment that can produce wealth like this is without risk, and although the S&P 500 isn't exactly a "high-risk" investment on a long-term basis, there are a couple of things to keep in mind.

For starters, in a real-world portfolio, you probably wouldn't just invest in an S&P 500 index fund until you retire. As you get closer to retirement, your tolerance for big swings in your portfolio declines. Over the past 50 years, the S&P 500 has gained or lost as much as 37% in a single year -- if you're 65, do you really want your savings to fluctuate that much?

So, as you get closer to retirement, you'll probably want to gradually shift some of your savings into lower-volatility (but lower-return) investments like bonds and CDs. You can read our primer on asset allocation to get a better sense of how this works.

It's also important to mention inflation, especially because it's running relatively high right now. In short, $1 million in 30 years isn't going to be the same thing as $1 million today.

However, the point is that it is certainly possible to retire a millionaire with S&P 500 index funds if you can stomach the volatility. If not, you might want to err on the side of caution and plan to invest a little extra each month to compensate for this gradual asset shift over time.

Warren Buffett's favorite investment

Billionaire investor Warren Buffett is widely considered one of the best stock-pickers of all time but has said that low-cost index fund investing -- and an S&P 500 index fund in particular -- is the best way to invest for the majority of Americans. In fact, Buffett has even advised his own wife to invest her inheritance this way after he's gone.

In a nutshell, while we wholeheartedly believe it's possible to beat the market with individual stocks, the reality is that many people don't have the time, knowledge, or desire to research and select stocks properly. And that's OK. As Buffett says, "It is not necessary to do extraordinary things to get extraordinary results."