Usually, yes. The IRS lists gain from selling investment real estate as net investment income. If your modified adjusted gross income (MAGI) for the year is over $250,000 on a joint return or $200,000 as a single filer, you can owe an extra 3.8% on that gain. That is on top of capital gains tax and depreciation recapture.

There are real exits. Gain you defer in a 1031 exchange is not counted that year. Released suspended passive losses reduce the amount the tax applies to. And gain from a rental that is a nonpassive trade or business for you, such as a building rented to your own company or a rental run by a qualifying real estate professional, can be excluded.

This page is part of our REPS and passive losses series.

How the tax works

The net investment income tax (NIIT) is in IRC §1411. It is 3.8% of the smaller of two numbers:

  1. Your net investment income for the year.
  2. The amount your MAGI is over your threshold.
Filing statusMAGI threshold
Married filing jointly$250,000
Married filing separately$125,000
Single or head of household$200,000
Qualifying surviving spouse$250,000

These thresholds are set in the statute and are not adjusted for inflation. Estates and trusts use a much lower threshold. See can a trust be a real estate professional.

For most individuals, MAGI is simply adjusted gross income. That is why a sale year is different. A large gain raises your MAGI and your net investment income at the same time. An owner who never pays the tax in a normal year can owe it in the year they sell.

What part of the sale counts

Under Treas. Reg. §1.1411-4(a)(1)(iii), net investment income includes net gain from the disposition of property, to the extent it is in taxable income. For a rental, that means the whole taxable gain:

  • Depreciation recapture. Unrecaptured section 1250 gain on the building is part of the gain. So is ordinary recapture on short-life property from a cost segregation study.
  • The rest of the gain. The appreciation above your original cost is in there too.
  • Gain you do not recognize is not counted. The Form 8960 instructions say gain that is not taxable because of a section 1031 exchange or the section 121 home sale exclusion is not net investment income.

Capital losses help. The regulation lets capital losses that are allowed under the normal rules offset the gain for NIIT purposes (§1.1411-4(d)(2)).

For how recapture works on the same sale, see depreciation recapture when you sell investment property.

Released passive losses lower it

If the rental had losses you could not deduct in earlier years, a fully taxable sale of your entire interest to an unrelated buyer frees them under §469(g). Those released losses count for NIIT too.

The Form 8960 instructions say that when you dispose of an activity that has always been passive, the suspended passive losses are allowed in full as a properly allocable deduction. Treas. Reg. §1.1411-4(g)(9) says the same thing. So the losses lower your net investment income. They also lower your adjusted gross income, which lowers the MAGI side of the formula.

For how the release works and what blocks it, see what happens to suspended passive losses when you sell.

A hypothetical example

Maya is single and earns $120,000 in wages. She sells a rental in Pasadena in a fully taxable sale. Her gain is $300,000, including recapture. To keep the math simple, ignore her other income and deductions.

No suspended losses$40,000 of suspended losses released
MAGI$420,000$380,000
MAGI over $200,000$220,000$180,000
Net investment income$300,000$260,000
Smaller of the two$220,000$180,000
NIIT at 3.8%$8,360$6,840

Her wages are not net investment income, but they still push her MAGI over the threshold. That is why the MAGI line, not the gain, sets the tax here.

This is a made-up example. Your numbers depend on your full return.

When the gain is not net investment income

The regulation excludes gain on property held in a trade or business that is not passive for you (§1.1411-4(d)(4)(i)(A)). For rental owners, that usually comes up three ways.

You rent the building to your own business. If you materially participate in the business that rents it, the self-rental rule in Treas. Reg. §1.469-2(f)(6) treats the net rent as nonpassive. Treas. Reg. §1.1411-4(g)(6) then treats the rent and the gain on a later sale as trade or business items, outside net investment income. See the self-rental rule.

The rental is grouped with a business you run. A rental properly grouped with a trade or business you materially participate in under §1.469-4(d)(1) gets the same treatment under §1.1411-4(g)(6). See grouping a rental with your business.

You are a real estate professional in the year of sale. Treas. Reg. §1.1411-4(g)(7) gives a safe harbor. You must qualify under §469(c)(7) that year and participate in the rental real estate activity for more than 500 hours that year, or in any five of the prior ten years. If you meet it in the year you sell, the gain is excluded. The year of sale is the one that matters, and owners often slow down that year. See real estate professional status and the NIIT for the details.

Missing the safe harbor does not end the question. The regulation lets a real estate professional show another way that the rental is a trade or business (§1.1411-4(g)(7)(iii)). That is a facts question.

Ways owners lower or delay it

  • 1031 exchange. Deferred gain stays out of net investment income until you sell the replacement property in a taxable sale. See 1031 exchange planning.
  • Installment sale. Gain is counted in the years you receive principal. Spreading it can keep some years under the threshold. See installment sales of rental property. Recapture on cost segregation property is still taxed in the year of sale.
  • Timing. Because the thresholds are fixed, a sale in a year with lower wages or business income can mean less MAGI over the line.
  • Capital losses. Losses from other investments sold the same year offset the gain for NIIT under the normal capital loss rules.
  • Moving into the property. The section 121 home sale exclusion keeps excluded gain out of net investment income. But depreciation claimed after May 6, 1997 cannot be excluded (§121(d)(6)), and rental years after 2008 that came before you moved in can limit the exclusion. This needs careful math before anyone moves in.

Where it goes on the return

The gain flows from Form 4797 or Schedule D to Form 8960, line 5a. Gain that is excluded, such as self-rental gain or gain under the real estate professional safe harbor, comes back out on line 5b. Released passive losses come in as allocable deductions.

California

The 3.8% tax is federal only. California has no version of it. California does tax the full gain at its regular income tax rates, with no lower capital gains rate. Escrow may also withhold California tax at closing. See California Form 593 withholding.

Before you list the property

Bring your last two returns, your depreciation schedule, any Form 8582 carryovers, the expected sale price, and whether a 1031 exchange is on the table. If you work in real estate, bring your hour logs too. We will show you what the 3.8% could be in the year you sell and which levers fit. Book a New Client Introduction.

Frequently asked questions

Is the sale of a rental property subject to the 3.8% NIIT?

Usually yes, if your MAGI is over $250,000 on a joint return or $200,000 as a single filer. Gain from selling investment real estate is net investment income. The tax is 3.8% of the smaller of that income or the amount your MAGI is over the threshold.

Does depreciation recapture count for the net investment income tax?

Yes. Unrecaptured section 1250 gain and any ordinary recapture from a cost segregation study are part of the taxable gain, so they are net investment income unless an exclusion applies.

Do suspended passive losses reduce the NIIT when I sell?

Yes. When a fully taxable sale of your entire interest releases suspended passive losses, the Form 8960 instructions allow them as a deduction against net investment income. They also lower your adjusted gross income.

Is gain on selling a self-rental property subject to NIIT?

Generally no, if you materially participate in the business that rents the building. The regulations treat that gain as coming from property used in a nonpassive trade or business, which is outside net investment income.

Does a 1031 exchange avoid the net investment income tax?

It defers it. Gain that is not recognized in a 1031 exchange is not net investment income that year. The deferred gain can be taxed later when you sell the replacement property in a taxable sale.

Does California have a net investment income tax?

No. The 3.8% tax is federal only. California taxes the gain at its regular income tax rates.

This article is general information, not tax advice for your situation. Whether the 3.8% applies depends on your full return, your filing status and how you used the property.

Related guides