This article reflects federal rules as of June 2026 and covers tax year 2025 (the return most people file in early 2026). State rules are addressed in their own section below. Tax law changes — confirm current figures before you file.
Quick Answer
No. For tax year 2025, capital gains earned inside a traditional or Roth IRA never trigger the 3.8% Net Investment Income Tax (NIIT). Gains stay sheltered while in the account, and IRA distributions are excluded from net investment income by law under IRC Section 1411.
Why This Question Matters
You sold a stock or fund inside your IRA, saw a big gain, and now you are worried the IRS will hit that profit with the 3.8% surtax you keep reading about. That fear is understandable, but the gain inside the account is not a taxable event, so it cannot land on the NIIT form at all. The real risk sits one step away, and most articles never explain it clearly.
Here is the twist that costs people real money: while the gain inside the IRA is safe, the money you pull out of a traditional IRA raises your income, and that higher income can switch on the NIIT for the investment income you hold in a regular brokerage account. The IRS confirms that retirement plan distributions are not investment income, yet they still count toward the threshold test. For 2025, the surtax is 3.8% and the income thresholds are not indexed for inflation, so more savers drift into its reach every year, according to a 2026 NIIT planning analysis.
Here is what you will walk away knowing:
- 🛡️ Why gains inside any IRA or 401(k) are fully shielded from the 3.8% NIIT.
- ⚠️ How a traditional IRA withdrawal or Roth conversion can trigger NIIT on your other investments.
- 🧮 Worked examples with real dollar figures so you can copy the math for your own return.
- 📋 Which form to file, which line to use, and the deadline that applies.
- 🚫 The seven costly mistakes that quietly raise this tax — and how to dodge each one.
What the NIIT Actually Is
The Net Investment Income Tax is a 3.8% federal surtax on certain investment income, created in 2013 to help fund Medicare. The IRS explains that it applies to individuals, estates, and trusts whose income rises above a fixed dollar line. It is a separate tax that rides on top of your regular income tax and your capital gains tax.
The tax is built on two numbers, and you pay 3.8% on the lesser of the two. The first number is your net investment income (NII) — your interest, dividends, capital gains, rental income, and similar passive income, minus related expenses. The second number is the amount your modified adjusted gross income (MAGI) sits above your filing threshold. Whichever of those two is smaller becomes the base, and 3.8% of that base is your NIIT.
The consequence of misreading this rule is paying a tax you do not owe — or missing one you do. If you assume any large gain triggers the surtax, you may overpay or panic-sell. If you ignore it while doing a big withdrawal, you can get a surprise bill months later. The fix is simple: learn which dollars are investment income and which dollars only affect the threshold.
The 2025 MAGI Thresholds
For tax year 2025, the MAGI thresholds that turn on the NIIT are set by filing status, and they have not moved since 2013. A 2025 NIIT breakdown lists them: $200,000 for single and head-of-household filers, $250,000 for married filing jointly, and $125,000 for married filing separately. A qualifying surviving spouse uses the $250,000 line.
Because these numbers are frozen, inflation slowly pulls ordinary savers into the tax. A salary or a portfolio that felt modest in 2013 can now clear the line. The consequence is a quiet 3.8% tax creep, much like what happened with the taxation of Social Security benefits.
A common misconception is that the threshold is indexed each year like tax brackets. It is not. What you should do about it: check your projected MAGI before December 31, because once the calendar year closes, you cannot undo income that pushed you over the line.
The Core Rule: Gains Inside an IRA Are Sheltered
An IRA is a tax-deferred (or, for Roth, tax-free) wrapper. When you buy and sell investments inside the account, those trades do not create taxable income in the year they happen. Because no taxable gain is recognized, there is nothing for the NIIT to grab — the surtax only applies to gain “taken into account in computing taxable income,” and an internal IRA trade is not.
This shelter is written directly into the statute. Section 1411 and the IRS Q&A both exclude distributions from qualified plans — those described in Code sections 401(a), 403(a), 403(b), 408, 408A, and 457(b) — from net investment income. In plain terms, that list covers traditional and Roth IRAs, SEP and SIMPLE IRAs, 401(k)s, 403(b)s, and governmental 457(b) plans.
The consequence of this rule is hugely favorable: you can rebalance, harvest gains, or trade actively inside your IRA without ever adding a dollar to your NIIT base. A real-world example: a retiree who sells $80,000 of appreciated stock inside her traditional IRA owes zero NIIT on that gain, even if she is wealthy, because the gain never appears on her 1040.
A common misconception is that “capital gains are capital gains” no matter where they happen. They are not — location decides everything for this tax. What you should do: keep your most-traded, highest-turnover holdings inside tax-sheltered accounts when you can, and reserve taxable brokerage space for buy-and-hold positions.
The Real Trap: Distributions Raise Your MAGI
Here is where careful readers save themselves a bill. A traditional IRA withdrawal is fully or partly taxable as ordinary income, and even though that income is not investment income, it still flows into your MAGI. A larger MAGI can push you over the NIIT threshold, exposing the investment income in your taxable accounts to the 3.8% surtax.
So the IRA distribution itself is never taxed by the NIIT, but it can act as the trigger that taxes your other gains. As one wealth advisory firm puts it, a conversion or large withdrawal can “trigger higher taxes not just on the converted amount, but also on your capital gains.” The withdrawal lifts the water level; your brokerage gains are the rocks that suddenly poke above it.
The consequence is a stealth tax of up to 3.8% on investment income you thought was safely below the line. The fix is timing and sizing: spread withdrawals across years, or keep MAGI just under the threshold in years when you also have large taxable gains.
Roth Conversions and the Same Trap
A Roth conversion is treated as a distribution from your traditional IRA, so it is taxed as ordinary income and is not investment income for NIIT purposes. As an advisor planning guide notes, the conversion “doesn’t directly add to your NIIT base.” That part is good news.
The bad news is identical to the withdrawal trap: the conversion raises your MAGI for the year. A 2026 MarketWatch column warns that conversions “can suddenly expose dividends, interest income and capital gains to NIIT.” Because the Tax Cuts and Jobs Act killed Roth recharacterizations, you cannot undo a conversion that pushes you over the line.
The consequence of an oversized conversion is paying NIIT on your taxable-account income on top of the conversion’s own income tax. What you should do: model the conversion before you pull the trigger, and convert only up to the dollar that keeps your MAGI under the relevant threshold if you hold sizable taxable investment income.
Worked Examples With Real Dollars
Numbers make this concrete. Each example uses tax year 2025 thresholds and the 3.8% rate.
Example 1 — Gain Stays Inside the IRA (No NIIT)
Maria is single, age 60, with $150,000 of MAGI. She sells $90,000 of appreciated index funds inside her Roth IRA and reinvests the proceeds in bond funds — all inside the account.
Because the trade happens inside the Roth IRA, the $90,000 gain is never recognized. Her MAGI stays at $150,000, well under the $200,000 single threshold. Her NIIT is $0, and the gain is also free of regular capital gains tax.
Example 2 — A Distribution Triggers NIIT on Brokerage Gains
David is single, age 68, with $170,000 of MAGI before any withdrawal. He also holds a taxable brokerage account that produced $40,000 of long-term capital gains and dividends this year. He takes a $60,000 traditional IRA distribution.
His MAGI rises to $230,000. His net investment income is the $40,000 from the brokerage account (the IRA distribution is not counted as NII). The NIIT base is the lesser of: his $40,000 of NII, or his MAGI over the threshold, which is $230,000 − $200,000 = $30,000. The lesser is $30,000. His NIIT is 3.8% × $30,000 = $1,140. Without the IRA distribution, his MAGI of $170,000 would have been under the line and his NIIT would have been $0.
Example 3 — A Roth Conversion Crosses the Line
Linda and Tom are married filing jointly with $210,000 of MAGI. They hold $50,000 of net investment income (dividends and capital gains) in a taxable account. They convert $90,000 from a traditional IRA to a Roth.
Their MAGI jumps to $300,000. Their NII is $50,000. The MAGI excess over the $250,000 joint threshold is $300,000 − $250,000 = $50,000. The NIIT base is the lesser of $50,000 and $50,000, which is $50,000. Their NIIT is 3.8% × $50,000 = $1,900 — an extra cost the conversion created on income they already held.
Which Situation Applies to You?
The answer to “do my IRA gains trigger NIIT?” depends on what you are actually doing. Use this quick branch to find your spot.
- You only buy and sell inside your IRA or 401(k): You owe no NIIT on those gains, period. Read the “Core Rule” section and stop worrying.
- You take traditional IRA or 401(k) withdrawals (including RMDs): The withdrawal is not taxed by NIIT, but it raises MAGI. Read the “Real Trap” section and check whether you hold taxable investment income.
- You are doing a Roth conversion: Same MAGI trap, with no do-over. Read the “Roth Conversions” section and model the number first.
- You hold sizable taxable investment income alongside IRA activity: You are the highest-risk group. Time your distributions and conversions to keep MAGI under your threshold.
- You take only Roth IRA distributions: Qualified Roth withdrawals do not raise MAGI at all, so they cannot trigger NIIT. The Ameriprise NIIT overview flags Roth distributions as excluded.
Three Common Scenarios
Each scenario below shows the move and the result for tax year 2025.
Scenario A — Trading Inside the Account
| Your Move | What Happens to NIIT |
|---|---|
| Sell appreciated stock inside a traditional or Roth IRA | No gain is recognized, so the trade adds $0 to net investment income and $0 to MAGI |
| Reinvest the proceeds inside the same account | Still no taxable event; the NIIT never applies to the internal gain |
Scenario B — Pulling Money Out
| Your Move | What Happens to NIIT |
|---|---|
| Take a $60,000 traditional IRA distribution | The $60,000 is ordinary income, not NII, but it raises MAGI and can push you over the threshold |
| Hold taxable dividends and capital gains the same year | Those amounts can now face the 3.8% surtax because the distribution lifted your MAGI |
Scenario C — Converting to Roth
| Your Move | What Happens to NIIT |
|---|---|
| Convert $90,000 from traditional to Roth | The conversion is ordinary income, not NII, but it raises MAGI for the year |
| Carry taxable investment income alongside the conversion | The higher MAGI can expose that income to NIIT, with no recharacterization to undo it |
How to Report It: Form 8960
If you owe the NIIT, you calculate it on Form 8960, titled Net Investment Income Tax — Individuals, Estates, and Trusts. You attach it to your Form 1040 or 1040-SR. The form has three parts, and walking each one shows exactly where IRA money does and does not land.
Part I — Investment Income. Here you list interest, dividends, net capital gains, and rental and passive income. You do not list IRA or 401(k) distributions here, because they are not net investment income. Leaving them out is correct; adding them by mistake inflates your tax.
Part II — Investment Expenses. You subtract expenses tied to that income, such as investment interest and the portion of state income tax allocable to investment income. The result is your net investment income on Line 8, per the Form 8960 line guide.
Part III — Tax Computation. Line 13 carries your MAGI from Form 1040 — and this is where the IRA distribution finally shows its effect, because the distribution already raised the 1040 income that feeds MAGI. You subtract your threshold, take the lesser of that excess or your NII, and multiply by 3.8%. You then carry the result to Schedule 2 (Form 1040), Line 12. The filing deadline matches your 1040: generally April 15, 2026, for the 2025 tax year.
State Rules: Most States Have No NIIT
The NIIT is a federal Medicare surtax, and the large majority of states do not have their own version. In those states, your IRA gains and your taxable investment income face no separate 3.8% state surtax — though normal state income tax may still apply to a taxable IRA withdrawal.
There is a notable exception worth flagging because guessing here misleads readers. Minnesota enacted its own net investment income tax that begins from federal Form 8960 figures and applies above a high income floor of $1,000,000. Even there, the starting point is federal net investment income, so the same core rule holds — IRA distributions are not investment income.
The consequence of assuming your state mirrors the federal rule is either over-withholding or an unexpected state notice. What you should do: confirm your specific state’s treatment on your state revenue agency’s site before you file, especially if you live in a high-tax state and have a large conversion year.
Seven Mistakes to Avoid
- Reporting IRA gains as net investment income on Form 8960. Outcome: you overpay the 3.8% surtax on income that is legally excluded.
- Forgetting that a traditional IRA withdrawal raises MAGI. Outcome: a surprise NIIT bill on your brokerage gains months after you spent the cash.
- Doing an oversized Roth conversion late in the year. Outcome: MAGI blows past the threshold and you cannot undo it, since recharacterizations ended under the TCJA.
- Assuming the thresholds adjust for inflation. Outcome: you plan around the wrong number and cross the frozen $200,000 / $250,000 line.
- Ignoring required minimum distributions in your NIIT planning. Outcome: a mandatory RMD lifts MAGI and exposes taxable income you forgot about.
- Treating Roth and traditional distributions the same. Outcome: you miss that qualified Roth withdrawals do not raise MAGI and skip a tax-free planning tool.
- Assuming your state copies the federal rule. Outcome: you misjudge a state surtax like Minnesota’s or wrongly expect one where none exists.
Do’s and Don’ts
- Do keep high-turnover and high-income holdings inside your IRA — gains there never feed the NIIT.
- Do project your full-year MAGI before December 31, because the threshold test is annual and final at year-end.
- Do size Roth conversions to stop just under your filing threshold when you hold taxable investment income, to avoid the 3.8% spillover.
- Do prefer qualified Roth distributions for spending needs, since they do not raise MAGI at all.
- Do consult a CPA in a high-income or large-conversion year, because the interaction of NIIT, IRMAA, and capital gains rates is easy to get wrong.
- Don’t report IRA or 401(k) distributions in Part I of Form 8960 — they are not investment income.
- Don’t assume a big internal IRA gain creates any tax that year; it does not.
- Don’t wait until April to discover a December conversion triggered the surtax.
- Don’t rely on the threshold rising over time; it has stayed frozen since 2013.
- Don’t treat the NIIT as the only ripple — conversions also affect Medicare premiums and the taxation of Social Security.
Pros and Cons of Using an IRA to Avoid NIIT
- Pro: Gains inside the account never trigger the 3.8% surtax, because no taxable event occurs — a clean, statutory shield.
- Pro: You can rebalance and harvest gains freely inside the IRA without watching your NIIT base.
- Pro: Qualified Roth distributions keep MAGI flat, helping you stay under the threshold in retirement.
- Pro: Sheltering income-heavy assets inside the IRA can keep your taxable-account income low enough to avoid NIIT entirely.
- Pro: The exclusion is firmly grounded in the statute, so it is not a gray-area strategy.
- Con: Traditional IRA withdrawals raise MAGI and can trigger NIIT on your other investments, even though the withdrawal itself is exempt.
- Con: Required minimum distributions force MAGI up whether you want the income or not.
- Con: Roth conversions cannot be undone, so a mistimed one locks in extra NIIT.
- Con: Tax-deferred growth inside a traditional IRA eventually comes out as ordinary income, which can be a higher rate than capital gains.
- Con: The frozen thresholds mean the trap catches more savers each year.
What to Do Next
- Pull your most recent pay and investment statements and estimate your 2025 MAGI before you take any large distribution or conversion.
- List your taxable-account investment income separately — this is the only money the NIIT can reach.
- If your projected MAGI is near $200,000 single or $250,000 joint, size any withdrawal or conversion to stay under the line.
- Gather your 1099-DIV, 1099-B, and 1099-R forms to complete Form 8960 accurately, and file it with your 1040 by April 15, 2026.
- Check your state revenue agency’s site to confirm whether your state has any NIIT-style surtax.
- Call a CPA or fee-only planner before a six-figure conversion year, since the move ripples into NIIT, Medicare IRMAA, and Social Security taxation at once.
This article is educational and is not a substitute for advice from a licensed tax professional about your specific situation. A complex year — a large Roth conversion, an estate distribution, or a high-income sale — is exactly when a CPA or tax attorney earns their fee.
Frequently Asked Questions
Do capital gains inside an IRA trigger the NIIT? No. For tax year 2025, gains from buying and selling inside a traditional or Roth IRA are not recognized as taxable income, so they never enter the net investment income tax calculation.
Are IRA distributions subject to the NIIT? No. Distributions from IRAs and qualified plans are excluded from net investment income under Section 1411. They are not taxed by the NIIT, but they do raise your MAGI.
Can an IRA withdrawal still cause me to owe NIIT? Yes. A traditional IRA withdrawal raises your MAGI, which can push you over the threshold and expose investment income in your taxable accounts to the 3.8% surtax.
Does a Roth conversion trigger the NIIT? No, not directly — the conversion is not investment income. But it raises MAGI for the year, which can subject your other taxable investment income to the 3.8% tax.
What are the 2025 NIIT income thresholds? $200,000 for single and head-of-household, $250,000 for married filing jointly, and $125,000 for married filing separately. These figures are not adjusted for inflation.
What is the NIIT rate? 3.8%. It applies to the lesser of your net investment income or the amount your MAGI exceeds your filing-status threshold for tax year 2025.
Do Roth IRA distributions raise my MAGI for the NIIT? No. Qualified Roth IRA distributions are tax-free and do not increase MAGI, so they cannot push you over the NIIT threshold.
Which form reports the NIIT? Form 8960. You attach it to your Form 1040 or 1040-SR and carry the result to Schedule 2, then file by April 15, 2026, for the 2025 tax year.
Do 401(k) gains and withdrawals work the same way as IRAs for NIIT? Yes. Gains inside a 401(k) are sheltered, and 401(k) distributions are excluded from net investment income, just like IRAs — though distributions still raise MAGI.
Do required minimum distributions affect the NIIT? Yes, indirectly. An RMD is taxable income that raises MAGI, which can move you over the threshold and expose your taxable investment income to the 3.8% surtax.
Do states charge their own NIIT? Most do not. The NIIT is a federal tax. A few states, such as Minnesota for income above $1,000,000, have their own version that starts from your federal Form 8960 figures.
Does tax-loss harvesting inside an IRA reduce my NIIT? No. Losses inside an IRA are not recognized for tax purposes, so they cannot offset taxable investment income or lower your NIIT base.
Related reading
- 11+ Commons Mistakes When Buying Real Estate via IRA (w/Examples) + FAQs
- Does an IRA Contribution Offset Capital Gains? (w/Examples) + FAQs
- Does a Roth Conversion Trigger the 3.8% NIIT? (w/Examples) + FAQs
- Can Tax-Loss Harvesting Reduce the 3.8% NIIT? (w/Examples) + FAQs
- Do RMDs Trigger the 3.8% NIIT? (w/Examples) + FAQs
- Does the 3.8% NIIT Stack on Top of Capital Gains Rates? (w/Examples) + FAQs