The amount of 401(k) millionaires is within striking distance of an all-time high.

The number of seven-figure 401(k) accounts at Fidelity Investments jumped 20% in 2023’s final quarter to 422,000, marking a sharp recovery from the previous quarter’s 7.7% drop, an analysis released by Fidelity on Tuesday shows.

Gains in the stock market helped swell retirement balances last year as the S&P 500 advanced 24% following 2022’s 19% decline. The impressive run was powered in large part by the so-called “Magnificent 7” stocks that now make up roughly 30% of the market-cap weighted S&P 500 Index. In 2023, Nvidia Corp. gained more than 238%, Meta Platforms Inc. rose more than 194% and Inc. was up more than 80%.

The only time when the ranks of 401(k) millionaires at Fidelity was higher was in 2021’s fourth quarter, when there were 442,000 such accounts. Elsewhere, the number of seven-figure IRAs is at a record 391,600 accounts.

The average age of 401(k) millionaires at Fidelity skews older at around 59. However, Gen Xers also hit a nice milestone in the last few months of 2023. Those who have had the same 401(k) plan for 15 straight years saw average balances hit $501,000. That said, the average overall retirement balance at Fidelity is far from the millionaire mark, at $118,600.

Other highlights from the report:

• The total savings rate — adding up workers’ contributions and their employers’ matching contributions — was 13.9%, in line with the previous two quarters.
• For all of 2023, over 37% of workers with 401(k)s raised the percentage of pre-tax salary they direct into their plan. In just the fourth quarter, 10% of employees raised the percentage.
• Some 78% of 401(k) savers contributed enough to their plan to get their employer’s full matching contribution.
• Roth IRA accounts held by Gen Z savers rose 50% in 2023’s fourth quarter compared with the same period in 2022.

This article was provided by Bloomberg News.