Quite frankly, investors got spoiled. From 2009 through 2020, we enjoyed the longest bull market in history. Sure, COVID-19 caused a steep sell-off. But stocks quickly rebounded. More retail investors began buying stocks than ever before.

Then the bottom fell out. The S&P 500 did something it's done only seven times since the index has existed by plunging 19.4%. Reality set in that the stock market doesn't always go up.

But it's also important to recognize that stocks go up more often than they go down. The S&P 500 is up 4% so far in 2023. Is it safe to invest in the stock market right now?

A person with crossed fingers looking at a laptop.

Image source: Getty Images.

Reasons to jump in

Let's start with some good news. There are several reasons to jump back into the stock market.

For one thing, history is on your side. In the six previous years that the S&P fell by 19.4% or more, the index bounced back in the next year. The two outlier periods occurred during the Great Depression. Even better, the S&P roared back by 23.5% or more in all of the other cases.

Another reason to buy stocks right now is that valuations are more attractive than they've been in a while. And the list of bargains includes some top-tier stocks that have been huge winners in the past. Amazon (AMZN 3.43%), for example, is close to 50% below its previous high. The company still has solid long-term growth prospects, though. 

There are also encouraging signs that inflation is slowing. The latest U.S. Bureau of Labor Statistics data showed that the consumer price index (CPI) fell the most on a month-to-month basis in December than it has since April 2020.

Soaring inflation ranked as one of the biggest causes of the S&P 500's decline in 2022. It was definitely a significant factor behind Amazon's slump. In the company's latest quarterly update, CFO Brian Olsavsky said that "broad-scale inflation, heightened fuel prices and rising energy costs have impacted our sales growth." If inflation continues to fall in the coming months, it's likely that the S&P 500, Amazon, and other stocks will rise.

Sounding the alarm

Now for some not-so-good news. Fears that the U.S. will soon enter a recession are growing. 

JPMorgan Chase warned in its fourth-quarter update last week that it expects a recession in 2023. Bank of America CEO Brian Moynihan also told analysts on Friday that his company's "baseline scenario contemplates a mild recession." Moynihan added that Bank of America is preparing for an even worse economic downturn.

The big banks aren't alone in these relatively pessimistic views. The Wall Street Journal recently surveyed economists at 23 major financial institutions. Two-thirds of them said that they think a recession is on the way this year.

It will probably come as no surprise that the stock market typically doesn't perform well during a recession. If a recession is truly right around the corner, buying stocks now could lead to losses -- at least over the near term.

There is perhaps a silver lining with the recession fears, though. Recessions usually don't last all that long. Of the last 10 U.S. recessions, half of them were over within eight months or less. Also, stocks often begin to rebound before a recession ends. It's not out of the question that the U.S. economy could enter a recession in the next few months but the S&P 500 still deliver solid returns in the latter part of the year. 

The best answer

Let's return to our original question: Is it safe to invest in the stock market right now? The best answer is that it depends on your investing time horizon.

Do you expect to need the money you're considering putting into stocks sometime over the next five to seven years? If so, you're probably better off finding another less volatile investment alternative than stocks.

It's a different story if you're investing for the long term. Over long periods of time, stocks often deliver strong annualized returns. Of course, which stocks you buy are important. Diversifying across multiple stocks spanning several industries helps lower your risk. 

You've probably heard the adage "There's safety in numbers." This old saying originally meant that you're less likely to be harmed when you're in a group of people. But the idea also applies to investing. If the number of years you have before you need your money and the number of holdings in your portfolio are high enough, investing in stocks should nearly always be safe.