How to calculate earnings on excess Roth IRA contribution before filing taxes

Contributed $1,000 too much to my Roth IRA last year (income came in higher than I expected and I phased out). I want to withdraw the excess plus earnings before the tax deadline so I don't get hit with the 6% excise tax. My brokerage has a form for "return of excess contribution" but it's asking me to confirm the earnings amount — it's not filling that in automatically. I looked at my account balance on the contribution date vs. now and just subtracted, but I know that's not the right method because there were other contributions and market moves in between. Is there an IRS formula for this? Do I calculate it myself or does the brokerage always do it? I want to make sure I'm pulling out the right amount so I don't under-withdraw and still owe the 6%, or over-withdraw and create a new taxable event.

35 comments

Does your brokerage's form have a field where you tell THEM the contribution amount and date, and they calculate earnings? Because most custodians do the math using the IRS formula (called the NIA — net income attributable) once you give them those two inputs. Have you tried calling them before doing it manually?

Hannah T.

Author

I did call. They said they can calculate it but only if I request it through their online withdrawal flow, which I already started and got stuck on. I'll try restarting from scratch. Good to know the formula is called NIA — that helps me search.

The IRS formula is in Publication 590-A. Net income attributable = excess contribution × (adjusted closing balance − adjusted opening balance) ÷ adjusted opening balance. The adjusted opening balance is your balance just before the contribution went in plus all contributions since then, including the excess itself. The adjusted closing balance is your current balance plus any distributions since the contribution date; contributions are not subtracted from it. Market gains and losses get absorbed into it automatically — you don't track them separately.

Worth adding: the "adjusted" part is what trips people up. You're not just taking opening and closing balance from your statement. You have to add contributions to the opening balance and add distributions back to the closing balance to isolate what the market did to your money.

Hannah T.

Author

This is really helpful. So if I had other contributions after the excess one, those get added only to the adjusted opening balance, not the adjusted closing balance?

Had this same situation two filing seasons ago. I pasted my transaction history into taxr.ai and it ran through the NIA calculation step by step — showed me the adjusted opening and adjusted closing figures and what earnings amount to request from my broker. I then confirmed with the broker and they matched almost exactly (off by a few cents due to rounding). The official formula is in Publication 590-A at irs.gov if you want to verify each line yourself.

Hannah T.

Author

That's good to know it matched the broker's number. I'll try running it myself first with the formula and see if the brokerage agrees.

Are you sure the excess is actually from the phase-out and not from, say, contributing to both a traditional and Roth in the same year over the total limit? The fix is the same (withdraw excess plus NIA) but knowing the source matters if you need to explain it to your preparer.

Hannah T.

Author

Definitely the phase-out — I only have the Roth, no traditional. MAGI came in higher than I modeled so I exceeded the threshold.

What tax software are you using? TurboTax and similar will flag the excess and walk you through the 6% Form 5329 penalty automatically if you don't withdraw in time, but they won't calculate NIA for you beforehand. That part is on you or the broker before you file.

Hannah T.

Author

Using tax software yes. Good to know the NIA calc isn't in there — I was hoping it might just spit out the number.

Recharacterization step: even after you do the withdrawal, make sure you tell the software the excess is gone so it doesn't still trigger Form 5329.

Something that helped me when I did this: I uploaded my IRA statements to Taxr and had it lay out each line of the NIA formula with the actual numbers from my account history, so I could hand that worksheet to my CPA before our meeting. Saved a lot of back-and-forth. The earnings amount it came up with was what I told my broker to withdraw.

Worksheet step: did your CPA need anything else from you at that point or was the NIA worksheet enough?

One thing worth flagging — the earnings you withdraw ARE taxable in the year you contributed, not the year you withdraw them (if you pull them out before the deadline, including extensions). Even if you're under 59½, the earnings portion is no longer hit with the 10% early distribution penalty on a timely corrective withdrawal. The return of the excess contribution itself isn't taxed again since it was already a Roth contribution from after-tax dollars.

Hannah T.

Author

I'm under 59½ so that's relevant. So the principal ($1,000 excess) comes back tax-free, the earnings on it are taxable as ordinary income but not penalized 10%?

Penalty step: yes, exactly. The broker will send a 1099-R for the earnings portion with a code to indicate it was a return of excess. There's no 10% penalty on those earnings for a timely corrective withdrawal, so nothing to figure on Form 5329 for that.

Has anyone had the broker calculate a negative NIA? Market was down over that period so theoretically earnings could be negative, meaning you'd pull out less than the original excess contribution.

Yes — a negative NIA is possible and correct per the formula. You'd withdraw the excess minus the absolute value of the negative earnings. You can't deduct a loss beyond that though.

Negative NIA step: good outcome if the market is down. You still have to withdraw the full corrected amount by the deadline to avoid the 6% penalty on the excess itself.

Do you know the exact contribution date? The NIA formula period runs from that date (specifically from just before it hit the account) to just before you request the return. If your brokerage used business-day timing on the posting, make sure you're using the posting date, not the date you initiated the transfer.

Hannah T.

Author

Good catch — I initiated it one day, it posted the next. I'll use the posting date.

For what it's worth: the 6% penalty in Form 5329 compounds every year the excess sits there. If you're doing this before filing (and before the deadline including extensions) you avoid it entirely for the contribution year. But if you miss the deadline, it stacks.

Is there a reason you're doing this yourself rather than just letting the broker run the calc? Most of them have automated it now. I'd only do the manual NIA calc to verify, not as your primary number to give them.

Hannah T.

Author

Verification step: fair point. I'll let the broker calculate it and then verify with the formula rather than giving them a number I computed.

Publication 590-A at irs.gov walks through an example of the NIA formula with sample numbers. Worth reading even if your broker does the calc — you'll know immediately if their number is off.

Also worth knowing: once the return of excess is processed and the 1099-R arrives next January (coded as a return of excess), you report the earnings portion on your return for the year the excess contribution was made. So if the excess was for last year, the earnings go on last year's return even though the actual cash hits your account this year.

Hannah T.

Author

So the 1099-R will come next January but I report the earnings on this year's return (the year the contribution was for). Got it.

Did your brokerage say anything about how long processing takes? Some custodians take several business days and if you're close to the filing deadline (or the extended deadline) you want to initiate the request early enough that it actually settles.

Hannah T.

Author

They said 3–5 business days. I'm going to initiate this week to give myself margin.

Reminder that recharacterization is a separate option from return of excess — you can recharacterize the Roth contribution as a traditional IRA contribution if you're eligible, rather than pulling the money out at all. Different rules apply and some people overlook it. Worth a quick check if pulling the earnings out plus paying taxes on them doesn't make sense for your situation.

Hannah T.

Author

I considered that but I'd be over the traditional IRA deduction limit too given my income and workplace plan, so recharacterization doesn't really help me. Return of excess is the right move.

Recharacterization step: makes sense — if you can't deduct the traditional contribution either, the return of excess (with NIA) is the cleaner path.

What year did you make the excess contribution? If it was for the prior tax year and you're still before the original filing deadline (or extended deadline), you have time. But if it's already past the deadline for that year, the correction method and the penalties shift — the 6% has already been assessed for that first year.

Hannah T.

Author

Prior tax year contribution, I haven't filed yet and I'm before the deadline. So I should be in the window to do this cleanly.