Net Investment Income Tax (NIIT)

The 3.8% Surtax on Investment Income — How It Works, Common Mistakes, and How to Reduce It

Tax planning dashboard showing net investment income, NIIT exposure, and concentrated stock diversification strategies

The Net Investment Income Tax is a 3.8% surtax on investment income for high earners, enacted as part of the Affordable Care Act in 2013. It applies on top of regular federal income tax and the standard capital gains rates — and it catches a meaningful number of tech workers off guard precisely because it activates at income levels that are common in the industry.

For a senior software engineer in California already paying 20% long-term capital gains plus 13.3% state tax, the NIIT adds another 3.8%, bringing the combined marginal rate on investment income to roughly 37%. Understanding when it applies, what it covers, and how to reduce exposure is a meaningful part of tax planning for anyone at or above the threshold.

The Basic Mechanics: When NIIT Applies

The NIIT is levied at 3.8% on the lesser of two amounts:

  1. Your net investment income for the year, or
  2. The amount by which your Modified Adjusted Gross Income (MAGI) exceeds the applicable threshold

The thresholds are not indexed for inflation — they have remained fixed since 2013:

  • Married filing jointly: $250,000
  • Single / head of household: $200,000
  • Married filing separately: $125,000
  • Trusts and estates: $15,650 (2026 — this threshold is inflation-adjusted)

Because the thresholds are not inflation-adjusted, they erode in real terms every year. A couple that was just below the $250,000 threshold when NIIT was enacted in 2013 is almost certainly above it today on the same real purchasing power of income. This bracket creep has steadily expanded the population of taxpayers affected.

The "lesser of" structure has a critical implication that is widely misunderstood and discussed further below: it means that for a high-salary tech worker whose earned income alone already pushes MAGI well above the threshold, the NIIT applies to 100% of their net investment income — every dollar of dividends, interest, and capital gains — not just the portion that corresponds to the excess above the threshold.

What Counts as Net Investment Income

Net investment income includes three broad categories:

  • Gross income from interest, dividends, annuities, royalties, and rents — unless derived in the ordinary course of an active trade or business. Interest earned in a brokerage account, qualified and non-qualified dividends, rental income from passive investments, and similar passive income streams are all included.
  • Net gains from the disposition of property — capital gains from selling stocks, ETFs, mutual funds, bonds, real estate (above the primary residence exclusion), and other investment property. Both short-term and long-term capital gains are included.
  • Net income from passive activities — income from a trade or business in which the taxpayer does not materially participate. A limited partnership interest, a rental portfolio managed by a property manager, or a business you own but do not actively work in are typical examples.

The "net" in net investment income means you can deduct investment expenses directly allocable to producing that income — investment interest expense, certain advisory fees, and state and local taxes allocable to investment income (subject to SALT cap limitations). The deductible expenses reduce the base on which the 3.8% is calculated.

What Does Not Count as Net Investment Income

The following income categories are explicitly excluded from NIIT:

  • Wages and salary. Earned income is not investment income. No matter how high a tech worker's salary, the salary itself is not subject to NIIT — it is subject to payroll taxes and ordinary income tax instead.
  • RSUs that vest and are sold immediately. When an RSU vests, the full market value at vest is taxed as ordinary income — wage income reported on your W-2. This compensation income is not investment income and is not subject to NIIT. If you sell the shares immediately at vest, there is no additional gain beyond the compensation income already recognized. The sale proceeds equal the vest-date value, and the short-term capital gain is zero or minimal. NIIT does not apply. This is a meaningful planning point: for many tech workers, immediately selling vested RSUs is not only the correct diversification move — it is also tax-optimal relative to holding, because holding past vest converts future appreciation from wage income (NIIT-exempt) into capital gains income (NIIT-applicable).
  • Business income from an active trade or business. If you materially participate in a business, income from that business is ordinary income, not investment income, and is not subject to NIIT. Self-employment income, consulting income reported on Schedule C where you are the active operator, and S-corporation income where you materially participate are all excluded.
  • Distributions from tax-exempt bonds. Interest on municipal bonds is excluded from both gross income and NIIT — though muni bond income does count toward MAGI for purposes of determining whether you exceed the threshold.
  • Distributions from qualified retirement plans. Distributions from traditional IRAs, 401(k)s, Roth IRAs (when qualified), and similar plans are not net investment income. A Roth IRA withdrawal does not trigger NIIT. A traditional IRA withdrawal generates ordinary income that increases MAGI — which can push more net investment income into NIIT territory — but is not itself subject to the 3.8% surtax.
  • Gain from selling a primary residence within the exclusion. The $250,000 ($500,000 married) gain exclusion on the sale of a primary residence is not subject to NIIT. Any gain above the exclusion is subject to both capital gains tax and NIIT.
  • Alaska Permanent Fund dividends and certain other statutory exclusions.

