This article reflects federal rules as of June 2026 and covers tax year 2025. The Net Investment Income Tax is a federal tax only — states do not impose it, though many tax the underlying investment income. Tax law changes — confirm current figures before you file. This guide is educational and is not a substitute for advice from a licensed CPA or tax attorney about your specific situation.
Quick Answer
You avoid the 3.8% NIIT legally by keeping your modified adjusted gross income (MAGI) under the 2025 threshold — $200,000 single, $250,000 married filing jointly, $125,000 married filing separately — or by shrinking your net investment income. Use retirement contributions, loss harvesting, tax-exempt bonds, installment sales, and material participation. You pay 3.8% only on the smaller of your excess MAGI or your net investment income.
The NIIT is a quiet tax. It does not show up on a W-2, and most people never hear about it until they sell a stock, a rental, or a business and watch an extra 3.8% bite into the gain. The tax applies to the lesser of your net investment income (NII) or the amount your MAGI rises above your filing-status threshold, as the 2025 Instructions for Form 8960 spell out. That single word — lesser — is the key to every legal escape route in this guide.
The stakes are real and growing. The Tax Policy Center notes the NIIT raises tens of billions of dollars a year, almost entirely from households in the top income brackets, because the thresholds have never been indexed for inflation since the tax began in 2013. That means each year, normal wage growth and rising home and stock values pull more middle-upper earners into a tax that was first sold as something only the wealthy would pay.
Here is what you will learn:
- 🧮 How the “lesser of two numbers” rule decides whether you owe a penny — and how to push both numbers down.
- 💰 Worked examples with real dollar figures showing a single seller, a couple selling a rental, and a business owner cutting their bill to zero.
- 🏠 How material participation and real estate professional status turn taxable “passive” income into NIIT-free income.
- 📉 The MAGI-lowering moves — 401(k), HSA, installment sales, muni bonds — that keep you below the cliff.
- ⚠️ The seven mistakes that quietly create a NIIT bill you could have avoided.
What the NIIT Actually Is
The Net Investment Income Tax is a 3.8% federal surtax created by Section 1411 of the Internal Revenue Code. It was passed in 2010 and took effect in 2013 to help fund health care reform, which is why some people still call it the “Medicare surtax on investment income.” It sits on top of your regular income tax and your capital gains tax.
The plain-English version is this: if your income is high enough and you earned money from investments, the IRS charges an extra 3.8% on some of that investment money. The consequence of ignoring it is a surprise balance due plus possible underpayment penalties, because the tax is not withheld from your paycheck and many people forget to make estimated payments. A reader who sells a $300,000 stock gain and budgets only for capital gains tax can be short by more than $11,000 when the NIIT lands.
The most common misconception is that the NIIT is a flat 3.8% on all your investment income. It is not. You pay 3.8% only on the smaller of two numbers, so a modest amount of investment income or a MAGI just barely over the line can produce a tiny bill — or none at all. What you should do about it is run the two-number test below before you sell anything large, so the number never surprises you.
The Two Numbers That Decide Everything
Your entire NIIT bill comes down to comparing two figures and taxing the lesser one. Understanding this is what makes every strategy in this article work.
Number One: Your Net Investment Income
Net investment income (NII) is the money your money makes. Per the Form 8960 instructions, it generally includes interest, dividends, capital gains, rental and royalty income, non-qualified annuity income, and income from passive businesses. You reduce it by expenses tied to that income, such as investment interest and rental costs.
Just as important is what is not NII. Wages, self-employment income, Social Security benefits, tax-exempt interest, and distributions from qualified retirement plans like 401(k)s and IRAs are all excluded. This exclusion list is the source of several legal strategies — if you can convert taxable investment income into one of these excluded categories, it leaves your NII entirely.
Number Two: Your MAGI Over the Threshold
The second number is how far your modified adjusted gross income climbs above your filing-status threshold. For tax year 2025, the IRS thresholds are $200,000 for single or head of household, $250,000 for married filing jointly, and $125,000 for married filing separately. For most people, MAGI is simply their adjusted gross income, since the add-backs mainly affect Americans living abroad.
These thresholds are not indexed for inflation, which is the single most important planning fact in this guide. They have stayed frozen since 2013, so each year more households cross them through ordinary raises and market growth. If your MAGI lands $1 over the line, only that $1 of excess can be taxed — even if your NII is huge.
Which Situation Applies to You?
The right strategy depends on why you are over the threshold and what kind of investment income you have. Find yourself below.
- You are a high-earning W-2 employee with a brokerage account. Your wages alone may push MAGI over the line, so your best levers are lowering MAGI (401(k), HSA) and trimming NII (loss harvesting, muni bonds). See the MAGI and NII sections.
- You sold or are selling a rental property. Look at the 1031 exchange, installment sale, and real estate professional sections — these can defer or fully remove the gain from NII.
- You own a business taxed as a partnership or S corporation. Material participation is your single biggest lever, because active business income is not NII. See the material participation section.
- You are a retiree managing withdrawals. Roth conversions raise MAGI today but lower future taxable income; qualified charitable distributions and careful withdrawal timing keep you under the cliff. See the timing and charity sections.
- You are near the threshold in some years but not others. Bunching income into one year and starving it in the next can keep you below the line most years. See the timing strategy.
Strategy 1 — Lower Your MAGI Below the Threshold
The cleanest way to avoid the NIIT is to keep your MAGI under your threshold, because if MAGI never crosses the line, you owe zero NIIT no matter how large your investment income is. This is the “second number is zero” route.
Pre-tax retirement contributions are the workhorse here. Money you defer into a 401(k), 403(b), or SEP plan lowers your AGI dollar-for-dollar, and for 2025 the employee 401(k) deferral limit is $23,500 (plus a $7,500 catch-up if you are 50 or older). A health savings account adds another $4,300 for self-only or $8,550 for family coverage in 2025, per the IRS HSA limits. The consequence of skipping these is not just lost retirement savings — it can be the difference between sitting under the threshold and triggering the full surtax.
A common misconception is that these contributions reduce your investment income. They do not; they reduce MAGI, which attacks the second number. What you should do is max out pre-tax accounts before year-end, since most cannot be funded retroactively after December 31 (the HSA and SEP IRA are limited exceptions with later deadlines).
A Worked Example: The 401(k) Save
Consider a single filer with MAGI of $215,000 and $30,000 of dividends and interest as NII. The excess over the $200,000 threshold is $15,000, so she owes 3.8% on the lesser of $30,000 and $15,000, which is $15,000 — a bill of $570. If she defers $23,500 into her 401(k), her MAGI drops to roughly $191,500, below the threshold, and her NIIT falls to $0. One retirement contribution erased the entire tax.
Strategy 2 — Shrink Your Net Investment Income
When you cannot get MAGI under the line, attack the first number instead. If your NII is smaller than your excess MAGI, the NIIT is charged on the NII — so shrinking NII shrinks the bill directly.
Tax-loss harvesting is the most reliable tool. Selling losing investments to offset realized gains lowers your net capital gain, which lowers NII, and as Charles Schwab explains on loss harvesting, up to $3,000 of net losses can also offset ordinary income each year with the rest carried forward. The consequence of not harvesting is paying the surtax on gains you could have offset with paper losses you already hold. Watch the wash-sale rule, which disallows the loss if you buy a substantially identical security within 30 days before or after the sale.
Tax-exempt bonds attack NII from the other direction. Interest from municipal bonds is excluded from gross income, so it never counts as NII and never appears in MAGI either, making it a double win for someone hovering near the threshold. The trade-off is that munis usually pay lower yields, so you should compare the after-tax return against a taxable bond before shifting your portfolio.
A Worked Example: Harvesting Losses
Maria is single with $150,000 in wages and a $120,000 long-term capital gain from selling stock, giving her a MAGI of $270,000 and NII of $120,000. Her excess over $200,000 is $70,000, so she owes 3.8% on the lesser of $120,000 and $70,000, which is $70,000 — a NIIT of $2,660. If she harvests $40,000 of losses elsewhere in her portfolio, her NII drops to $80,000 and her MAGI to $230,000; she now owes 3.8% on $30,000 of excess MAGI, or $1,140. The harvest saved her $1,520.
Strategy 3 — Defer the Gain Entirely
Sometimes the best move is to not realize the income this year at all. Deferral keeps the gain out of both numbers for the current tax year.
A Section 1031 like-kind exchange lets a real estate investor roll the gain from one investment property into another without recognizing it now. Because no gain is recognized, none of it enters NII or MAGI for the year, so the NIIT on that sale is deferred — potentially forever if the property is held until death and the basis steps up. The consequence of botching the 45-day identification or 180-day closing deadlines is a fully taxable sale, so the timing rules are strict and unforgiving.
An installment sale under Section 453 spreads the gain across several years as payments arrive. By splitting a large gain into smaller annual slices, you may keep MAGI under the threshold in each individual year, avoiding the cliff entirely. The misconception here is that installment sales always help; if the buyer pays a huge down payment, you can still spike over the line in year one, so model the cash flow first.
A Worked Example: The 1031 Exchange
David and Susan file jointly with $230,000 in wages and a $100,000 passive gain from selling a rental, giving MAGI of $330,000 and NII of $100,000. The excess over $250,000 is $80,000, so they owe 3.8% on the lesser of $100,000 and $80,000, which is $80,000 — a NIIT of $3,040. If they instead complete a 1031 exchange into a replacement rental, the gain is not recognized, MAGI stays at $230,000 (below threshold), and the NIIT is $0 this year.
Strategy 4 — Turn Passive Income Into Active Income
This is the most powerful and most overlooked strategy for business owners and active landlords. Income from a trade or business in which you materially participate is generally not net investment income, per Section 1411(c) and the Form 8960 rules.
Material participation means you are involved in the business on a regular, continuous, and substantial basis — most commonly by meeting one of the Section 469 material participation tests, such as working more than 500 hours in the activity during the year. The consequence of clearing this bar is dramatic: income that would otherwise be passive NII becomes active, nonpassive income that escapes the NIIT entirely. The catch is that wages and self-employment income are taxed in other ways, so this avoids the NIIT specifically, not all tax.
For rental real estate, a similar door exists through real estate professional status. If you qualify as a real estate professional and meet the safe harbor — participating more than 500 hours per year in the rental activity, or in 5 of the prior 10 years — your rental income is treated as earned in an ordinary trade or business and is excluded from NII. The misconception is that simply qualifying as a real estate professional is enough; the IRS instructions stress you must also clear the participation safe harbor or otherwise prove the activity is a real trade or business.
A Worked Example: Becoming Active
James files jointly with $100,000 in wages and $200,000 of S-corporation income that he currently reports as passive because he is a silent owner; his MAGI is $300,000 and NII is $200,000. The excess over $250,000 is $50,000, so he owes 3.8% on the lesser of $200,000 and $50,000, which is $50,000 — a NIIT of $1,900. If he begins materially participating (working over 500 hours running the business), that $200,000 becomes active income, drops out of NII, and his NIIT falls to $0.
Strategy 5 — Use Charity and Timing
Two softer levers round out the toolkit. Donating appreciated securities directly to a qualified charity lets you avoid realizing the capital gain altogether, which keeps that gain out of NII, as Fidelity Charitable explains on appreciated-stock gifts. Note that the charitable deduction itself does not reduce NII for NIIT purposes — the benefit is dodging the gain in the first place.
For retirees over 70½, a qualified charitable distribution (QCD) sends IRA money straight to charity, satisfying required minimum distributions without raising AGI or MAGI. Income timing — bunching capital gains into a single year and taking little in the next, or delaying a Roth conversion to a lower-income year — can keep MAGI under the threshold in most years.
Three Common NIIT Scenarios
Below are the three situations readers ask about most, shown as the trigger and the legal fix.
Selling a Highly Appreciated Stock Position
| What Triggers the NIIT | The Legal Fix |
|---|---|
| A large realized capital gain pushes both NII and MAGI up in one year | Harvest offsetting losses, spread sales across two tax years, or gift appreciated shares to charity |
| The gain is taxed at 3.8% on top of 15–20% capital gains rates | Time the sale into a year your wages or other income are lower to keep MAGI under the threshold |
Selling a Rental Property
| What Triggers the NIIT | The Legal Fix |
|---|---|
| Passive rental gain counts fully as NII | Use a Section 1031 exchange to defer, or qualify as a real estate professional to exclude it |
| A lump-sum sale spikes MAGI in one year | Use an installment sale under Section 453 to spread the gain across multiple years |
High Wages Plus a Brokerage Account
| What Triggers the NIIT | The Legal Fix |
|---|---|
| Salary alone exceeds the threshold, so all NII is exposed | Max out pre-tax 401(k) and HSA contributions to pull MAGI back down |
| Taxable bond interest swells NII | Shift to municipal bonds whose interest is excluded from NII and MAGI |
Three Named Examples
Priya, a single software engineer, earns $185,000 and has $40,000 of dividends and gains. Her MAGI of $225,000 exceeds the $200,000 threshold by $25,000, so she owes 3.8% on the lesser of $40,000 and $25,000 — about $950. By deferring $23,500 into her 401(k), she drops MAGI to roughly $201,500, cutting the taxed amount to $1,500 and the NIIT to about $57.
Marcus and Lena, a married couple, sell a vacation rental for a $120,000 passive gain on top of $200,000 in wages. Their MAGI of $320,000 exceeds $250,000 by $70,000, so they owe 3.8% on $70,000 — $2,660. Choosing an installment sale that spreads the gain over four years keeps each year’s MAGI near the threshold and trims the surtax sharply.
Robert, a semi-retired consultant, holds an S-corporation stake he treats as passive, generating $90,000 of NII against a MAGI of $310,000 (joint). He owes 3.8% on the lesser of $90,000 and $60,000 — $2,280. By logging more than 500 hours and materially participating, the income turns active and drops out of NII, erasing the bill.
How the NIIT Is Reported: Form 8960
You calculate and report the NIIT on Form 8960, which you attach to your Form 1040 by the regular April 15 filing deadline (or the extended October deadline if you file Form 4868). Part I totals your investment income, Part II subtracts allowable deductions, and Part III applies the 3.8% rate to the lesser of your NII or your excess MAGI. The form flows from your other schedules — for capital gains you will first complete Form 8949 and Schedule D, and rental income comes from Schedule E.
Because no NIIT is withheld from wages, the consequence of waiting until April is often an underpayment penalty. What you should do is make quarterly estimated payments using Form 1040-ES in any year you expect a large gain, so the IRS is paid as the income is earned.
Does Your State Tax This?
The NIIT itself is purely federal — no state imposes its own 3.8% net investment income tax. But states do tax the underlying investment income through their regular income tax, and conformity varies widely.
High-tax states like California and New York tax capital gains, dividends, and interest as ordinary income, so a stock sale that triggers the federal NIIT also faces full state tax — though never an additional state NIIT. No-income-tax states such as Florida, Texas, Washington (which taxes only certain large capital gains), Nevada, and Tennessee do not tax this investment income at the state level at all, which is a genuine and complete advantage for residents there. The misconception is that moving to a no-tax state avoids the NIIT; it does not, because the NIIT is federal and follows you to all 50 states.
Mistakes to Avoid
- Forgetting estimated payments. Because NIIT is not withheld, you can owe an underpayment penalty even if you pay in full by April.
- Triggering a wash sale. Buying back a substantially identical security within 30 days disallows your harvested loss, so the NII reduction vanishes.
- Assuming the deduction helps. Charitable contributions and mortgage interest do not reduce NII, so do not count on them to lower the surtax.
- Selling everything in one year. A single large sale spikes both numbers; spreading it across two tax years often keeps MAGI under the cliff.
- Confusing real estate professional status with the NIIT safe harbor. Qualifying as a real estate professional alone does not exclude rental income; you must also meet the participation safe harbor.
- Treating a Roth conversion as free. Conversions raise MAGI in the conversion year and can push other investment income into NIIT range.
- Ignoring the married-filing-separately trap. The MFS threshold is only $125,000, so separating returns can create a NIIT bill that filing jointly would have avoided.
Do’s and Don’ts
Do’s – Do run the two-number test before any large sale, because the smaller number is all you can be taxed on. – Do max pre-tax retirement and HSA accounts by year-end, since they lower MAGI dollar-for-dollar. – Do harvest losses against gains, because it directly shrinks NII. – Do consider municipal bonds near the threshold, as their interest stays out of both NII and MAGI. – Do make quarterly estimated payments in big-gain years, to dodge the underpayment penalty.
Don’ts – Don’t assume the NIIT is 3.8% of all investment income, because it is only on the lesser of two numbers. – Don’t buy back the same security within 30 days, or you forfeit the harvested loss. – Don’t file separately without modeling it, since the $125,000 threshold can backfire. – Don’t forget the 1031 deadlines, because missing 45 or 180 days makes the whole gain taxable. – Don’t rely on the charitable deduction to cut NII, because it does not.
Pros and Cons of Aggressive NIIT Planning
Pros – Real dollar savings, because eliminating the surtax on a large gain can save thousands per year. – Compounding benefits, since retirement and HSA contributions also build long-term wealth. – Lower overall tax, as many MAGI moves cut income tax and NIIT together. – Deferral flexibility, because installment sales and 1031 exchanges let you choose your tax year. – Cleaner cash flow, since estimated payments avoid a surprise April bill.
Cons – Liquidity is locked up, because retirement and 1031 strategies tie up your money. – Complexity and cost, since material participation logs and 1031 timing often require a professional. – Lower muni yields, as tax-exempt bonds usually pay less than taxable ones. – Audit attention, because real estate professional and grouping claims draw IRS scrutiny. – Rules can change, since lawmakers have floated expanding the NIIT to active business income.
What to Do Next
- Estimate both numbers now. Add up your projected NII and your projected MAGI, then compare the excess to your NII to see which is smaller — that is your taxable base.
- Fund pre-tax accounts before December 31. Max your 401(k) and HSA to pull MAGI down, since most cannot be funded after year-end.
- Harvest losses by year-end. Review your brokerage for paper losses to offset realized gains, avoiding wash sales.
- Model any large sale across tax years. Before selling a property or big stock position, test installment-sale or 1031 timing with a tax pro.
- Set up estimated payments. In any year you expect a surtax, file Form 1040-ES quarterly to avoid penalties.
- Call a CPA for complex moves. Material participation, real estate professional status, and 1031 exchanges are audit-sensitive and worth professional help, which typically runs a few hundred to a few thousand dollars.
Frequently Asked Questions
What is the NIIT threshold for 2025?
$200,000 for single or head of household, $250,000 for married filing jointly, and $125,000 for married filing separately for tax year 2025. These figures are not indexed for inflation and have been frozen since 2013.
Is the NIIT 3.8% of all my investment income?
No. You pay 3.8% only on the lesser of your net investment income or the amount your MAGI exceeds your threshold. A small overage or small NII can mean little or no tax.
Does a 401(k) contribution reduce the NIIT?
Yes, indirectly. Pre-tax 401(k) contributions lower your MAGI, and if that pushes MAGI under your threshold, your NIIT can drop to zero even though the contribution does not touch your investment income.
Are Social Security benefits subject to the NIIT?
No. Social Security benefits, wages, and self-employment income are all excluded from net investment income, though wages still count toward your MAGI for the threshold test.
Do Roth IRA withdrawals count toward the NIIT?
No. Qualified distributions from Roth IRAs, traditional IRAs, and 401(k)s are excluded from net investment income, though a Roth conversion raises your MAGI in the conversion year.
Can I avoid the NIIT by moving to a no-tax state?
No. The NIIT is a federal tax that applies in all 50 states. Moving to Florida or Texas avoids state income tax on investments but never the federal 3.8% surtax.
Does selling my primary home trigger the NIIT?
Usually no for most homeowners. The capital-gains exclusion of $250,000 single or $500,000 joint keeps the excluded gain out of NII; only gain above the exclusion can be subject to the surtax.
Is rental income always subject to the NIIT?
Not always. Rental income is generally passive NII, but it is excluded if you qualify as a real estate professional and meet the safe harbor, or if the rental is part of a nonpassive trade or business.
Which form reports the NIIT?
Form 8960, attached to your Form 1040 by the April 15 deadline. It totals your investment income, subtracts allowable deductions, and applies 3.8% to the lesser of NII or excess MAGI.
Do capital losses reduce the NIIT?
Yes. Capital losses offset capital gains to lower your net investment income, and up to $3,000 of net losses can offset ordinary income each year, with the remainder carried forward.
Does the NIIT apply to a business I actively run?
No, generally. Income from a trade or business in which you materially participate is not net investment income, so active business owners who clear the participation tests avoid the surtax on that income.
Can married couples be hurt by filing separately?
Yes. The married-filing-separately threshold is only $125,000 for 2025, far below the $250,000 joint figure, so separating returns can create a NIIT bill that filing jointly would have avoided.
Related reading
- How to Fill Out IRS Form 8960 (w/Examples) + FAQs
- Are Annuity Payments Subject to the 3.8% NIIT? (w/Examples) + FAQs
- Can an Installment Sale Lower the NIIT on a Big Gain? (w/Examples) + FAQs
- Can Timing Your Income Keep You Under the NIIT Threshold? (w/Examples) + FAQs
- Do Retirees Owe the 3.8% NIIT? (w/Examples) + FAQs
- How Do You Report the NIIT on Form 8960? (w/Examples) + FAQs
- What’s Your AMT Cost Basis After Exercising ISOs? (w/Examples) + FAQs