Here's what you need to know about how to properly make the switch. iStockphoto By Sandra Block, Senior Editor From Kiplinger's Personal Finance, March 2017 QI made after-tax contributions to my 401(k). When I retire, can I roll that money into a Roth IRA tax-free?AYes. After-tax funds can be segregated from other funds in the account and transferred directly to a Roth IRA. In fact, it would be a mistake not to. (Don’t confuse after-tax contributions to a regular 401(k) with contributions to a Roth 401(k), which are also made with after-tax dollars but to which slightly different rules apply.) SEE ALSO: Why You Need a Roth IRA Suppose you’re retiring and have $400,000 in your traditional 401(k) plan, including $50,000 of after-tax contributions. Rather than rolling the entire amount into a traditional IRA, you could move the $50,000 in after-tax contributions to a Roth IRA and roll the remaining $350,000 into a traditional IRA. But there are some important caveats. You can’t move the entire account to a traditional IRA and decide later to convert the after-tax portion to a Roth, says Tim Steffen, director of financial planning for Robert W. Baird; you must split off your after-tax contributions at the time of the rollover. Once the money is in a traditional IRA, any distributions—including money converted to a Roth—will be taxed based on the ratio of pretax and after-tax assets in the plan. Advertisement Once your after-tax money is in a Roth IRA, future earnings will be tax-free rather than simply tax-deferred (as they were in the company plan), and you’ll never be forced to take minimum distributions. “Given that this Roth option is available, rolling after-tax contributions into a traditional IRA doesn’t make any sense,” Steffen says. SEE ALSO: 10 Things You Must Know About Roth Accounts A 100% rollover. In most cases, you’ll need to roll the entire balance out of your 401(k) to take advantage of this strategy, Steffen adds. Otherwise, you would be subject to the pro rata rules. Using the example above, suppose you had $400,000 in your 401(k), including $50,000 of after-tax contributions. If you pulled out $50,000 to convert to a Roth and left $350,000 in the company plan, only 12.5% of the withdrawal, or $6,250, would be tax-free. You’d have to report the rest as taxable income for the year of the transfer. There is an exception to this rule. If your employer offers a separate account for after-tax contributions, you can roll that money into a Roth IRA without emptying your 401(k) plan, Steffen says. Sticking with the above example, let’s say you have $45,000 in contributions plus $5,000 in earnings in a separate, after-tax account, and $350,000 in a pretax account. In that case, you could withdraw $50,000 and invest $45,000 in a Roth. You’d be required to invest $5,000 in a traditional IRA because the earnings are pretax. If you’re still working and are able to stash a lot of money away for retirement, it’s worth asking if your company plan allows after-tax 401(k) contributions. If not, and you’re a super saver, you may want to encourage your employer to add this benefit. A Roth 401(k) offers a better deal and should be used first; earnings are tax-free rather than tax-deferred, and you can roll the money into a Roth IRA, tax-free, when you retire. But it comes with lower contribution limits than after-tax contributions to a traditional 401(k). Advertisement SEE ALSO: 10 Financial Decisions You Will Regret in Retirement In 2017, the maximum you can contribute to a 401(k)—Roth, traditional pretax or a combination of the two—is $18,000, or $24,000 for workers who are 50 or older. If your employer allows after-tax contributions to a traditional 401(k), however, you can keep shoveling cash into the tax shelter until your contributions, including any employer matches, total $54,000 a year, or $60,000 if you’re 50 or older.