If you're lucky enough to have a Roth 401(k) at work, you might have a boatload of money in your traditional 401(k).

And if that's the case you might want to investigate converting some or all your traditional 401(k) funds into your Roth 401(k) -- over time or all at once. You might also think about contributing to your Roth 401(k) instead of your traditional 401(k) as well. Both tactics are designed to help you create tax-efficient income in retirement. But any time you convert money to a Roth account, there are a few key variables to consider.

Does your plan allow conversions?

First off, you need to determine what your 401(k) plan permits, says Marcia Wagner, the founder and owner of The Wagner Law Group. "In-plan Roth 401(k) conversions are not a required Code provision and, even if the plan permits them, there might be some limitations, such as being limited to active employees," she says.

But even if you plan permits such conversions, you have to decide if it makes sense. "The decision to convert 401(k) money into a Roth 401(k) should be based on the same variables that apply for converting a traditional IRA to a Roth IRA, says Tim Steffen, director of advanced planning at Baird Private Wealth Management. "Don't let the fact that it's inside your employer's retirement convince you that this decision is any different."

Do you have cash to pay for the taxes due on the conversion?

The primary tax advantage is that distributions from a pre-tax account are tax-deferred, while distributions from a Roth 401(k) account are excluded from tax, so long as the applicable age and service limitations on distributions from such accounts are followed, says Wagner.

But if you decide to do in-plan Roth 401(k) conversion remember that it's a taxable event on the federal level, and depending upon the state, at the state level as well, says Wagner. In essence, the amount you are converting is a distribution and taxed as ordinary income. You won't, however, have to pay a 10% early distribution penalty if you're under age 59½.

Steffen says it's a good idea to make sure you have cash available to pay the tax that's due on the conversion. "This is even more important with 401(k) conversions than with IRA conversions," he says. "If you convert an IRA, you can easily keep some of the money from the conversion aside to pay the tax. We would never recommend that, as using IRA dollars to pay conversion tax never makes sense, but it's at least an option."

With a 401(k) conversion, however, you likely can't access any of that money until you leave the employer, so you really need to make sure you have other money available to pay the tax, says Steffen.

What's the tax cost?

Steffen also recommends asking the following question when contemplating a 401(k) Roth conversion: What is the tax cost you're going to pay to convert today, as compared to the tax cost you would pay if you withdrew the money from the traditional account during retirement? "It's very hard to justify paying a higher tax cost now than you would in retirement," he says.

If you're a younger worker, with a relatively low income level, your tax rate today might be less than it would be in retirement, says Steffen. "But if you're older and well established in your career, right now you might be paying the highest tax rate you'll ever pay in your life since most people see their income fall when they switch from working to retirement," he says.

How soon will you need the money you're putting in the Roth?

According to Steffen, a Roth conversion, of any kind, means you're accelerating a tax liability that could have been deferred perhaps for many years, even decades. "To justify that accelerated tax cost, you need to give the Roth money time to grow tax-free," he says. "Converting today and then withdrawing the funds shortly after doesn't allow you to recover that tax cost."

As for what that time frame is, Steffen says it's at least a few years, but the longer, the better.

It's irreversible.

One drawback to doing a Roth 401(k) conversion, according to Wagner, is that the decision to convert is irreversible. "Recharacterization back to a pre-tax account is not permitted," she says.

The difference between the two Roth accounts:

Steffen also says there's one significant difference between Roth 401(k)s and Roth IRAs. In both accounts, he says the plan needs to be open for at least five years for the earnings in the account to be tax-free upon withdrawal. "There are other requirements as well, but that's the first one you must meet," he says.

If you convert to a Roth 401(k), your five-year window begins Jan. 1 of the year you first put money in that account, says Steffen. "The same applies for a Roth IRA," he says.

However, when you roll money out of the Roth 401(k) and into a Roth IRA at retirement, that five-year window will reset, says Steffen. "You can't use the time in the Roth 401(k) to count towards time in the Roth IRA. "If the Roth 401k has been open for more than five years, you may be able to withdraw earnings from the account tax-free," he says. "If you roll that money to a new Roth IRA, however, that five-year window starts over."

The better thing to do, he says, is to roll the Roth 401(k) money to an existing Roth IRA. "In that case, the five-year window on the Roth 401(k) dollars will go back to when the Roth IRA was opened," says Steffen.

If you don't have a Roth IRA today, but you do have a Roth 401(k), Steffen says it probably makes sense to open a Roth IRA now to get that five-year period started. "Then when you roll the Roth 401(k) into that Roth IRA, you don't have to start all over," he says.

Note, however, Roth IRA contributions have limits based on your income. This table shows whether your contribution to a Roth IRA is affected by the amount of your modified AGI as computed for Roth IRA purposes.

Should you start contributing to a Roth 401(k) instead of a Roth 401(k) conversion?

For the contributions, you have to look at what's more valuable - the tax deduction today or the tax-free income in the future, says Steffen. "If your future tax rate will be lower, then the traditional makes more sense -- get the deduction now at a higher rate, then have taxable income in the future at a lower rate," she says. "That's probably the case with older, more established workers."

Younger workers, on the other hand, would probably benefit from the Roth to start, says Steffen. "They have lower income now, so the deduction isn't as valuable to them today as the tax-free income will be in the future," he says.

From a pure math standpoint -- if your current and future tax rates are the same -- the Roth and traditional plan work out to be the exact same.

Steffen gave this example: Say you contribute $18,000 to a traditional 401(k) that earns 7% every year. After 30 years you'll have $1,700,294. But if you tax adjust that for a 25% income tax, you really only have $1,275,221.

On the other hand, if you pay the same 25% tax on the $18,000 and then put the balance in the Roth, your contribution is just $13,500. If that grows at 7% for 30 years, the Roth will be worth the same $1,275,221.

If the future tax rate is higher -- say 30% -- the traditional is really only worth $1,190,206, while the Roth is still worth $1,275,221.

If the future tax rate is lower -- say 20% -- the traditional is now worth $1,360,235, compared to the Roth at $1,275,221.

"There's also the concept of 'tax diversification,' where you ignore any tax issues today and instead focus on creating different pools of money to withdraw from in the future, knowing that tax rates could be literally anything in retirement," says Steffen.

It's never too late - or too early - to plan and invest for the retirement you deserve. Get more information and a free trial subscription to TheStreet's Retirement Daily to learn more about saving for and living in retirement. Got questions about money, retirement and/or investments? Email Robert.Powell@TheStreet.com.