Reporting Capital Gains and Losses for the Net Investment Income Tax
The Net Investment Income Tax (NIIT) imposes an additional 3.8% surtax on certain investment income for individuals, estates, and trusts above specific income thresholds. When you sell assets such as stocks, bonds, or real estate, the resulting capital gains can become a significant part of your net investment income and directly affect your NIIT liability. Properly reporting capital gains and losses for the Net Investment Income Tax is not an option reserved for the wealthy—it is now a core compliance task for millions of taxpayers.
Capital gains have always required careful handling on Schedule D and Form 8949. The introduction of the NIIT added Form 8960 to the picture, creating a separate reporting path where you must recalculate which gains count, how losses offset, and what adjustments apply. Misreporting can lead to underpayment penalties or a missed opportunity to cut your tax bill through strategic loss harvesting and timing.
This guide walks you through every aspect of reporting capital gains and losses under the NIIT. You will learn exactly which gains trigger the surtax, how netting works, the role of capital loss carryovers, and concrete tax planning strategies that reduce or eliminate NIIT exposure. By the end, you will have a clear blueprint for handling Form 8960 alongside your traditional capital gain filings.
Quick Answer

You report net investment income, including capital gains, on Form 8960. Capital gains from assets held for investment trigger the 3.8% tax if your modified adjusted gross income exceeds $200,000 ($250,000 married filing jointly). Losses can offset gains but only net capital losses up to $3,000 reduce the NIIT base.
Understanding the Net Investment Income Tax

The Net Investment Income Tax was introduced as part of the Affordable Care Act to help fund Medicare. It applies to individuals, estates, and trusts and is calculated as 3.8% of the lesser of your net investment income or the amount by which your modified adjusted gross income (MAGI) exceeds the applicable threshold. For most taxpayers, MAGI is the same as adjusted gross income, but certain foreign earned income exclusions must be added back.
The statutory thresholds for the 2024 tax year are $200,000 for single filers and head of household, $250,000 for married filing jointly, and $125,000 for married filing separately. Estates and trusts have a much lower threshold—only $15,450 for 2024—making careful NIIT planning essential for fiduciary income tax returns.
Net investment income itself has three broad categories: gross income from interest, dividends, annuities, royalties, and rents, provided they are not derived from a trade or business to which the NIIT does not apply; other gross income from a passive activity or a business of trading financial instruments or commodities; and net gain from the disposition of property, including capital gains. Wages, self-employment income, Social Security benefits, tax-exempt municipal bond interest, and distributions from qualified retirement plans are generally excluded from the definition of NII. However, those items still increase your MAGI, which can push other investment income over the threshold.
Which Capital Gains Trigger the 3.8% Surtax?

Not every capital gain is subject to the NIIT. The critical factor is whether the gain arises from property held for investment or from another activity that generates net investment income. Gains from the sale of stocks, bonds, mutual funds, exchange-traded funds, and most real estate investment properties are included. Collectibles, precious metals, and cryptocurrency held for investment also fall under the NIIT umbrella when sold at a profit.
Gains on the sale of a primary residence may be partially or fully excluded under the Section 121 exclusion—up to $250,000 for single filers and $500,000 for married couples filing jointly. To the extent the gain is excluded, it does not enter net investment income. Any gain above the exclusion limit, however, is treated as a capital gain from the disposition of property and must be reported on Form 8960. Likewise, gains from active business assets, such as equipment used in a trade or business where the taxpayer materially participates, are not considered investment income for NIIT purposes unless the activity is a passive activity or a trading business.
Gains from pass-through entities—like partnerships, S corporations, and limited liability companies—require special attention. If the gain arises from a passive activity, it flows through to your net investment income. If you materially participate in the activity, the gain might not be subject to the NIIT, but you must still document the determination carefully. Gains from the sale of an interest in a passive activity or a business that trades financial instruments are fully included in NII as well.
Reporting Capital Gains and Losses for NIIT Purposes

