Capital Gains

How the 3.8% Net Investment Income Tax Applies to Capital Gains

The 3.8% NIIT is not an automatic surcharge on every gain. It applies to the lesser of your net investment income or the amount your MAGI exceeds the threshold. Here is the lesser-of math, with a worked example.

MH
By Muhammad Haroon · Developer & Researcher, Indie Tax Stack
Educational content only. This article reflects 2026 tax law and is for informational purposes. It is not professional tax, legal, or financial advice. Consult a licensed tax professional before making tax decisions.

The 3.8% Net Investment Income Tax does not automatically hit every capital gain. It is a separate surtax under IRC Section 1411 that applies only once your Modified Adjusted Gross Income crosses a threshold, and even then it applies to the lesser of two numbers: your net investment income, or the amount your MAGI sits above the threshold. The thresholds are $200,000 for single filers, $250,000 for married filing jointly, and $125,000 for married filing separately. If your MAGI is below your threshold, the NIIT is zero no matter how large the gain.

What the NIIT is, and what it is not

The NIIT is an extra 3.8% layer on investment income for higher earners. It sits on top of your regular capital gains tax, it does not replace it. So a high earner can owe the 20% long-term rate and the 3.8% NIIT on the same dollars, for a combined 23.8% federal rate on the top slice of a gain.

It is also not the Additional Medicare Tax. That is a different 0.9% surtax that applies to wages and self-employment income above similar thresholds. The NIIT applies to investment income. They share the same income thresholds but tax different things, and you can owe one without the other.

The thresholds

Filing statusMAGI threshold
Single or Head of Household$200,000
Married Filing Jointly$250,000
Married Filing Separately$125,000

These thresholds are set by statute and are not adjusted for inflation, so they stay the same year after year.

The lesser-of calculation

This is the part people get wrong. The NIIT is 3.8% of the smaller of these two amounts:

  1. Your net investment income for the year, which includes capital gains, dividends, interest, and similar income.
  2. The amount your MAGI exceeds your filing-status threshold.

Because it uses the lesser of the two, a large gain does not always mean a large surtax. If only a little of your income is above the threshold, only that little slice is exposed, even if your investment income is much bigger.

A worked example: a $50,000 gain with only $30,000 over the threshold

Take a single filer with $180,000 of income before any investment income, and a $50,000 long-term gain. The threshold for a single filer is $200,000. We ran this through the Capital Gains Calculator.

  • MAGI after the gain is $180,000 plus $50,000, which is $230,000.
  • That is $30,000 above the $200,000 threshold.
  • Net investment income is the $50,000 gain.
  • The NIIT applies to the lesser of $50,000 and $30,000, so it applies to $30,000.
  • NIIT: 3.8% of $30,000 is $1,140.

The surtax lands on $30,000, not on the full $50,000 gain, because only $30,000 of income cleared the threshold. The long-term tax on the gain is a separate $7,500 at the 15% rate. The NIIT is added on top.

Use the Capital Gains Calculator to see whether your MAGI clears the threshold and how much of your gain the surtax actually reaches.

Why the calculator separates taxable income and MAGI

Your capital-gains bracket is set by taxable income. Your NIIT exposure is set by MAGI. These are different numbers, and treating one as the other is the most common way capital-gains math goes wrong. That is why the calculator asks for both your ordinary taxable income and your MAGI before investment income as two separate fields. The first drives your brackets. The second drives the surtax.

What investment income can trigger it

Net investment income is broader than capital gains. It also includes taxable interest, dividends, rental and royalty income, and income from passive business activities. Wages, Social Security, and most retirement plan distributions are not investment income, although they can raise your MAGI and pull you closer to the threshold.

Open the Capital Gains Calculator to model a gain with the surtax included.

Sources

Last reviewed: June 21, 2026.

Frequently Asked Questions

Does the 3.8% NIIT apply to all of my capital gain?

Not always. The NIIT applies to the lesser of your net investment income or the amount your MAGI exceeds your threshold. If only part of your income is above the threshold, the surtax reaches only that part, even when the gain itself is larger.

What are the 2026 NIIT thresholds?

The thresholds are $200,000 for single and head of household filers, $250,000 for married filing jointly, and $125,000 for married filing separately. They are set by statute and do not change with inflation.

Is the NIIT the same as the Additional Medicare Tax?

No. The Additional Medicare Tax is a 0.9% surtax on wages and self-employment income. The NIIT is a 3.8% surtax on investment income such as capital gains, dividends, and interest. They use similar thresholds but apply to different types of income.

Run the numbers yourself

See whether the 3.8% NIIT applies to your gain

Open Calculator