The "Lesser Of" Rule: Why High Earners Pay NIIT on All Investment Income

The NIIT is computed on the lesser of net investment income or MAGI above the threshold. For a tech worker earning $450,000 in salary with $50,000 in investment income:

  • MAGI = $500,000
  • Threshold (MFJ) = $250,000
  • Excess above threshold = $250,000
  • Net investment income = $50,000
  • Lesser of $250,000 and $50,000 = $50,000
  • NIIT = 3.8% × $50,000 = $1,900

The entire $50,000 of investment income is subject to NIIT because the salary alone already puts MAGI far above the threshold. Any strategy that reduces investment income — tax-loss harvesting, deferring capital gains realizations, shifting to tax-exempt bonds — directly reduces NIIT dollar-for-dollar. But strategies that only reduce MAGI slightly while leaving investment income unchanged (for example, a small 401(k) contribution for someone earning $500,000) have no effect on NIIT if MAGI remains well above the threshold.

By contrast, for a retired couple with $260,000 in MAGI consisting of $80,000 in Social Security, $100,000 in traditional IRA distributions, and $80,000 in capital gains and dividends:

  • MAGI = $260,000
  • Excess above $250,000 = $10,000
  • Net investment income = $80,000
  • Lesser of $80,000 and $10,000 = $10,000
  • NIIT = 3.8% × $10,000 = $380

Here, reducing MAGI by $10,001 — through a smaller IRA distribution, a Roth withdrawal instead, or any other MAGI-reducing move — eliminates the NIIT entirely. The "lesser of" structure means that at the margin, different strategies apply depending on where in the NIIT exposure range a given taxpayer sits.

Common Planning Mistakes

Mistake 1: Assuming NIIT Only Hits Very High Earners

The $250,000 MFJ threshold sounds high. But for a dual-income tech couple in the Bay Area — each earning $150,000–$200,000 — combined MAGI routinely exceeds $250,000 even before any investment income. Once above the threshold, every dollar of dividends, interest, and capital gains in their taxable accounts is subject to NIIT. Many couples in this situation have never encountered the NIIT because they have not sold appreciated assets, but as taxable brokerage accounts grow and RSUs vest into appreciated stock, exposure increases.

Mistake 2: Holding RSUs Past Vest to Capture Long-Term Gains — and Creating NIIT Exposure

A common belief among tech workers is that holding RSUs for one year after vest to convert the gain to long-term capital gains is almost always worth doing. This logic ignores the NIIT. When RSUs vest, the vest-date value is ordinary income — W-2 wages — which is not subject to NIIT. If you sell immediately, you owe income tax at ordinary rates on the vest-date value, but no NIIT applies to that transaction (because there is no capital gain beyond the compensation already recognized). If you hold the shares and they appreciate, the subsequent gain is a capital gain — subject to long-term capital gains rates after one year, but also subject to NIIT. For a California resident, the combined rate on that appreciation is 20% federal + 3.8% NIIT + 13.3% California = 37.1%. Holding also concentrates single-stock risk. The decision to hold RSUs post-vest is often worse tax-economically than it appears.

Mistake 3: Ignoring NIIT When Modeling a Roth Conversion

Roth conversion income is ordinary income, which increases MAGI. For a retiree sitting just below the $250,000 threshold with significant investment income, a large Roth conversion can push MAGI above the threshold — suddenly subjecting all their investment income to NIIT. The interaction requires careful modeling. A $50,000 Roth conversion that pushes MAGI from $230,000 to $280,000 may trigger NIIT on $30,000 of investment income that was previously below the threshold, adding $1,140 in additional tax on top of the conversion's income tax cost. This does not make Roth conversions inadvisable — but the NIIT interaction must be included in the analysis.