Form 8960 Overview
Form 8960, Net Investment Income Tax—Individuals, Estates, and Trusts, is where you calculate and report the NIIT. You start by entering your net investment income components from various sources, then compare your MAGI to the threshold. The form has several sections: Part I for investment income adjustments, Part II for calculating net investment income, and Part III for the tax computation.
Capital gains appear primarily on Line 5a of Form 8960, where you report the net gain from the disposition of property. This figure originates from your total net capital gain reported on Schedule D, but adjustments are often necessary. You must remove gains not subject to the NIIT, such as excluded home sale gains, gains from active business property, and gains allocated to non-investment purposes. If you have a net capital loss overall, you cannot include a negative amount on this line; the net investment income from disposition of property is zero, not a negative that reduces other NII.
Netting Rules and Adjustments
Netting works similarly to how you calculate net capital gain on Schedule D. You combine short- and long-term capital gains and losses for the year. For NIIT purposes, you only include gains and losses from property held for investment or from a business that generates NII. Capital loss carryovers from prior years are used in the same way as for regular tax, reducing current-year capital gains before arriving at the net figure. If losses exceed gains, the net capital loss is not included on Form 8960. Instead, the $3,000 capital loss deduction allowed against ordinary income on your Form 1040 reduces your AGI and therefore your MAGI, which can indirectly lower the NIIT by shrinking the excess above the threshold.
Proper classification is essential. Suppose you sold a rental property at a loss but you materially participated, so the loss is not passive. That loss might be an ordinary loss on Form 4797 rather than a capital loss, and thus it does not offset investment capital gains on Form 8960. Conversely, if the rental was passive, the loss would first be subject to passive activity loss limitations. Only after those limits are applied would any remaining capital loss be netted against other capital gains for NIIT purposes.
Capital Loss Harvesting and the $3,000 Limit
Tax-loss harvesting—intentionally selling investments at a loss to offset gains—remains a powerful tool for both regular tax and NIIT planning. When you realize losses, they first offset gains of the same character (short-term losses against short-term gains, long-term losses against long-term gains). Any excess loss can offset the other type of gain. If total losses still exceed total gains, up to $3,000 ($1,500 if married filing separately) can be deducted against ordinary income, with the remainder carried forward indefinitely.
For NIIT, harvested losses directly reduce the capital gains component of net investment income. If you have significant realized gains and harvest losses to offset them, you reduce the amount flowing to Line 5a of Form 8960. If the harvesting produces a net capital loss, the NIIT capital gain component is zero, and the $3,000 deduction reduces MAGI, potentially lowering the overall NIIT further. This dual benefit makes year-end loss harvesting a staple of NIIT-efficient portfolio management.
Passive Activity Losses and NIIT
Passive activity losses are separately reported and limited. Generally, you can only deduct passive losses against passive income. For NII, passive income is included, so passive activity losses can offset passive income within the NII calculation, but only after applying the passive activity loss rules. Unused passive losses can be carried forward. If you dispose of the entire passive activity in a taxable transaction, suspended losses may be released and can then offset other NII. This interplay requires careful tracking on Form 8582 and integration with Form 8960.
How Capital Losses Offset NIIT Income

The core mechanism is straightforward: net capital losses reduce the amount of net capital gain that enters the NII calculation. Because net investment income includes only the net gain from property dispositions, having losses that fully offset gains means that line is zero. However, capital losses do not directly reduce other categories of net investment income, such as interest or dividend income. So if your only NII is from dividends of $10,000 and you realize a $5,000 net capital loss, your total NII remains $10,000; the capital loss does not negate the dividends.
The indirect reduction comes through the $3,000 allowable capital loss deduction. That deduction lowers your adjusted gross income, which lowers your MAGI. If your MAGI is near the threshold, a $3,000 reduction could eliminate the excess and thereby eliminate the NIIT entirely, or at least reduce the base on which the 3.8% is calculated. Carryforward capital losses from prior years work identically: they reduce future capital gain income, thereby lowering future NIIT exposure. Deferring gain recognition until a year when you have substantial capital loss carryforwards can be a tactical move.
It is also crucial to understand that losses from selling personal-use property, such as a car or a primary residence sold at a loss, are not deductible and cannot offset NII. Only losses from investment or business property count, and for NII, only those from investments or passive activities are included. A loss on a vacation home used partly for personal purposes and partly for rental may require allocation; only the portion attributable to investment or rental use can offset gains.
Tax Planning Strategies to Minimize NIIT Liability

