The Net Investment Income Tax, or NIIT, is one of the least-known lines on a high earner's tax return. It is a flat 3.8% surtax that applies to investment income once your income crosses a set threshold. It was created to help fund health care, which is why it is sometimes called the Medicare surtax, and it sits on top of whatever regular income tax and capital gains tax you already owe on the same dollars.

What makes the NIIT sneaky is not the rate — it is the threshold. That threshold is written into the law as a fixed dollar figure and, unlike most tax parameters, it has never been adjusted for inflation. As wages and portfolios grow over the years, more and more households drift above the line without any change in the rules. The IRS describes the tax on its Net Investment Income Tax pages.

Stats showing the 3.8 percent NIIT surtax, the MAGI trigger, and that the threshold is never indexed for inflation
It applies to the smaller of your investment income or the amount you are over the threshold.

Who owes the NIIT

Two things must be true for the NIIT to apply. First, your modified adjusted gross income (MAGI) must exceed the threshold for your filing status. Second, you must have net investment income. The tax then hits the smaller of those two amounts: your net investment income, or the portion of your MAGI that sits above the threshold. So a retiree with a huge portfolio but income just barely over the line pays the 3.8% only on the small slice above the threshold, not on the whole portfolio's income. Understanding how MAGI is built is central here — it is explained in AGI and MAGI, Explained.

What counts as net investment income

The NIIT reaches most of the income your portfolio and property produce, but not your paycheck. Included are:

  • Interest, dividends, and capital gains, including the gain when you sell stocks, funds, or a second property.
  • Rental and royalty income in most cases.
  • Taxable gain on the sale of a home above the excludable amount, which can surprise people who sell a long-held house.
  • Passive business income from activities you do not materially participate in.

Notably excluded are wages and self-employment income (those face their own Medicare taxes instead), tax-exempt municipal bond interest, and distributions from retirement accounts like a 401(k) or IRA. That exclusion of retirement distributions is a meaningful planning lever, discussed below.

How it stacks on top of capital gains tax

The NIIT is easy to underestimate because it hides behind the capital gains tax. When a high earner sells appreciated investments, they may pay the top long-term capital gains rate and the 3.8% NIIT on the same gain, pushing the effective rate on that gain meaningfully higher. If you are planning a large sale, factor both in — the Capital Gains Tax Guide covers the base rates, and the Capital Gains Estimator helps you size a sale before you make it.

Ways to soften it

Because the NIIT keys off both your MAGI and your investment income, most planning aims to reduce one or both:

  • Use tax-advantaged accounts. Income earned inside a 401(k), IRA, or HSA is not net investment income, and qualified withdrawals do not count toward MAGI in the way taxable income does. Sheltering more of your investing reduces exposure over time.
  • Harvest losses. Because the tax applies to net investment income, realized losses offset realized gains and shrink the base the 3.8% applies to. See the capital gains guide for how netting works.
  • Manage the timing of large gains. Spreading a big sale across two tax years, or realizing gains in a lower-income year, can keep you under or closer to the threshold.
  • Favor municipal bonds where appropriate. Their interest is excluded from net investment income and from MAGI, which can help those hovering near the line.
  • Coordinate with other surtaxes. High-income years that trigger the NIIT often also involve the Alternative Minimum Tax, so plan them as a set.

The bottom line

The NIIT is a permanent 3.8% surtax on investment income for households above a fixed, un-indexed threshold — which quietly means more people each year. It is not something to panic over, but it is something to plan around, especially before a large sale or in a high-income year. Model your investment income and thresholds with the Tax Strategies tool, and use the Tax Health assessment plus the planning hub to see where you stand.