How Taxable Distributions from a Roth IRA are Determined
Withdrawals from a Roth IRA are tax-free if the funds have met the five year aging requirement and the following criteria is met.
Suppose a taxpayer does not meet the requirements for a tax-free withdrawal. The funds contributed to the IRA are always tax-free, because taxes were paid on those funds before they were deposited. Only the earnings would be taxable. Then the question becomes which funds are withdrawn first? Anticipating this question, the IRS has established a set of “Ordering Rules” which specify the sequence in which funds are withdrawn. All Roth IRAs, regardless of where they are deposited, are treated as one for purposes of the “Ordering Rules.”
First from contributions until all contributions have been withdrawn (these funds would be withdrawn tax and penalty-free);
Next from all converted (rollover amounts) until all have been withdrawn (these funds would be withdrawn tax-free, but see acceleration clause below);
Finally, from earnings (these funds would be taxable, and subject to the early withdrawal penalty when the taxpayer is under 59-1/2 years of age.)