Harvesting Losses Strategically
As noted, tax-loss harvesting is the most direct way to zero out the capital gain portion of NII. Review your portfolio throughout the year, especially in the fourth quarter, to identify positions with unrealized losses. Selling them before year-end locks in the loss, which offsets realized gains. Be mindful of wash-sale rules—if you repurchase the same or substantially identical security within 30 days, the loss is disallowed. You can maintain market exposure by purchasing a similar but not substantially identical security, or by waiting 31 days to repurchase.
Timing Capital Gains and Losses
If you anticipate a year with lower taxable income—perhaps due to retirement, a sabbatical, or business losses—consider deferring capital gain realizations into that year. Because the NIIT applies only to the extent MAGI exceeds the threshold, keeping MAGI below the threshold in a given year can wholly avoid the surtax. Conversely, if you are already above the threshold, accelerating gains into the current year does not increase the surtax rate and may make sense if you expect rates to rise.
Pairing gains with losses in the same year is always beneficial. If you want to sell a highly appreciated asset and also hold underwater positions, realize both in the same year so the loss offsets the gain for both regular tax and NIIT purposes. Spreading sales over multiple years can also keep your annual MAGI below the cliff.
Maximizing Contributions to Tax-Advantaged Accounts
Contributions to traditional 401(k)s, 403(b)s, traditional IRAs, and health savings accounts reduce your AGI and therefore your MAGI. By fully funding these vehicles, you may reduce MAGI below the NIIT threshold or minimize the excess subject to the 3.8% tax. For self-employed individuals, SEP IRAs and solo 401(k)s offer higher contribution limits, providing a powerful lever for NIIT management. Roth contributions do not reduce current MAGI, but qualified Roth withdrawals later are not included in NII and do not push up future thresholds.
Charitable Contributions of Appreciated Securities
Gifting long-term appreciated stocks, mutual funds, or ETFs to a qualified charity avoids capital gains entirely. You never recognize the gain for regular tax or NIIT, and you may claim a charitable deduction equal to the fair market value of the security. This strategy bypasses both the capital gain inclusion on Form 8960 and the associated surtax. Donor-advised funds can help bunch contributions in a high-income year to maximize the tax benefit while keeping MAGI in check.
Investing in Municipal Bonds
Interest from municipal bonds is exempt from federal income tax and is not included in net investment income. Additionally, it does not increase MAGI. Substituting a portion of your taxable bond portfolio with municipal bonds can reduce your NII without sacrificing income, thereby lowering or eliminating the NIIT. For high-income investors, this swap can have a meaningful after-tax return benefit.
Installment Sales and Deferred Gains
Structuring the sale of appreciated property as an installment sale allows you to spread the capital gain over several years. Instead of recognizing the entire gain in the year of sale, you report a proportionate amount each year as you receive payments. This can keep annual MAGI below the NIIT threshold and reduce the surtax. Careful structuring is needed to ensure the installment method is available and beneficial.
Roth Conversion Timing
Roth conversions create ordinary income that raises MAGI in the conversion year. That can push you deeper into NIIT territory. However, once assets are in a Roth IRA, future growth and qualified withdrawals are tax-free and not part of NII. Consider converting in years when your other income is low or when you have above-the-line deductions to offset the conversion income. Over the long run, reducing future NII from taxable accounts may justify a temporary NIIT hit.
Using the Primary Residence Exclusion Fully
If you are selling your home, ensure you meet the ownership and use tests to maximize the $250,000/$500,000 exclusion. Any gain above the exclusion is included in NII, so improving your basis through documented home improvements or timing the sale to stay within the exclusion can keep the gain off Form 8960.
Real-World Examples of NIIT Reporting

