The short answer: gains inside a Roth IRA are never taxed when you withdraw them, but only if you follow the withdrawal rules

Money that grows inside a Roth IRA — whether from investment gains, dividends, or interest — is not subject to federal income tax when you take it out. That tax-free growth is the defining feature of a Roth account. However, this protection only applies if you meet two conditions: you must be at least 59½ years old, and your account must have been open for at least five tax years. If you withdraw gains before meeting both conditions, those gains become taxable income and may also trigger a 10 percent early withdrawal penalty.

Your contributions (the money you put in) can always come out tax-free and penalty-free, regardless of your age or how long the account has been open. The tax-free treatment of gains is what makes the Roth different from a traditional IRA, where all withdrawals are taxed as ordinary income.

Key Takeaways

  • Investment gains in a Roth IRA are never taxed when withdrawn, as long as you are at least 59½ and the account has been open for five tax years.
  • Your contributions always come out tax-free and penalty-free at any age, but gains withdrawn before age 59½ or within five years are taxable.
  • If you withdraw gains early, you owe income tax on those gains plus a 10 percent early withdrawal penalty in most cases.
  • The five-year rule is tied to when you first opened any Roth IRA, not when you made a specific contribution.

How the five-year rule works

The five-year rule requires that your Roth IRA be open for five tax years before you can withdraw gains tax-free. This clock starts on January 1 of the year you open your first Roth IRA, not on the day you fund it. If you opened a Roth in 2020, the five-year period ends on January 1, 2025, and you can withdraw gains tax-free starting that date (assuming you are also 59½).

The five-year rule applies to your entire Roth IRA history, not to individual contributions. If you have multiple Roth accounts, they all share the same five-year clock — opening a second Roth IRA does not restart it. This is important if you have rolled over money from a traditional IRA or a 401(k) into a Roth, because the five-year clock still starts from your first Roth opening date, not from the rollover date.

One exception exists: if you inherit a Roth IRA from a spouse, you can treat it as your own and use your five-year clock. If you inherit from a non-spouse, different rules explore and you should consult a tax professional.

What happens if you withdraw gains before age 59½

If you withdraw gains from your Roth IRA before you turn 59½, those gains are taxed as ordinary income at your regular tax rate. You will also owe a 10 percent early withdrawal penalty on the gains themselves. For example, if you withdraw $5,000 in gains at age 45 and you are in the 22 percent tax bracket, you would owe $1,100 in income tax plus $500 in penalty — a total of $1,600 on that withdrawal.

Your contributions are not subject to this penalty, even if withdrawn early. Only the gains portion triggers the tax and penalty. The IRS uses a formula called the pro-rata rule to determine how much of your withdrawal counts as contributions versus gains, which can make early withdrawals complicated if your account holds both.

Some narrow exceptions to the 10 percent penalty exist — for example, if you are disabled, a beneficiary of a deceased account holder, or withdrawing for a first-time home purchase (up to $10,000 lifetime). These exceptions waive the penalty but not the income tax on gains.

What happens if you withdraw gains before five years

If your Roth IRA has not been open for five tax years, withdrawals of gains are taxable even if you are over 59½. This is separate from the age 59½ rule — you must satisfy both conditions for gains to be tax-free. If you opened your Roth in 2023 and withdraw gains in 2024, those gains are taxable income, period, regardless of your age.

The 10 percent early withdrawal penalty applies on top of income tax if you are also under 59½. So if you are 45 and your account is less than five years old, a $5,000 gain withdrawal costs you income tax plus the 10 percent penalty.

Contributions versus gains: which comes out first

When you withdraw from a Roth IRA, the IRS assumes your contributions come out first, before any gains. This means you can always pull out your contributions without tax or penalty, even if your account is young or you are under 59½. Only when you have withdrawn all your contributions does the IRS treat further withdrawals as gains.

This ordering rule is automatic — you do not have to specify which money you are withdrawing. If you contributed $20,000 total and your account has grown to $30,000, your first $20,000 in withdrawals are treated as contributions (tax-free and penalty-free), and any amount above that is treated as gains (subject to the five-year and age 59½ rules).

The pro-rata rule complicates this if you have both a Roth IRA and a traditional IRA, or if you have made nondeductible contributions to a traditional IRA. In those cases, the IRS treats all your IRAs as one pool for tax purposes, and the calculation of what counts as contributions versus gains becomes more complex. A tax professional can help you navigate this situation.

Roth conversions and the five-year rule

If you convert money from a traditional IRA or 401(k) into a Roth IRA, that converted amount is treated differently than regular contributions. The converted funds themselves are not subject to the five-year rule — you can withdraw converted amounts at any age without penalty (though you may owe income tax if the conversion itself was not fully taxed). However, any gains that accumulate on the converted money are subject to the standard five-year rule and the 59½ age requirement.

This distinction matters if you are doing a Roth conversion and plan to access the money soon. You can pull out the converted principal without penalty, but gains on that conversion are locked until you meet both conditions. Some people use this strategy to access retirement savings before 59½ by converting and then withdrawing only the principal.

How to track contributions and gains

Your Roth IRA custodian (the bank, brokerage, or investment firm holding your account) should provide you with an annual statement showing your contributions, gains, and account balance. Keep these statements for your records, because you will need them to calculate how much of any withdrawal is contributions versus gains.

The IRS Form 8606 is used to report Roth IRA conversions and nondeductible IRA contributions on your tax return. If you have done either, you should file this form even if you do not withdraw anything that year, because it establishes your basis (contributions) in the account. Failing to file Form 8606 can result in the IRS treating your entire withdrawal as taxable.

If you are unsure whether a withdrawal will trigger taxes or penalties, contact your custodian or a tax professional before you withdraw. Once money is out of the account, you cannot put it back except through a rollover, which has its own rules and time limits.

Frequently Asked Questions

Can I withdraw my gains tax-free if I am over 59½ but my account is only three years old?

No. You must meet both conditions: at least 59½ and five tax years since opening the account. If your account is only three years old, gains are taxable income even though you are past 59½. You can withdraw your contributions tax-free at any time, but gains stay locked until the five-year period ends.

What if I withdraw contributions and accidentally take out some gains too?

The IRS uses a formula to determine what portion of your withdrawal is contributions versus gains. You cannot choose to withdraw only contributions if your account holds both. If you withdraw $10,000 and your account is 60 percent contributions and 40 percent gains, the IRS treats $6,000 as contributions and $4,000 as gains, regardless of which money you actually withdrew.

Do I have to pay taxes on Roth IRA gains if I just leave them in the account?

No. Gains inside the account are never taxed, whether you withdraw them or not. You only owe tax on gains when you actually take money out of the account and those gains do not meet the five-year and age 59½ requirements.

If I have two Roth IRAs, do they each have their own five-year clock?

No. All your Roth IRAs share the same five-year clock, which starts from when you opened your first Roth IRA. Opening a second account does not restart the timer. The five-year rule is based on your Roth IRA history as a whole, not on individual accounts.

What is the pro-rata rule and why does it matter?

The pro-rata rule applies when you have both a Roth IRA and a traditional IRA (or nondeductible contributions in a traditional IRA). It treats all your IRAs as one account for tax purposes, so a withdrawal is taxed based on the ratio of pre-tax to after-tax money across all accounts combined. This can make early Roth withdrawals more expensive than expected if you also have a traditional IRA.