A $1 million target is a great goal for your investment portfolio. If you reach that total by retirement, you'll have plenty of options by your side. For example, you could withdraw the money slowly for daily use. Additionally, you can invest some of it back in dividend stocks that generate a steady stream of cash to pad any retirement income you may have.

Knowing how much you need to invest and having realistic expectations is important, however. Ideally, you'll start investing as early as possible. But if you can't, you can make up for that lost time by saving more and investing more money in later years.

How much should you invest in the stock market to get to $1 million by retirement?

There are three variables to consider when investing in stocks: your average annual return, how much you invest, and the number of investing years you have left. If you assume you'll average a 10% return, which is the S&P 500's long-term average, then you can solve for the other variables. Assuming a retirement age of 65 years, here's a look at how much you would need to invest based on a 10% annual return.

Chart showing how much to invest to get to $1 million by retirement.

Chart by author.

By compounding your gains over time, a relatively modest investment of $13,719 at the age of 20 can grow to $1 million because it has 45 years' worth of compounding left. A 10% return for 45 years would mean your investment would grow to nearly 73 times its original size. But if you're investing at year 50 and only have 15 investing years left, then that same 10% annual return would only grow your investment to approximately 4.2 times its value.

Your returns could look better if you achieve a higher average growth rate, or worse if you end up averaging less than 10%. But if you're expecting an extremely high growth rate and that you'll be consistently beating the market for decades, that could set the bar a bit high and lead to disappointment later on.

A couple of ETFs for long-term investors to consider

Instead of trying to beat the S&P 500, you may want to consider simply trying to mirror it. The SPDR S&P 500 ETF Trust (SPY 0.95%) is an exchange-traded fund (ETF) that tracks the S&P 500 index. The benefit of doing so is that the fund takes all the guesswork out of investing. You don't need to invest in any other stocks because the ETF will give you exposure to different industries and all the major stocks. This includes Apple, Microsoft, and Amazon, which are the top three stocks in the index. You could simply invest every month into the fund knowing that your overall risk is limited.

If you want to try a more aggressive strategy, the Vanguard Growth Index Fund (VUG 1.82%) may be more appealing. The fund focuses on growth stocks, which can oftentimes offer investors better returns. The passively managed fund gives investors exposure to the top growth stocks. The top three stocks in the fund are the same as with SPY, but the percentage is different -- Apple, Microsoft, and Amazon account for 32% of VUG's holdings versus just 18% in the broader ETF. The VUG is also more tech heavy, with more than 53% of the fund dedicated to tech stocks, whereas with SPY the percentage is just 29%.

Over the past 10 years, the VUG has risen 230% while SPY's value has increased by 154%. But when looking at just the last three years, it's SPY that has a higher return (25% versus 21%). Ultimately, it depends on your outlook for growth stocks and whether you want a more diversified approach, or if you're comfortable with a tech-heavy investment. Either fund, however, could set you up for great long-term returns while providing you with some excellent diversification.

ETFs can make investing much simpler

If you have set aside money to invest in the stock market, you'll want to put that amount to work so as to generate healthy returns while ensuring the risk of making losses are minimized. And that's where ETFs can help. Rather than spreading out savings of $100,000 or more across 10-plus stocks and then having to track all of them, you can put that money into a diversified fund and help keep your money safe.

If you're confident in your stock-picking abilities, then buying stocks would be a better option. But for investors lacking the expertise in tracking individual stocks, opting for an ETF can make the process a whole lot easier.