Say I'm 30 on 2010 and open a Roth IRA. Then, on 2018 I do a backdoor deposit (put some money on an empty traditional IRA and move it soon after to the Roth before it generates any earnings). When can I take the original contribution out without paying penalties? When can I take the earnings without paying penalties? And the earnings without paying taxes? Do I have to wait until I'm 59 1/2 for the latter or can I do it sooner?
You can only take out earnings tax-free if it's a
qualified distribution. The requirements for this are that you need to have a Roth IRA open for five years
and also be either 59½, disabled, or dead. This five-year clock starts when you first put money from any source into any Roth IRA account. If you're alive and not disabled, make sure to do your rollover or just make a regular Roth IRA contribution before you turn 54 and this five-year rule becomes irrelevant.
And what if the money came from a Roth 401(k) that I roll over from a previous employer retirement plan and in which 80% are contributions I made after taxes and the other 20% are earnings over the last 10 years?
For distributions when you aren't old enough to take qualified distributions, the ordering rules come into play.
1) Your first withdrawals are considered to come from direct contributions, until those are completely used up.
2) Your next withdrawals are considered to come from traditional to Roth conversions, oldest first.
2a) If you converted both pre-tax and post-tax funds in the same year, the pre-tax part comes out first within that year's conversions.
3) Earnings come out last.
For your Roth 401(k) to Roth IRA rollover, the 80% that you contributed from your paycheck goes into the direct contribution bucket. The remainder goes into the earnings bucket.
The direct contribution bucket can be withdrawn at any time tax-free. Doesn't matter how long you have had your Roth IRA account.
The conversions bucket is never subject to regular income tax (you already paid this when you did the conversion). When you withdraw any conversions of
pre-tax funds that you converted
less than five years ago, a 10% early withdrawal tax applies.
The earnings bucket is subject to your regular income tax rates plus the 10% early withdrawal tax if you're not yet able to take a qualified distribution. Avoid withdrawing this money early if at all possible.