Anyone who looks at their 401(k) accounts or investment portfolios knows the stock market is sizzling hot. There have been stronger market performances in the past. However, the current dynamics could be more exceptional than you might think.

The S&P 500 (^GSPC -1.11%) is on track to do something it's only done three times since 1928. What does history say the stock market will do in 2025?

Stock charts reflected in eyeglasses.

Image source: Getty Images.

Fifth time's the charm?

Technically, the S&P 500 didn't exist in its present form with 500 of the largest companies until 1957. However, predecessors of the index date back to 1923, when the Standard Statistics Company created a weekly index tracking the stocks of 233 U.S. companies.

In 1927, the early version of the S&P 500 jumped over 30%. The next year, the index soared nearly 40% higher.

The stock market surprisingly enjoyed a few good years during the Great Depression that followed. In 1935, the predecessor of the S&P 500 skyrocketed 41%. It vaulted nearly 28% higher in the next year.

Roughly two decades later, the index again delivered great back-to-back years. It zoomed 45% higher in 1954, with a 26% gain in 1955. In 1997, the S&P 500 (this time with all 500 members) jumped 31%. One year later, the index rose nearly 27%.

Now, the widely followed index is only 16 days away from its fifth time since 1923 delivering consecutive annual gains of 24% or more. Last year, the S&P 500 soared 24%. It's up nearly 28% as 2024 winds down.

History doesn't bode well for 2025

How might the S&P 500 perform in 2025? If history is a guide, you definitely shouldn't expect three years in a row of 24%-plus returns.

Granted, stocks did have another great year following the big gains of 1997 and 1998. Investors were able to literally party like it was 1999 (with apologies to Prince), with the S&P 500 jumping almost 20%. However, this run was an outlier.

The stock market ran out of steam after two years of impressive returns in 1954 and 1955. In 1956, the S&P 500 eked out a meager gain of less than 3%. But that small increase looked great compared to what happened following the previous two instances of back-to-back jumps of 24%-plus.

In 1937, the predecessor to the S&P 500 plunged nearly 39% -- erasing much of the gains achieved in the previous two years. After the earlier version of the index delivered exceptional returns in 1927 and 1928, the bottom fell out the next year with the great stock market crash of 1929. The index ended the year down close to 12%.

What should investors do?

It's important to learn lessons from history. However, it's equally important to know when historical precedents don't mean much.

Investors shouldn't assume that the stock market will decline or climb only slightly just because it did so three out of four times in the past, following two consecutive annual gains of 24% or more. The current market environment is different from any of the periods we've discussed.

The S&P 500 could easily deliver another big gain in 2025. The Federal Reserve is lowering interest rates. The incoming presidential administration wants to cut corporate tax rates and reduce regulatory burdens on businesses.

On the other hand, the S&P 500 could decline or provide a mediocre return in the new year. The valuations of many stocks have become frothy. The potential for steep tariffs on all imports could lead to higher inflation and interest rate increases.

What should investors do with this uncertainty? Maintain a long-term perspective. Although the S&P 500 has jumped 24% or more in two consecutive years only four times since 1923, it has delivered average annual total returns (with dividends included) of close to 10% over the long run. That historical return is enough to make patient investors a lot of money.