3.8% Net Investment Income Tax: When a $500K Capital Gain Triggers an Extra $19,000 Surprise Bill
You sold $500K of stock, checked the long-term capital gains bracket, and budgeted for 20% federal tax. Then your CPA sent a bill for $19,000 more. The Net Investment Income Tax under IRC § 1411 is a 3.8% surtax that stacks on top of capital gains rates — and unlike the LTCG brackets, its thresholds haven’t been inflation-adjusted since 2013. Here’s how it works, who it hits, and what you can do about it.
The tax on top of the tax: how NIIT works
The Net Investment Income Tax is a 3.8% surtax created by the Affordable Care Act in 2013, codified at IRC § 1411. It applies to the lesser of two numbers:
- Your net investment income (capital gains, dividends, interest, rental income, passive activity income, royalties)
- Your MAGI above the threshold ($200,000 single / $250,000 MFJ / $125,000 MFS)
The critical detail: these thresholds have never been inflation-adjusted. They were set in 2013 and remain fixed in 2026. A $200K income in 2013 had very different purchasing power than $200K today — which is why NIIT hits far more filers now than when it was enacted.
And unlike the long-term capital gains brackets (which top out at 20% for single filers above $533,400 in 2026), NIIT stacks on top. The effective top federal rate on long-term capital gains is 20% + 3.8% = 23.8%, not 20%.
MAGI for NIIT: not the same as every other MAGI
The IRS uses “modified adjusted gross income” for at least six different purposes, and each one modifies AGI differently. For NIIT specifically, MAGI is your adjusted gross income (Form 1040, line 11) plus any net foreign earned income exclusion claimed under IRC § 911.
For most W-2 earners with no foreign income exclusion, MAGI equals AGI. That means every dollar of capital gains, dividends, and interest flows straight into your NIIT MAGI calculation. A single $500K stock sale can push a $220K earner to $720K MAGI — well above the $200K threshold.
What reduces MAGI for NIIT purposes: above-the-line deductions. 401(k) deferrals, HSA contributions, self-employed retirement contributions, and the self-employed health insurance deduction all reduce AGI and therefore MAGI. Itemized deductions do not reduce MAGI. Charitable giving, mortgage interest, and SALT deductions help your income tax but do nothing for NIIT.
Worked example: $220K salary + $500K stock sale
A Dallas-based single filer, age 42, earns $220,000 in W-2 salary. She maxes her 401(k) at $24,500 (2026 limit under IRC § 402(g)) and contributes $4,400 to her HSA (self-only, 2026 limit under IRC § 223(b)). In October, she sells a concentrated stock position for a $500,000 long-term capital gain.
Step 1: calculate MAGI
| Income item | Amount |
|---|---|
| W-2 salary | $220,000 |
| Less: 401(k) deferral | ($24,500) |
| Less: HSA contribution | ($4,400) |
| Long-term capital gain | $500,000 |
| AGI / MAGI | $691,100 |
Step 2: calculate NIIT
| NIIT component | Amount |
|---|---|
| Net investment income (the capital gain) | $500,000 |
| MAGI above threshold ($691,100 − $200,000) | $491,100 |
| NIIT base (lesser of the two) | $491,100 |
| NIIT owed (3.8% × $491,100) | $18,662 |
Round up: she owes roughly $19,000 in NIIT on top of her regular capital gains tax. Without the 401(k) and HSA deductions, her MAGI would be $720,000 and NIIT would hit the full $500,000 in NII — costing $19,000 flat. Those above-the-line deductions saved her about $340 in NIIT alone.
Step 3: total federal capital gains bill
| Tax layer | Rate | Approximate tax |
|---|---|---|
| LTCG (15% bracket up to $533,400) | 15% | ~$63,800 |
| LTCG (20% bracket on the remainder) | 20% | ~$21,100 |
| NIIT | 3.8% | ~$18,700 |
| Total federal tax on the $500K gain | ~$103,600 | |
| Effective federal rate on the gain | ~20.7% |
Without NIIT, she’d owe ~$84,900. The surtax adds $18,700 — a 22% increase in her capital gains bill that doesn’t appear in any LTCG bracket table.
The NIIT threshold table: thresholds by filing status
| Filing status | NIIT threshold | Top LTCG rate + NIIT |
|---|---|---|
| Single | $200,000 | 23.8% |
| Married filing jointly | $250,000 | 23.8% |
| Married filing separately | $125,000 | 23.8% |
| Head of household | $200,000 | 23.8% |
| Qualifying surviving spouse | $250,000 | 23.8% |
The MFS threshold at $125,000 is a trap. Couples filing separately to optimize student loan repayment or ACA premium subsidies can trigger NIIT at a much lower income level than they would filing jointly.
What counts as net investment income (and what doesn’t)
Not all income triggers NIIT. The distinction matters:
| Included in NII | Excluded from NII |
|---|---|
| Long-term and short-term capital gains | W-2 wages and salary |
| Dividends (qualified and ordinary) | Self-employment income (active) |
| Interest income | Social Security benefits |
| Rental income (passive) | Tax-exempt municipal bond interest |
| Passive activity income | Distributions from qualified retirement plans (401(k), IRA) |
| Royalties | Active S-corp / partnership income (material participation) |
| Annuity income (non-qualified) | Rental income from a REPS-qualifying activity |
The exclusion for retirement plan distributions is significant. A $100,000 Roth conversion increases AGI (and MAGI) but is not net investment income — so it pushes you closer to the NIIT threshold without itself being subject to NIIT. However, it can cause other investment income to become subject to NIIT by raising MAGI above the threshold.
Real estate sales: where NIIT stacks with depreciation recapture
Selling investment real estate creates a three-layer federal tax problem that catches even experienced investors off guard.
A Phoenix couple (MFJ, $300K combined salary) sells a rental duplex they’ve held for 12 years. Purchase price: $420K. Depreciation claimed: $150K. Sale price: $820K.
| Tax layer | Amount | Rate | Tax |
|---|---|---|---|
| Unrecaptured § 1250 gain (depreciation) | $150,000 | 25% max | $37,500 |
| Remaining LTCG ($820K − $420K − $150K + $150K basis reduction) | $400,000 | 15% | $60,000 |
| NIIT on total gain | $550,000 | 3.8% | $20,900 |
| Total federal tax on the sale | $118,400 |
The adjusted basis is $270K ($420K − $150K depreciation). Total gain: $550K. Their MAGI is $300K salary + $550K gain = $850K. NIIT applies to the lesser of NII ($550K) or MAGI above $250K ($600K) — so the full $550K gain is subject to the 3.8% surtax.
That $20,900 in NIIT is easy to miss. Most investors calculate the 25% recapture and 15% LTCG layers but forget the 3.8% that hits both layers simultaneously. Effective federal rate on the gain: 21.5%.
Passive vs. active income: the NIIT classification that changes everything
The distinction between passive and non-passive income under IRC § 469 has always mattered for loss limitation. Under NIIT, it matters for a completely different reason: non-passive business income is excluded from net investment income. Passive income is included.
Rental income: passive by default
Rental income is per se passive under IRC § 469(c)(2), regardless of how many hours you spend managing properties. This means rental income is subject to NIIT for most landlords.
The exception: real estate professional status (REPS) under IRC § 469(c)(7). If you spend 750+ hours per year in real property trades or businesses, and more than half your total working hours are in real estate, and you materially participate in each rental activity, then your rental income is recharacterized as non-passive — and excluded from NII entirely.
For a couple with $80K/year in rental income and $300K in other income: without REPS, they owe $3,040/year in NIIT on the rental income alone ($80K × 3.8%). With REPS, that $3,040 disappears — $30,400 saved over a decade. The 750-hour test is heavily audited, but the savings are real.
S-corp and partnership income: participation matters
If you materially participate in your S-corp or partnership (under the IRC § 469 seven tests — most commonly the 500-hour test), the income is non-passive and excluded from NII. If you’re a passive investor in someone else’s business, that income is NII and subject to NIIT.
Gain on the sale of an active business interest is also excluded from NII if you materially participated. But gain on a passive business interest gets the full 3.8% treatment. This distinction is worth tens of thousands on a business sale.
Five strategies to reduce or avoid NIIT
1. Maximize above-the-line deductions
Every dollar of above-the-line deduction reduces AGI and MAGI. In 2026:
- 401(k): $24,500 deferral ($32,500 with catch-up at 50+, or $35,750 with the SECURE 2.0 super catch-up at 60–63)
- HSA: $4,400 self-only / $8,750 family (plus $1,000 catch-up at 55+)
- SEP-IRA: up to $73,500 (25% of compensation) for self-employed
For the Dallas filer in our example, her $24,500 + $4,400 = $28,900 in deductions reduced her NIIT base by $28,900, saving ~$1,100 in NIIT. If she had access to a mega-backdoor Roth or additional self-employment income to fund a SEP, the reduction could be larger.
2. Installment sale election (IRC § 453)
For business or real estate sales, electing installment treatment spreads the capital gain over the payment years. If a $500K gain can be received as $100K/year over 5 years, each year’s MAGI is $100K lower — potentially keeping you below the $200K/$250K threshold entirely.
The limitation: installment sales don’t work for publicly traded stock (IRC § 453(k)(2)). They’re primarily useful for private business sales and real estate.
3. Harvest capital losses to offset gains
Capital losses reduce net investment income dollar-for-dollar. A $500K gain offset by $200K in harvested losses produces $300K of NII instead of $500K. NIIT drops from ~$19K to ~$11.4K. Tax-loss harvesting in a direct-indexing portfolio throughout the year creates a loss bank you can deploy against a large gain event.
4. Qualify for real estate professional status
As covered above, REPS removes rental income from NII. If you’re a part-time W-2 earner and full-time real estate investor, this is one of the most powerful NIIT planning tools available. But it requires genuine 750+ hours and majority-of-time commitment — the IRS audits this aggressively.
5. Charitable remainder trusts for large, one-time gains
A charitable remainder trust (CRT) receiving appreciated assets can sell them without triggering immediate capital gains or NIIT. The trust distributes income to you over time (tier system: ordinary income first, then capital gains, then other income, then corpus). By spreading the gain recognition over 10–20 years, annual MAGI stays lower. The trade-off: the remainder goes to charity, and the trust is irrevocable. This only makes sense for filers with charitable intent and gains large enough to justify the trust setup cost ($5K–$15K).
The part most people miss: NIIT cascades into IRMAA
A large capital gain that triggers NIIT also inflates your MAGI for IRMAA purposes — with a two-year lag. That $500K stock sale in 2026 hits your 2028 Medicare premiums. At $691K MAGI (our Dallas filer), she’d land in the $193K–$500K IRMAA tier, paying $591.90/month for Part B instead of $185.00/month — an extra $4,883/year in Medicare premiums.
NIIT is the visible hit. IRMAA is the delayed hit. Together on a single $500K gain: ~$19K in NIIT now plus ~$4,900 in IRMAA two years later. Plan both simultaneously.
Common NIIT myths that cost money
Myth: “My capital gains are taxed at 15%, full stop.”
Only if your MAGI is below $200K (single) or $250K (MFJ). Above those thresholds, the effective federal rate on long-term gains is 18.8% (15% + 3.8%) or 23.8% (20% + 3.8%). Every capital gains estimate that ignores NIIT understates the bill.
Myth: “Roth IRA distributions trigger NIIT.”
They don’t. Qualified Roth distributions are excluded from both AGI and NII. Neither the withdrawal nor the growth is subject to NIIT. This is one more reason Roth assets are valuable in retirement — they don’t push you into NIIT territory the way Traditional IRA RMDs push your MAGI up (even though the RMD itself isn’t NII, the higher MAGI can expose other investment income to the surtax).
Myth: “Municipal bond interest avoids NIIT.”
Partially true. Tax-exempt interest is excluded from net investment income, so you don’t pay 3.8% on the muni interest itself. But tax-exempt interest is also excluded from MAGI for NIIT purposes — so it doesn’t push you over the threshold either. Munis genuinely avoid NIIT on both fronts, which makes them more attractive for high-MAGI investors than the coupon rate alone suggests.
The bottom line
The 3.8% NIIT turns a 15% or 20% federal capital gains rate into 18.8% or 23.8% — and the $200K/$250K thresholds haven’t moved since 2013. On a $500K gain, that’s roughly $19,000 that doesn’t show up in any LTCG bracket table. Before any large stock sale, real estate closing, or business exit, calculate your projected MAGI for the year, check whether you’re above the threshold, and model whether timing adjustments (installment sale, loss harvesting, retirement contributions) can reduce the NIIT bite. The 3.8% may be a surtax, but on six-figure gains, it produces a five-figure bill.
Join the 2026 tax newsletter
Decision checklists + key 2026 federal/state numbers. Free, one click.
Frequently asked
The NIIT is a 3.8% surtax under IRC § 1411 that applies to the lesser of your net investment income or your modified adjusted gross income (MAGI) above $200,000 (single), $250,000 (married filing jointly), or $125,000 (married filing separately). Net investment income includes capital gains, dividends, interest, rental income (with exceptions), royalties, and passive activity income. The thresholds are NOT inflation-adjusted — they’ve been fixed since 2013, which means more filers cross them every year.
For NIIT purposes, MAGI is your adjusted gross income (line 11 of Form 1040) plus any net foreign earned income exclusion under IRC § 911. For most domestic filers with no foreign earned income exclusion, MAGI equals AGI. The key difference from the IRMAA or ACA premium subsidy MAGI calculations is that NIIT MAGI does not add back tax-exempt interest. However, NIIT MAGI does include capital gains, making a large stock sale or real estate transaction the most common trigger.
Yes. The NIIT is additive. A single filer with taxable income above $533,400 (2026) pays 20% LTCG plus 3.8% NIIT for a combined federal rate of 23.8% on long-term capital gains. Even filers in the 15% LTCG bracket can owe NIIT if their MAGI exceeds $200K (single) or $250K (MFJ), producing an effective 18.8% federal rate on those gains.
It depends on your participation level. Rental income is generally treated as passive income and is subject to NIIT. However, if you qualify as a real estate professional under IRC § 469(c)(7) — meaning you spend 750+ hours per year in real property trades or businesses and more than half your working time is in real estate — AND you materially participate in each rental activity, that rental income is non-passive and excluded from NIIT. This is one of the largest NIIT planning levers for real estate investors.
Yes, through above-the-line deductions that reduce AGI. The most effective tools: maximizing 401(k) contributions ($24,500 in 2026, plus $8,000 catch-up for age 50+), HSA contributions ($4,400 self-only or $8,750 family in 2026), and self-employed retirement plans (SEP-IRA up to $73,500). For capital gains specifically, an installment sale election under IRC § 453 can spread the gain across multiple tax years, potentially keeping each year’s MAGI below the threshold. Charitable contributions reduce taxable income but do NOT reduce AGI for NIIT purposes if taken as itemized deductions.
When you sell rental property, you face three layers of federal tax: (1) unrecaptured Section 1250 gain taxed at a maximum 25% rate on prior depreciation, (2) remaining long-term capital gain taxed at 15% or 20%, and (3) the 3.8% NIIT on both layers if your MAGI exceeds the threshold. On a $400K gain with $150K of depreciation recapture, a single filer above $200K MAGI owes up to $37,500 on the recapture (25%), $50,000 on the remaining $250K gain (20%), plus $15,200 in NIIT (3.8% × $400K) — total $102,700, a 25.7% effective rate.
Related guides
NIIT § 1411 Surcharge: Avoidance Strategies for High Earners
Deep dive into the full range of NIIT reduction strategies beyond the basics covered here — including charitable remainder trusts, opportunity zone deferrals, and net operating loss timing.
Installment Sale on a $2M Business Sale: Spreading Gains Across 5 Years
The installment sale election is one of the most effective NIIT reduction tools — this post walks through the mechanics of spreading a large gain to keep annual MAGI below the threshold.
IRMAA Cliffs: How Roth Conversions Stay Under $103K and Save $4K+/yr in Medicare
Large capital gains that trigger NIIT also push you into IRMAA surcharges two years later — coordinate both when planning a stock sale or Roth conversion.
Real Estate Professional Status: IRS Material Participation Rules
REPS is the primary way rental income escapes the 3.8% NIIT — but the 750-hour test and material participation requirements are heavily audited.
Backdoor Roth IRA for $250K Earners: Navigating the Pro-Rata Rule
High earners dealing with NIIT are often also doing backdoor Roth conversions — watch how the conversion income interacts with your MAGI for NIIT purposes.
Join the Life Money USA newsletter
Decision checklists, 2026 federal + state numbers, and our glossary. One click, free.
Join the newsletter