Mistake 4: Ignoring Passive vs. Active Activity Classification

Income from a business in which you do not materially participate is passive and subject to NIIT. Income from a business in which you do materially participate is active and excluded. This distinction has significant planning implications for tech workers who own rental properties, have partnership interests, or receive income from side businesses they are not actively running. In some cases, increasing your participation in a business activity to meet the material participation tests can reclassify income from passive (NIIT-applicable) to active (NIIT-exempt). The IRS has seven tests for material participation; meeting any one of them — including participating more than 500 hours per year or participating more than any other individual — removes the passive characterization.

Mistake 5: Not Considering NIIT in Asset Location Decisions

Asset location — deciding which investments go in which account type — is partly a NIIT optimization exercise. High-income-producing assets (bonds, REITs, dividend-heavy equities) generate ordinary investment income subject to NIIT every year they are held in a taxable account. Placing them inside a traditional IRA or 401(k) defers that income entirely, and placing them in a Roth IRA eliminates it permanently. Low-yield, high-growth assets held in taxable accounts generate NIIT only on eventual capital gains, which can be managed through holding periods and harvesting. A complete asset location analysis includes NIIT exposure, not just the standard income tax rate differential.

Mistake 6: Overlooking Trusts as a High-Risk NIIT Entity

Trusts reach the top NIIT threshold at just $15,650 of income in 2026 — compared to $250,000 for married individuals. Any trust that accumulates investment income rather than distributing it to beneficiaries faces NIIT at an extremely low threshold. Irrevocable trusts holding investment portfolios — including many intentionally defective grantor trusts (IDGTs) and complex trusts set up for estate planning — can owe NIIT on nearly all retained investment income. The solution for taxable trusts is generally to distribute income to beneficiaries who are below the individual NIIT threshold rather than accumulating it inside the trust. Trustees and their advisors should model the NIIT impact of distribution vs. retention decisions annually.

Diversifying a Concentrated Stock Position Without Triggering NIIT

One of the most common sources of significant NIIT liability for tech workers is selling a concentrated stock position — whether accumulated RSUs, early-exercise options, or a business sale. A $500,000 gain from selling concentrated stock triggers capital gains tax plus 3.8% NIIT on the full amount (assuming MAGI already far exceeds the threshold from salary alone). For a California resident, that NIIT adds $19,000 to an already large tax bill.

Several strategies allow diversification away from a concentrated position while eliminating or substantially reducing NIIT:

Exchange Fund (Swap Fund)

An exchange fund is a partnership into which multiple investors contribute their concentrated stock positions. In exchange, each investor receives a pro-rata interest in a diversified pool of all contributed stocks — without triggering a taxable sale. The IRS treats the contribution as a tax-free exchange under partnership rules (Section 721), provided the fund holds the contributed shares for at least seven years and the fund holds at least 20% of its assets in illiquid investments (real estate or other qualifying assets).

The NIIT benefit: no sale occurs at contribution, so no capital gain is recognized and no NIIT is triggered. The investor achieves diversification — replacing a single concentrated position with a basket of stocks contributed by other investors — while deferring the embedded gain indefinitely. The gain is eventually recognized when the investor exits the fund or when the fund distributes shares. During the holding period, the investor owns a diversified portfolio rather than a single stock.

The constraints: exchange funds are typically available only to accredited investors, often require minimum contributions of $1,000,000–$5,000,000, charge management fees, and impose a mandatory seven-year lockup. They are not suitable for investors who need liquidity or whose position is below the minimum. But for a tech worker with $3,000,000–$10,000,000 in a single stock, an exchange fund is often the cleanest available tax deferral mechanism.

Donor-Advised Fund (DAF)

Contributing appreciated stock directly to a DAF — rather than selling the stock and donating cash — permanently eliminates both the capital gains tax and the NIIT on the contributed shares. The donor receives a charitable deduction for the full fair market value of the shares on the contribution date, avoids recognition of the embedded gain entirely, and the DAF sells the shares inside the account with no tax owed.

