More than a year after it started rising from its bear-market lows, we can finally say the S&P 500 (^GSPC 1.02%) is in a bull market. It became official when the index reached a new all-time high on Jan. 19.

Some investors are concerned that perhaps the best time to buy has already passed. The S&P 500 is already up by 36% from its cyclical low in October 2022, and if you've been holding off on investing, you've missed out on those gains.

But what does history say about investing after the worst is over? Is it possible to wait too long? Or should you buy shares anyway even though prices have already risen?

Bull and bear facing each other.

Image source: Getty Images.

Is it too late to invest in the S&P 500?

It's easy to look back in hindsight and think about when you should have invested. If you'd invested in October 2022 when the S&P 500 was at its lowest point, today, your portfolio would reflect more than a year's worth of gains. But back then, there was no way to know that the next bull market was about to begin.

Similarly, there's no way to know now whether prices will continue increasing in the near term or take a turn for the worse. But if stocks do surge further and you're still keeping your investable money on the sidelines, you'll miss out on even more gains.

The good news is that historically, there's never necessarily a bad time to invest -- as long as you keep a long-term outlook.

For example, during the Great Recession, the S&P 500 bottomed out in March 2009. If you'd invested money in an S&P index fund at its lowest point that month, you'd have earned returns of more than 619% by today.

^SPX Chart

^SPX data by YCharts.

But say you waited a year and began investing in March 2010. In that case, you'd have seen returns of close to 327% by today.

^SPX Chart

^SPX data by YCharts.

Of course, that's a big difference. But if you had waited even longer -- say, March 2011 -- you'd only have experienced returns of 269% by today. In other words, the longer you waited to invest, the weaker your returns would have been.

^SPX Chart

^SPX data by YCharts.

Keep in mind, too, that even after the Great Recession ended, the market still experienced short-term declines. There will always be fluctuations even in good economic times, but if you're putting off investing until the perfect time to buy, you'll end up waiting forever.

While it can be daunting, often the best strategy is to simply invest consistently, adding money to your portfolio on a regular basis no matter what the market is doing. Nobody knows where the market is headed in the near term. If another slump is on the way, it's incredibly likely the S&P 500 will rebound from it sooner or later. But if you're waiting until the market is well into recovery mode to buy any shares, you'll end up missing out on valuable gains.

History has good news for the S&P 500

Ever since the S&P 500 index was devised, it has built an impeccable track record of earning positive returns over time. In fact, research shows it's actually harder to lose money with the S&P 500 than it is to make money if you keep a long-term outlook.

Analysts at Crestmont Research examined the S&P 500's historic performance to determine how often it was able to earn positive returns in a 20-year period. They studied the index's rolling 20-year total returns throughout its history and found that every single one of those periods ended in positive total returns.

This means that if you had invested in an S&P 500 tracking fund, like an S&P 500 index fund or ETF, at any point in history and held it for 20 years, you'd have earned positive total returns. While the index still experienced severe recessions and bear markets in some of those periods, it was still able to see positive gains over the long haul.

The right investment to get you started

If you're ready to get started investing in the S&P 500, a great way to do that is through an ETF that tracks the index. While there are countless to choose from, a few of the most popular include the Vanguard S&P 500 ETF (VOO 1.00%), iShares Core S&P 500 ETF (IVV 0.98%), and SPDR S&P 500 ETF Trust (SPY 0.95%).

All of these ETFs offer exposure to the S&P 500, containing the same stocks as the index and aiming to match its performance. They also all have low expense ratios compared to many other ETFs, which can save you thousands of dollars in fees over time.

Time is your most valuable asset when it comes to the stock market. By investing now and staying invested for as long as possible, you can rest easier knowing you're likely to see positive long-term returns -- no matter what happens in the coming weeks or months.