Consider a married couple filing jointly with wages of $240,000, dividend income of $20,000, and long-term capital gains of $60,000 from the sale of stocks. Their MAGI is $320,000. The threshold is $250,000, so the excess is $70,000. Net investment income consists of dividends $20,000 plus capital gains $60,000, totaling $80,000. The NIIT is 3.8% of the lesser of $80,000 NII or $70,000 excess, which is $2,660. The capital gain is fully included in NII, and the NIIT applies because MAGI exceeds the threshold.
Now suppose the same couple also realized a $30,000 capital loss from selling underperforming stocks. Their net capital gain drops to $30,000, making total NII $50,000. The excess above threshold remains $70,000, so the NIIT base becomes the lesser of $50,000 or $70,000—$50,000. The NIIT falls to $1,900. The loss directly offset the gain and lowered the surtax.
If the couple had harvested $80,000 in losses, producing a net capital loss of $20,000, their capital gain component for NII would be zero. Total NII would be just the $20,000 of dividends. The NIIT base would be $20,000, and the tax $760. Additionally, they would deduct $3,000 against ordinary income, reducing MAGI from $320,000 to $317,000, excess to $67,000, and the base remains $20,000 (NII) since that is still lower than excess. The $3,000 deduction provided a minor shift but the primary benefit came from netting losses against gains.
These examples highlight why comprehensive gain and loss tracking matters for Form 8960 accuracy. Integrating Schedule D, Form 8949, and Form 8960 with proper adjustments ensures you do not overpay the surtax.
Common Mistakes to Avoid

One frequent error is failing to remove excluded gains from Form 8960. For instance, if you sold your primary residence at a $300,000 gain and qualified for the $500,000 exclusion, the entire gain is excluded and should not appear on Form 8960. Taxpayers sometimes mistakenly report the gross gain and then adjust, leading to IRS inquiries.
Another mistake is treating all capital losses as reducers of NII when they may be passive losses with separate limitations. Misclassifying active business gains as investment income can also inflate NII unnecessarily. Always verify the character of the asset and your participation level before populating Form 8960.
Forgetting to include gains from pass-through entities on Form 8960 is also common. Even if the K-1 reports a capital gain, you must determine whether it connects to the entity’s passive activity. If yes, it belongs in NII. Finally, some taxpayers incorrectly apply the $3,000 capital loss deduction directly against NII on Form 8960, when in reality it only reduces MAGI and the deduction occurs on Form 1040, not on Form 8960.
The Future of NIIT and Legislative Considerations

Proposals to modify or repeal the NIIT surface periodically in Congress. While its fate remains uncertain, the tax currently affects millions of taxpayers. Certain legislative frameworks have discussed expanding the NIIT base or raising the rate. Monitoring these developments can help you adjust long-term plans, such as whether to accelerate gains before a potential rate increase. Regardless of changes, the fundamental discipline of tracking investment-related capital gains and losses, maintaining clean records, and maximizing allowable offsets will always serve you well.
Properly reporting capital gains and losses for the Net Investment Income Tax combines meticulous documentation with proactive planning. By mastering the interplay between Schedule D, Form 8949, and Form 8960, you can confidently file your return, minimize your surtax exposure, and keep more of your investment earnings working for you.
FAQ

What is the Net Investment Income Tax?
The Net Investment Income Tax is a 3.8% surtax on certain net investment income of individuals, estates, and trusts that exceeds specified income thresholds. It applies to investment income like interest, dividends, capital gains, rental and royalty income, and certain passive business income.
How does the NIIT apply to capital gains?
Capital gains from the sale of investment property are included in net investment income and subject to the 3.8% tax if your modified adjusted gross income exceeds the threshold. You report the net gain on Form 8960 after adjusting for excluded gains and netting losses.
Can capital losses reduce net investment income?
Yes, capital losses offset capital gains, reducing the net gain that enters the NII calculation. If losses exceed gains, the capital gain component is zero. Additionally, up to $3,000 of net capital loss can be deducted against ordinary income, lowering MAGI and potentially reducing the NIIT base.
What are the NIIT income thresholds?
For 2024, the thresholds are $200,000 for single filers and head of household, $250,000 for married filing jointly, $125,000 for married filing separately, and $15,450 for estates and trusts. The tax is 3.8% of the lesser of net investment income or the excess of MAGI over these amounts.
How do I report capital gains on Form 8960?
Start with your net capital gain from Schedule D. Remove gains not subject to NIIT, such as excluded home sale gains or gains from active business property. Report the adjusted net gain on Line 5a of Form 8960. The form then combines this with other investment income to compute the tax.
What strategies can help me avoid the 3.8% surtax?
Effective strategies include tax-loss harvesting, timing gain realizations, maximizing pre-tax retirement contributions, investing in municipal bonds, making charitable donations of appreciated securities, using installment sales, and ensuring you fully utilize the primary residence exclusion. Each reduces either NII or MAGI, lowering or eliminating the NIIT.