Retirement savers achieved record balances in their 401(k) balances in 2014—thanks in part to the stock market's gains—but the biggest winners were the thousands of workers who became newly minted millionaires.

The average 401(k) balance hit a record high of $91,300 at the end of last year, according to new data from Fidelity Investments, the largest provider of 401(k) plans. Only a tiny fraction of the company's 13 million plan participants ever reach the million-dollar mark, but that number has grown sharply in the past two years.

Read MoreAnother tax-free way to save for college



About 72,000 workers had amassed $1 million or more in their 401(k) retirement plans at the end of 2014, according to Fidelity. That's nearly twice as many as in 2012 and almost five times as many as a decade ago.

