Want a great 401(k)? Work for an oil company

Looking for a job with great retirement benefits? Consider working on an oil rig, studying law or signing up for flight school.

Lawyers, oil and gas workers and airline employees have some of the best 401(k) plans in the country, according to a BrightScope report that analyzed some 3,500 company 401(k) plans with at least $100 million in assets.

Employees at many tech firms and utilities fare pretty well too, the report found.

BrightScope's analysis looked at 2012 data and took into account hundreds of factors, including fees, investment options and the level of employer and employee contributions. The higher the score, the more likely savers are to accumulate large enough savings to live their retirement "in dignity," said Brooks Herman, head of data and research at BrightScope.

The average balance forparticipants in Saudi Arabian Oil Company's highly ranked 401(k) plan, for example, was $490,000 -- nearly 30 times Wal-Mart's(WMT) average balance of $18,000, according to BrightScope's data.

Wal-Mart said more than a million of its workers take part in its plan, including some part-time associates. The company said it matches employee contributions dollar-for-dollar up to 6% of its workers salaries.

These five 401(k)s are among the top employer plans offered to workers in the tech, utility, legal, airline and oil and gas industries.

Southwest Airlines(LUV)' plan for pilots was also one of the top performers. It carries some of the lowest fees around, offers plenty of investment options and a generous employer contribution. As a result, participants have saved an average of $350,000.

The best performing plans also typically offer generous employer contributions, whether it's a traditional match or profit-sharing, something that is especially common in the legal sector.

Workers also tend to earn higher salaries, which allow them to sock away more of their own pay each year.

"These are going to be people who often have advanced degrees, and they are going to understand the importance of 401(k) savings,"Herman said.