This strategy works for the portion of a concentrated position the investor intends to donate to charity. It is not a mechanism for converting charitable intent into personal liquidity — the contributed assets are irrevocably committed to charitable purposes. But for donors with philanthropic goals, the combination of full fair market value deduction plus NIIT elimination is the most tax-efficient way to both diversify and give. A $200,000 contribution of appreciated stock with a $20,000 basis eliminates approximately $6,840 in NIIT (3.8% × $180,000 gain) plus the capital gains tax that would have been owed on the sale.

Section 351 Exchange

Under Section 351 of the Internal Revenue Code, a taxpayer can transfer appreciated property to a corporation in exchange for stock in that corporation without recognizing gain — provided the transferors collectively own at least 80% of the corporation immediately after the exchange. The gain is deferred until the taxpayer sells the corporation stock.

In practice, Section 351 exchanges for concentrated stock diversification typically involve a closely held investment corporation or a pooling arrangement with other investors. The mechanics are complex and require careful structuring to avoid unintended gain recognition, and the corporation pays corporate income tax on investment income inside the vehicle — which can create a different layer of tax drag compared to direct ownership. Section 351 is most commonly used in business sale contexts rather than as a standalone stock diversification tool, but it can be part of a broader plan for large concentrated positions when exchange fund access is unavailable. A qualified tax attorney and CPA are essential for any Section 351 planning.

Charitable Remainder Unitrust (CRUT)

A Charitable Remainder Unitrust is an irrevocable trust into which a donor contributes appreciated stock. The trust sells the stock — with no immediate capital gains tax or NIIT owed at the trust level, because charitable remainder trusts are tax-exempt — and reinvests in a diversified portfolio. The donor (and potentially a spouse or other beneficiary) receives an annual income stream from the trust, typically 5–8% of the trust's fair market value, for a term of years or for life. At the end of the term, the remaining trust assets pass to charity.

The tax benefits: the initial contribution generates a partial charitable deduction based on the actuarial present value of the charity's remainder interest. The gain on the contributed stock is not recognized immediately — instead, it is spread across the distributions paid to the beneficiaries over the trust's term, taxed in a specific ordering of income character (ordinary income first, then capital gains, then return of basis). The NIIT elimination applies to the gain that would have been recognized immediately on a direct sale — instead of owing NIIT on the full gain in year one, the gain is spread over years or decades of distributions, reducing the annual NIIT burden and potentially allowing some of it to fall in lower-income years.

A CRUT is most valuable when the donor has genuine charitable intent for the remainder, needs an income stream in retirement, and holds a highly appreciated position. It is not appropriate for investors who need full liquidity or who have no charitable intent — the remainder irrevocably passes to charity.

Qualified Opportunity Zone (QOZ) Investment

A capital gain from selling a concentrated position can be deferred — and partially excluded — by reinvesting the gain proceeds into a Qualified Opportunity Fund within 180 days of the sale. The reinvested gain is deferred until the earlier of the QOZ investment's sale date or December 31, 2026 (under current law). If the QOZ investment is held for at least 10 years, any appreciation on the QOZ investment itself is permanently excluded from capital gains and NIIT.

The NIIT implications: the initial gain from selling the concentrated stock is deferred but not eliminated — it will eventually be recognized and subject to NIIT when the deferral ends. However, the appreciation inside the QOZ fund after the reinvestment date is permanently free of both capital gains tax and NIIT after a 10-year hold. For a tech worker who sells a concentrated position for a large gain and has a long investment horizon, a QOZ fund investment can eliminate NIIT on a significant portion of future investment growth.

The constraints: QOZ investments must be made through designated funds investing in low-income census tract businesses or property, carry significant illiquidity (10-year hold to capture the full exclusion), and involve substantial investment due diligence. The universe of high-quality QOZ investments is more limited than general investment options.

Installment Sale

If the concentrated position is in a private company or other illiquid asset rather than a publicly traded stock, an installment sale can spread gain recognition — and therefore NIIT — over multiple years. Instead of receiving the full purchase price in one year and recognizing all the gain and NIIT at once, the seller receives payments over several years and recognizes gain proportionally as payments arrive.

