This article reflects federal rules as of June 2026 and covers tax year 2025 (returns filed in 2026). State rules are addressed separately below. Tax law changes — confirm current figures with IRS.gov or a licensed professional before you file.
Quick Answer
Usually no. For tax year 2025, the gain you exclude under the Section 121 home-sale exclusion — up to $250,000 (single) or $500,000 (married filing jointly) — is not hit by the 3.8% Net Investment Income Tax. Only taxable gain above your exclusion, and only if your MAGI tops the threshold, can trigger it.
So for most people selling their main home, the dreaded 3.8% surtax never shows up. The trap is the taxable slice of gain — the part above your exclusion, or any sale of a rental or second home — combined with a modified adjusted gross income (MAGI) over $200,000 single or $250,000 married. When a big sale pushes you over that line, the tax lands on the smaller of two numbers, and the result surprises sellers every spring.
Here, profit from a home sale becomes a problem only in specific, predictable situations — and once you see the math, you can plan around most of it before you sign the closing papers.
- 🏠 How the Section 121 exclusion shields most home-sale profit from the 3.8% surtax entirely.
- 🧮 The exact “lesser-of” formula the IRS uses on Form 8960, with worked dollar examples.
- 💰 When a primary home, rental, or second home crosses the line into a taxable NIIT event.
- 🗺️ Which situation applies to you — homeowner, landlord, heir, or vacation-home seller.
- 🚫 The 7 costliest mistakes that turn a tax-free sale into a five-figure bill.
What the 3.8% NIIT Actually Is
The Net Investment Income Tax is a 3.8% federal surtax created by Section 1411 of the tax code. It is sometimes called the “Medicare surtax” because it helps fund Medicare, but it is not payroll tax — it is an income tax that sits on top of your regular and capital gains tax. It started in 2013 and the 2025 tax law did not change its rate or its thresholds.
The tax applies to net investment income, which includes interest, dividends, rents, royalties, annuities, and — the part that matters here — capital gains, including the taxable gain from selling property. Wages and self-employment income are not investment income, but they still count toward the MAGI test that decides whether the surtax applies at all.
The rate is fixed at 3.8% for tax year 2025. There is no inflation indexing on the income thresholds, which is why more households drift into NIIT range each year as home prices and incomes rise. In 2025, about 7.7 million returns reported AGI above $500,000, the income band where NIIT bites hardest.
The consequence of ignoring NIIT is simple and expensive: on a $200,000 taxable gain fully exposed to the surtax, you owe an extra $7,600 on top of your capital gains tax. The misconception is that NIIT is a separate “rich person’s tax” you can opt out of — you cannot; it is calculated automatically on Form 8960 and attached to your Form 1040. What you should do is check your MAGI before you sell, because timing and basis decisions made before closing are the only real levers you have.
The two tests that must BOTH be true
NIIT never applies on income alone or on a sale alone. It applies only when two conditions are met in the same year. First, you must have net investment income — for a home sale, that means taxable gain left over after the Section 121 exclusion. Second, your MAGI must exceed your filing-status threshold.
If either test fails, you owe zero NIIT. A retiree with a huge home-sale gain but low MAGI can escape it; a high earner with no taxable investment income also escapes it. The consequence of forgetting this “both must be true” rule is panic over a tax you may not even owe — or worse, an unplanned sale that triggers one you could have avoided.
The Section 121 Exclusion: Your Main Shield
Section 121 lets you exclude gain on the sale of your principal residence from gross income. For tax year 2025, the exclusion is up to $250,000 of gain for single filers and $500,000 for married couples filing jointly. Because the IRS says NIIT “does not apply to any amount of gain that is excluded from gross income,” every dollar you exclude under Section 121 is also invisible to the 3.8% surtax.
To qualify, you must pass the ownership and use test: you owned the home and lived in it as your main home for at least 24 months out of the 5 years before the sale. The 24 months do not have to be continuous. You also generally cannot have used the exclusion on another home sale within the prior 2 years.
The consequence of missing the use test is severe — fail it and your entire gain becomes taxable and potentially NIIT-exposed, not just the part above the cap. A common misconception is that the exclusion applies to the sale price; it does not — it applies to the gain (sale price minus your adjusted basis). What you should do is calculate your adjusted basis carefully, because every improvement you add to basis shrinks the gain that NIIT can ever touch.
How the exclusion and NIIT interact
The order of operations is what protects you. First, you calculate gain. Second, you subtract the Section 121 exclusion. Only the remaining taxable gain flows into the NIIT calculation on Form 8960.
This means a married couple with a $480,000 gain on their main home owes zero NIIT on that sale — the entire gain is excluded, so there is no investment income to tax. But a married couple with a $700,000 gain excludes $500,000 and carries $200,000 of taxable gain into the NIIT math. The consequence of not understanding this layering is overpaying out of fear, or underpaying and facing an accuracy-related penalty of 20% on the underpayment.
The “Lesser-Of” Formula That Decides Your Bill
When you do have taxable gain and your MAGI is over the threshold, the 3.8% does not automatically apply to the whole gain. NIIT applies to the lesser of two amounts:
- Your total net investment income, or
- The amount your MAGI exceeds your threshold.
For tax year 2025, the MAGI thresholds are $200,000 (single or head of household), $250,000 (married filing jointly or qualifying surviving spouse), and $125,000 (married filing separately). These are not adjusted for inflation.
The consequence of this formula is that a seller whose MAGI is only slightly over the threshold pays NIIT on a small slice, even with a large gain. A common misconception is that the surtax hits the full gain — it rarely does. What you should do is run both numbers; the smaller one times 3.8% is your tax.
Worked example — married couple, big gain
Tom and Linda (married filing jointly) sell their main home for an $800,000 gain in 2025. Their other income (wages, dividends) is $260,000.
- Gain: $800,000. Minus the $500,000 exclusion = $300,000 taxable gain.
- MAGI = $260,000 other income + $300,000 taxable gain = $560,000.
- Excess over $250,000 threshold = $310,000.
- Net investment income (the taxable gain plus any dividends) ≈ $300,000+.
- NIIT applies to the lesser — here, $300,000 of net investment income (less than the $310,000 excess).
- NIIT = 3.8% × $300,000 = $11,400.
That $11,400 sits on top of their long-term capital gains tax, likely at the 20% rate plus their state tax. The lesson: the $500,000 exclusion saved them 3.8% on half a million dollars of gain — roughly $19,000 in surtax avoided.
Which Situation Applies to You?
The answer depends entirely on what you are selling and your income. Find your case below, then read the matching section.
- Selling your main home, gain under the cap, any income: No NIIT. The exclusion covers you. Skip to Mistakes to Avoid.
- Selling your main home, gain over the cap, MAGI over threshold: Possible NIIT on the excess gain. See the lesser-of formula above.
- Selling a rental or investment property: No Section 121 exclusion. Full taxable gain is investment income — see the rental section.
- Selling a second home or vacation home: No exclusion. Treated like an investment sale — see the vacation-home section.
- Selling an inherited home: Stepped-up basis often erases most gain. See the inherited-home section.
- Selling a home used partly as a rental or home office: Mixed treatment — depreciation recapture and partial exclusion apply. See below.
Selling a Rental or Investment Property
There is no Section 121 exclusion on a pure rental property, so the entire taxable gain is net investment income for NIIT purposes. Landlords face the surtax whenever their MAGI exceeds the threshold and the sale produces gain. This is the most common way real estate sellers get caught.
You must also handle depreciation recapture. The depreciation you claimed (or were allowed to claim) while renting is “recaptured” and taxed at up to 25% as ordinary-rate gain — and that recaptured amount is also net investment income for NIIT. The consequence of forgetting recapture is a tax bill far larger than expected, because the IRS taxes depreciation you took even if it did not save you much at the time.
A narrow escape exists: if you are a real estate professional who materially participates, rental income and gain may be treated as non-passive trade-or-business income and excluded from NIIT. This is a high bar with strict hour tests. What you should do before selling a rental is pull your depreciation schedule and model the recapture, because that single number often drives the entire NIIT result.
Worked example — landlord selling a rental
Maria (single) sells a rental for a $250,000 gain, of which $60,000 is depreciation recapture. Her other income is $190,000, so her MAGI = $190,000 + $250,000 = $440,000.
- Excess over $200,000 single threshold = $240,000.
- Net investment income = $250,000 (the full gain, including recapture).
- NIIT applies to the lesser, $240,000.
- NIIT = 3.8% × $240,000 = $9,120, on top of capital gains tax and the 25% recapture tax.
Selling a Second Home or Vacation Home
A second or vacation home gets no Section 121 exclusion because it is not your principal residence. The full long-term gain is taxable and counts as net investment income, so the 3.8% surtax applies whenever your MAGI clears the threshold.
The consequence is that vacation-home sellers — often higher earners by definition — are squarely in NIIT territory. A common misconception is that “I lived there sometimes” qualifies the home for the exclusion; only your main home does, and only one home can be your main home at a time. What you should do is consider converting a second home into your principal residence for at least 2 of the 5 years before selling, though the exclusion is then reduced for any period of “non-qualified use” as a vacation home.
Selling an Inherited Home
When you inherit a home, your basis is “stepped up” to the home’s fair market value on the date of the prior owner’s death. This often wipes out most or all gain, because you are taxed only on appreciation after you inherited it.
If you sell soon after inheriting, gain is usually small and NIIT is rarely an issue. The consequence of not getting a date-of-death appraisal is a missing basis figure that can cost you thousands in overstated gain. What you should do is order a formal valuation at the time of inheritance — it is the single most valuable record for limiting any future NIIT.
Homes Used Partly as a Rental or Home Office
If you rented out part of your home or claimed a home-office deduction, the treatment splits. Gain attributable to the personal-residence portion can still use the Section 121 exclusion, but gain tied to the business or rental portion — plus any depreciation recapture — does not qualify and becomes net investment income.
The consequence is a partial NIIT exposure even on your main home. A common misconception is that the whole sale is shielded because it was your home; depreciation recapture is never excludable and is always taxable. What you should do is separate the business-use percentage and recapture amount before you file, because those two figures determine your taxable gain.
Three Common Scenarios
Scenario 1 — Main home, gain under the cap
| Seller Situation | NIIT Outcome |
|---|---|
| Married couple, $400,000 gain on main home, MAGI $300,000 | No NIIT — entire gain excluded under Section 121, so there is no investment income to tax |
| Single filer, $200,000 gain on main home, MAGI $500,000 | No NIIT — full $250,000 single exclusion covers the gain despite high income |
Scenario 2 — Main home, gain over the cap
| Seller Situation | NIIT Outcome |
|---|---|
| Single, $400,000 gain, MAGI $350,000 | $150,000 taxable gain after exclusion; NIIT on lesser of $150,000 or excess = 3.8% × $150,000 = $5,700 |
| Married, $700,000 gain, MAGI $560,000 | $200,000 taxable gain after exclusion; NIIT = 3.8% × $200,000 = $7,600 |
Scenario 3 — Investment property, no exclusion
| Seller Situation | NIIT Outcome |
|---|---|
| Landlord, $250,000 gain incl. recapture, MAGI $440,000 | Full gain is investment income; NIIT on lesser of $250,000 or $240,000 excess = 3.8% × $240,000 = $9,120 |
| Vacation home, $120,000 gain, MAGI $230,000 (single) | NIIT on lesser of $120,000 or $30,000 excess = 3.8% × $30,000 = $1,140 |
Three Named Examples
David, the high-earning single homeowner. David sells his San Diego condo for a $390,000 gain. His MAGI is $480,000. After his $250,000 exclusion, $140,000 is taxable. His excess over the $200,000 threshold is huge, so NIIT lands on the smaller $140,000 of net investment income: 3.8% × $140,000 = $5,320.
The Patels, retirees with low income. The Patels sell their longtime home for a $620,000 gain. After the $500,000 married exclusion, $120,000 is taxable. But their MAGI — even with the gain — is only $180,000, below the $250,000 married threshold. They owe $0 NIIT, because the second test fails.
Carlos, the accidental landlord. Carlos moved out and rented his old home for 4 years, then sold it. He fails the 2-of-5-year use test, so he loses the Section 121 exclusion entirely. His $180,000 gain plus $40,000 recapture is fully taxable investment income, and with MAGI of $310,000, he owes 3.8% × $220,000 = $8,360.
How to Report It on Form 8960
If your MAGI exceeds the threshold and you have net investment income, you file Form 8960 with your Form 1040. It is a single page in three parts.
- Part I — Investment Income: Report taxable capital gain from your home sale (the figure that flowed from Form 8949 and Schedule D), plus interest, dividends, and rents.
- Part II — Investment Expenses: Deduct allocable expenses such as state income tax on the investment income and investment interest.
- Part III — Tax Computation: Enter your MAGI, subtract your threshold, and the form applies 3.8% to the lesser of net investment income or the excess.
You first report the sale itself on Form 8949 and Schedule D; the taxable gain then carries to Form 8960. The consequence of leaving Form 8960 off when required is an IRS notice (often a CP2000) and interest on the unpaid surtax. The deadline is your normal return due date — April 15, 2026 for tax year 2025, or October 15 with an extension (which extends filing, not payment).
Federal vs. State: Does Your State Pile On?
NIIT is purely a federal tax — no state imposes its own version of Section 1411. But several states tax capital gains at high rates, and a couple add their own millionaire surtaxes that can stack on a big home-sale gain.
| Tax Layer | What Applies |
|---|---|
| Federal NIIT | 3.8% on the lesser of net investment income or MAGI over threshold, tax year 2025 |
| State capital gains | Varies — states like California tax gain as ordinary income up to 13.3%; nine states including Florida, Texas, and Washington have no income tax on most wage/gain income |
Some states, such as Massachusetts and California, add a 4% surtax on income over $1 million, which can hit a very large home-sale gain on top of federal NIIT. The consequence of ignoring your state is a tax bill that is far larger than the federal 3.8% alone. What you should do is check your state’s department of revenue page for capital-gains treatment before you sell.
Mistakes to Avoid
- Assuming the exclusion applies to the sale price. It applies to gain. Treating price as gain leads to wrong estimates and surprise bills.
- Forgetting to add improvements to basis. Skipping a new roof or addition inflates your gain and exposes more to NIIT — costing 3.8% of every unrecorded dollar.
- Missing the 2-of-5-year use test. Fall short and you lose the entire exclusion, turning a tax-free sale into a fully taxable one.
- Ignoring depreciation recapture on a former rental. Recapture is always taxable and always NIIT-eligible; overlooking it can understate tax by thousands.
- Thinking high income alone triggers NIIT. Without taxable investment income, there is nothing to tax — but assuming the reverse causes panic or overpayment.
- Selling two homes within 2 years. Using the exclusion twice in 24 months disqualifies the second sale, exposing all its gain.
- Leaving Form 8960 off the return. When required, omitting it draws an IRS notice plus a 20% accuracy penalty and interest.
Do’s and Don’ts
- Do calculate your adjusted basis with every improvement — it directly shrinks NIIT-exposed gain.
- Do run the lesser-of formula before closing — it tells you the real exposure, often far less than the full gain.
- Do order a date-of-death appraisal for inherited homes — stepped-up basis usually erases gain.
- Do keep records for at least 3 years after filing — the IRS can audit basis and exclusion claims.
- Do consult a CPA on a sale over $500,000 of gain — the depreciation and timing nuance pays for itself.
- Don’t assume your second home qualifies for the exclusion — only your principal residence does.
- Don’t ignore your state’s capital-gains rate — it can dwarf the 3.8% federal surtax.
- Don’t forget that filing extensions delay filing, not payment — interest accrues from April 15.
- Don’t treat depreciation recapture as excludable — it never is.
- Don’t trigger the sale in your highest-income year if you can spread or time it — MAGI drives the tax.
Pros and Cons of the Current Rules
- Pro: The Section 121 exclusion shields most homeowners completely, because typical gains stay under the cap.
- Pro: The lesser-of formula limits the surtax for those just over the threshold, since it taxes the smaller figure.
- Pro: Stepped-up basis protects heirs, because they are taxed only on post-inheritance appreciation.
- Pro: Real estate professionals may avoid NIIT on rentals, since material participation makes the income non-passive.
- Pro: The rate is flat and predictable at 3.8%, so the math is easy to model in advance.
- Con: The thresholds are not inflation-indexed, so more sellers drift into NIIT range each year.
- Con: The exclusion has not risen since 1997, while home values have soared, exposing more gain.
- Con: Depreciation recapture on rentals is always taxed, removing a key planning option.
- Con: A single large sale can spike MAGI for one year, triggering tax that steady income would not.
- Con: Vacation and second-home sellers get no shield, so the full gain is exposed.
What to Do Next
- Calculate your gain — subtract your adjusted basis (purchase price plus improvements) from your expected net sale price.
- Apply the Section 121 exclusion if it is your main home and you pass the 2-of-5-year test.
- Estimate your MAGI for the sale year, including the taxable gain, and compare it to your threshold.
- Run the lesser-of formula to size your real NIIT exposure before you sign.
- Gather records — closing statements, improvement receipts, and (for rentals) your depreciation schedule.
- File Form 8960 with your 2025 return by April 15, 2026 if you owe the surtax.
- Call a CPA or tax attorney if your gain tops the exclusion, involves a rental or recapture, or stacks with a state surtax — the planning often saves more than the fee.
This article is educational and not a substitute for advice from a licensed tax professional about your specific situation.
FAQs
Does selling my main home trigger the 3.8% NIIT? Usually no. For tax year 2025, gain excluded under Section 121 — up to $250,000 single or $500,000 married — is not investment income, so it cannot trigger NIIT. Only taxable gain above the exclusion can, and only if your MAGI exceeds the threshold.
What are the NIIT income thresholds for 2025? $200,000 single or head of household, $250,000 married filing jointly, and $125,000 married filing separately. These MAGI thresholds are not adjusted for inflation and have stayed the same since 2013.
Is the whole home-sale gain taxed at 3.8%? No. NIIT applies only to the lesser of your net investment income or the amount your MAGI exceeds your threshold — not automatically to the full gain. Many sellers pay on a small slice or nothing.
Does the NIIT apply to a rental property sale? Yes, in most cases. A rental has no Section 121 exclusion, so the full taxable gain plus depreciation recapture is net investment income, subject to 3.8% when MAGI exceeds the threshold for 2025.
Does selling a vacation home trigger NIIT? Yes, typically. A second home is not your principal residence, so no exclusion applies. The full long-term gain is investment income and faces the 3.8% surtax once MAGI clears the threshold.
How much NIIT would I owe on a $200,000 taxable gain? Up to $7,600 (3.8% × $200,000), assuming your MAGI exceeds the threshold by at least that amount. If your excess MAGI is smaller, you pay 3.8% on the smaller figure instead.
Does an inherited home sale trigger NIIT? Rarely. You receive a stepped-up basis to the fair market value at the prior owner’s death, so gain is usually small if you sell soon after. Little or no gain means little or no NIIT.
What form reports the Net Investment Income Tax? Form 8960, filed with your Form 1040. The taxable gain first flows from Form 8949 and Schedule D, then to Form 8960, where the 3.8% is applied to the lesser-of amount for tax year 2025.
Can I avoid NIIT by lowering my MAGI? Yes, sometimes. Because NIIT depends on MAGI exceeding a threshold, timing the sale to a lower-income year or spreading income can reduce or eliminate it. Tax-loss harvesting and retirement contributions may also help.
Did the 2025 tax law change the NIIT? No. The 2025 federal tax law left the 3.8% NIIT rate, its Section 1411 structure, and its income thresholds unchanged for tax year 2025. The Section 121 home-sale exclusion amounts were also untouched.
Do states charge their own version of NIIT? No. NIIT is federal only. However, some states tax capital gains at high ordinary rates, and a few add millionaire surtaxes that can stack on top of the federal 3.8% for very large home-sale gains.
Does the exclusion reset if I sell two homes? No, not within 2 years. You generally cannot claim the Section 121 exclusion on more than one sale in any 24-month period, so a second sale within that window exposes its full gain to tax.
Related reading
- Can an Installment Sale Lower the NIIT on a Big Gain? (w/Examples) + FAQs
- Does an Inheritance Trigger the 3.8% NIIT? (w/Examples) + FAQs
- Does Selling a Business Trigger the 3.8% NIIT? (w/Examples) + FAQs
- Does Selling a Rental Property Trigger the 3.8% NIIT? (w/Examples) + FAQs
- Does Selling Inherited Property Trigger the 3.8% NIIT? (w/Examples) + FAQs
- How Do You Avoid the 3.8% NIIT Legally? (w/Examples) + FAQs
- 570+ Tax Write Offs for Rental Properties (w/ Examples) + FAQs