Editors' pick: Originally published June 9.

Investors who plan to allocate the majority of their salary into non-taxable accounts are often faced with the conundrum of whether to max out their 401(k) plan or IRA account.

Many investors prefer the flexibility of IRA accounts, because they have a greater variety of mutual funds, ETFs and other investment options to choose from, but some employees want to allocate more funds tax free and are limited to contributing to a 401(k) plan.

When Maxing Out a 401(k) is Beneficial

The contribution levels for 401(k) plans are over three times as high as IRA limits. Investors are limited to contributing $18,000 for a 401(k) while the level for an IRA is much lower, set at $5,550 for people under 50.

Employees who plan to remain working at their company long enough for the matching contribution, known as vesting, to kick in should consider increasing their contributions. Every company has a different rule, and while some only require that you work there for a year, others have a higher threshold of three years or longer.

The fees for 401(k) plans are trending downward, and the decline has been slow and steady, said Joe Valletta, co-author of 401k Averages Book. For the past 16 years, the authors have examined the total fees, which include revenue sharing, investment and record-keeping fees charged by 401(k) plan providers such as Vanguard and Fidelity. As of September 2015, the research included 193 plan offerings.

The research showed that 68 401(k) plans that had 100 employees with $5 million in assets charged fees ranging from 0.41% to 1.69% with a median fee of 1.3%. In 2010, the average fee was 1.33%.

The 60 401(k) plans that had 500 employees with $25 million in assets charged a fee of 0.33% to 1.31% with a median fee of 1.11%.

The 50 plans with 1,000 employees had $50 million in assets and charged fees ranging from 0.31% to 1.21% and a median fee of 1.05%. The average fee declined from 1.03% to 0.97%.

"Many of the employers chose plans with mutual funds, which have lower fees," he said.

Why 401(k) Plans Can Be Subpar

Unless you work for a Fortune 500 employer like Apple or GE, the odds are that your plan has high fees embedded in it. A growing number of lawsuits are being filed by employees, because of the fees charged by many 401(k) plan providers. There are at least two fees to watch out for such as the management fee, which is the amount charged by the 401(k) plan provider such as Fidelity for maintaining the retirement account. The management fee is often hidden and hard to find. The second fee is the one for each investment, and actively managed funds charge a higher fee than index funds.

Too many 401(k) plans have terrible options and some of them lack even basic index funds which are the lowest cost option for investors, said Bijan Golkar, CEO of FPC Investment Advisory in Petaluma, Calif.

"Many plans offer garbage, and there is no excuse for that anymore," he said. "In some cases, you might consider allocating more money into an IRA or Roth IRA instead of 401(k) plan if the investment choices are so lousy." 

Employees are also limited to a handful of options and should have a greater amount to choose from, said Golkar.

TheStreet Recommends

"Why should companies dictate the investments?" he said.

Millennials and Gen X-ers who are saving money to purchase a home should allocate more funds into an IRA or Roth IRA, because the IRS allows first-time homebuyers to take out $10,000 without paying a penalty. 

Opportunity Costs For 401(k) Plans Can Be High

The opportunity costs are doubled for 401(k) investors, because the mutual fund fees are often already high, and in addition, the fund options are often not the top performing ones, said Grant Easterbrook, co-founder of Dream Forward Financial, a low cost 401(k) plan based in New York.

"The difference between the performance of top low cost funds and the proprietary funds employees may be forced to use can be huge," he said. "The poor fund choices, and the associated opportunity costs are often an even bigger concern for employees of small and medium sized businesses. They are more likely to have a more limited selection of funds compared to employees at giant companies like Google or Amazon."

Another major issue is that the layers of fees such as the management fee, hidden fees and investment fund fees are not transparent or even easy for investors to find.

Avoid choosing actively managed funds, because the fees are higher and portfolio managers can rarely beat benchmark index funds long-term.

"Statistically, the chance you can pick the right active managers and consistently beat the market net of the fees for ten years or longer is very low," Easterbrook said.

Why IRA Accounts Are Better

The advantages of IRA accounts are numerous, and they remain popular with investors because they have greater control over their investment options, which is of paramount importance for job hoppers.

"IRA accounts can be set up at almost any brokerage and allow you to invest your money however you choose," said David Twibell, president of Custom Portfolio Group, an Englewood, Colo.-based financial planning firm. "With a few exceptions, they are really no different in that sense than a traditional taxable investment account. You can buy mutual funds, exchange-traded funds, individual securities or any number of other investments in your IRA."

In addition to giving investors more control of their investment choices, they also have more options to "reduce their investment fees, generate higher income and better match their investments to their own risk tolerances," he said.

Investors who already contribute to a 401(k) plan will be limited on how much they can contribute to an IRA. Individuals who earn less than $61,000 can deduct 100% of an IRA contribution while someone who makes between $61,000 and $71,000 can take a partial deduction, according to IRS rules.

"The biggest con for the traditional IRA is that there is contribution deduction phase out that varies based on if you file taxes single or jointly and if you contribute to a 401(k)," said Daniel Milan, a managing partner of Cornerstone Financial Services, a Birmingham, Mich. financial planning firm. "Once your income reaches those levels, then you will not be able to deduct your contributions from your taxes."

Determining whether to max out your 401(k) plan compared to your IRA account can be challenging, especially if your company matches your contributions.

"While 401(k) plans aren't ideal from an investment standpoint and often come with a lot of baggage, including high fees, those are usually more than offset by the amount of the match," Twibell said. "That's particularly true for someone who may not be staying with their current employer for the long haul since the 401(k) account, including the match can then be rolled over into an IRA."