The benefit is rate management rather than elimination: spreading gain across multiple years may keep annual MAGI lower, potentially reducing the amount of gain subject to NIIT in years where total income is closer to the threshold. For a business sale at a price far above the NIIT threshold in any single year, the benefit is limited — but in cases where the installment payments bring MAGI only modestly above the threshold, the structuring can meaningfully reduce total NIIT paid.

Direct Indexing and Gradual Harvesting

For investors who want to reduce concentration in a single stock while managing the immediate tax bill, direct indexing combined with tax-loss harvesting allows a gradual, tax-efficient transition. Rather than selling the entire concentrated position at once and triggering a large gain plus NIIT, the investor systematically sells portions of the position each year — ideally offsetting the gains with harvested losses from the broader portfolio — while simultaneously building a diversified direct-index portfolio.

This approach does not eliminate NIIT on the gains that are realized each year, but it smooths the recognition over many years, potentially allowing more precise MAGI management and timing gains in years where other income is lower. It preserves flexibility and liquidity in ways that exchange funds, CRUTs, and DAFs do not.

Frequently Asked Questions

No. Investment activity inside tax-advantaged retirement accounts — dividends, interest, capital gains from rebalancing — does not generate net investment income subject to NIIT while it remains inside the account. However, distributions from a traditional IRA or 401(k) are ordinary income that increases your MAGI, which can push more of your other investment income (from taxable accounts) into NIIT territory. Roth IRA qualified distributions are excluded from MAGI entirely and have no NIIT interaction.
No — not on the vest-date value. When RSUs vest, the full market value at vest is ordinary compensation income reported on your W-2, which is exempt from NIIT. If you sell the shares immediately at vest, the sale price and the compensation income recognized are essentially the same, producing zero or negligible capital gain. NIIT applies to capital gains, not to compensation income. Where NIIT can apply to RSUs is if you hold the shares after vesting and they appreciate — that subsequent appreciation becomes a capital gain subject to NIIT when you eventually sell.
It depends on where your income sits relative to the NIIT threshold. A 401(k) contribution reduces your MAGI. If your MAGI is only modestly above the threshold — say, $260,000 on a $250,000 MFJ threshold — then reducing MAGI below $250,000 eliminates NIIT entirely on your investment income. But if your salary alone already puts your MAGI far above the threshold (which is common for senior tech workers), a 401(k) contribution reduces MAGI but leaves it far above the threshold, and the NIIT applies to 100% of your net investment income regardless. In that case, the NIIT benefit of additional 401(k) contributions is zero — though the ordinary income tax savings still apply.
Usually yes, if the rental activity is passive — which it is for most individual landlords who use a property manager or are not actively involved in day-to-day management. Passive rental income is net investment income subject to NIIT. The exception is real estate professionals — taxpayers who spend more than 750 hours per year in real estate activities and for whom real estate is their primary occupation. Real estate professional status reclassifies rental income from passive to active, removing it from NIIT. This is a significant threshold that most tech workers who own rental property as a side investment will not meet.
Potentially a significant one. Non-grantor trusts and estates reach the top NIIT threshold at just $15,650 of income in 2026 — compared to $250,000 for married individuals. Any investment income retained inside a complex trust rather than distributed to beneficiaries is almost certainly subject to NIIT if the trust has more than $15,650 in income. The primary mitigation is distributing income to beneficiaries who are below the individual NIIT threshold, which passes the income to their personal returns at their lower threshold. Trust distribution policy should be explicitly reviewed with NIIT in mind.
An exchange fund allows you to contribute concentrated stock to a partnership in exchange for a diversified interest — without a taxable sale. Because no sale occurs, no capital gain is recognized, and no NIIT is triggered at contribution. The embedded gain is deferred until you exit the fund. During the mandatory seven-year holding period, you hold a diversified partnership interest rather than a single stock. When you eventually exit — either by receiving a distribution of shares or by selling your fund interest — the deferred gain is recognized and becomes subject to capital gains tax and NIIT at that time. The benefit is deferral and risk reduction, not permanent elimination. For most participants, the seven-year deferral of a large NIIT bill — combined with the diversification of catastrophic single-stock risk — is the primary value.

Model Your NIIT Exposure and Diversification Options

Nauma shows your projected net investment income, NIIT liability, and the after-tax impact of concentrated stock strategies — so you can see the full tax picture before you act.

Get Started for Free