Last year was one of the worst for the S&P 500 index, which is considered the benchmark that best represents the state of the overall market. It is also the benchmark that is used by many exchange-traded funds (ETFs), like the first and largest ETF, the SPDR S&P 500 ETF (SPY 0.35%).

The S&P 500 finished the year down 19.4%, which is just shy of bear market territory. But it did spend several weeks actually in bear market territory, down as much as 24% in October of last year. It was the worst year for the index since the market crash of 2008.

2023 has started out a little better for the S&P 500, with it notching a 7% gain as of Feb. 7. But is the worst over, and is it safe to invest in the index right now?

The S&P 500 has returned nearly 10% annually historically

The most important thing to know about the S&P 500 is that, over time, it has returned about 10% annually on a total return basis since its modern configuration in 1957. The gray lines in the chart below indicate recessions, so you can see there have been more than 10 over that period. 

^SPX Chart

^SPX data by YCharts

The index actually goes back even farther to 1928, but it didn't have 500 stocks in those days. But even stretching back that far, which includes the Depression, the annual total return, with reinvested dividends, has been about 9.8%.

So, the volatility we saw last year, and may see again this year, is nothing to be too concerned about, as the index has generated solid returns over time. In fact, for every bear market and correction, there have been more -- and longer -- bull markets. A recent analysis by Hartford Funds showed that while the average bear market lasts around 289 days, the average bull market last about 991 days -- almost three years. It also revealed that stocks lost about 36% on average in the typical bear market but gained 114% in the average bear market.

A person looking at a stock chart on a tablet.

Image source: Getty Images.

In addition, their research shows that roughly 34% of the stock market's best days came within the first two months of a bull market. Of course, it is impossible to know at the time when a bull market starts -- we may even be at the beginning of one now -- so it is important to remain invested.

The time is right

One metric to keep an eye on with respect to the S&P 500 is the price-to-earnings (P/E) ratio. The average P/E ratio for the S&P 500 since 1980 is about 21. Right now, the P/E ratio of the S&P 500 is about 22, which is at the high end of its historic range. It has gradually declined from a high of 38 at the start of 2021.

But the cyclically adjusted P/E ratio, also known as the Shiller P/E ratio, is still a bit high at 30. This is often considered a more accurate gauge as it is based on an inflation-adjusted 10-year earnings snapshot, which serves to limit the impact of short-term volatility. It has come down from a high of 38 at the end of 2021, but its range throughout much of the 2000s and 2010s was generally between 20 and 28, so it may indicate that the S&P 500 is still overvalued.

Thus, an overvalued S&P 500 is often an indicator that we could still see a drop in 2023. Maybe not a bear market, which is a 20% fall, but perhaps something in correction territory, which is a 10% or more decline.

All that said, the S&P 500 has been the smartest investment one can make over the past 65 years, so it really is never a bad time to invest in the S&P 500. While we could still see it decline this year, the gains, as they have done historically, should more than outweigh the losses.