Yes, a net operating loss can offset capital gains. Because both short-term and long-term capital gains are part of taxable income, an NOL carried into the year of the sale reduces that income dollar for dollar, cutting or eliminating the tax on the gain. The catch: for NOLs arising in tax years beginning after December 31, 2017, the deduction is capped at 80% of your taxable income for the carryforward year, so a single large gain may not be wiped out completely in one year. NOLs from tax years beginning before 2018 face no such cap and can absorb 100% of the gain.
How the Offset Works
An NOL arises when your allowable business deductions exceed your gross income for the year, with adjustments required under Internal Revenue Code Section 172.1Office of the Law Revision Counsel. 26 USC 172 – Net Operating Loss Deduction When you carry that loss into a year with a capital gain, it reduces your taxable income the same way it would reduce wages or business profit. The character of the income does not matter to the NOL. Short-term gains taxed at ordinary rates and long-term gains taxed at 0%, 15%, or 20% are both absorbed on the same basis.2Internal Revenue Service. Topic No. 409, Capital Gains and Losses
You report the deduction as a negative number on Schedule 1 (Form 1040), line 8a, and it flows into total income before AGI is calculated.3Internal Revenue Service. 2025 Schedule 1 (Form 1040) That placement matters. Because the NOL reduces AGI itself, it also lowers the income base used for other calculations tied to AGI, including the Net Investment Income Tax threshold discussed below.
Gains from the sale of depreciable business property held more than a year are usually Section 1231 gains. When your Section 1231 gains for the year exceed your Section 1231 losses, the net is treated as a long-term capital gain.4eCFR. 26 CFR 1.1231-1 – Gains and Losses From the Sale or Exchange of Certain Property Used in the Trade or Business Those gains sit in taxable income like any other capital gain, and the NOL applies against them.
One thing the NOL will not do: reduce your self-employment tax. NOL carryforwards and carrybacks have no effect on SE tax for the year to which they are carried.5Internal Revenue Service. Net Operating Loss Cases
The 80% Cap on Post-2017 Losses
The Tax Cuts and Jobs Act rewrote NOL usage for losses arising in tax years beginning after December 31, 2017. The deduction cannot exceed 80% of your taxable income for the carryforward year, and that taxable income is figured without regard to the NOL deduction itself, the Section 199A qualified business income deduction, and the Section 250 deduction.6Internal Revenue Service. Tax Cuts and Jobs Act – A Comparison for Businesses7Office of the Law Revision Counsel. 26 US Code 172 – Net Operating Loss Deduction
Here is what that looks like against a large gain. Say you have $1,000,000 of long-term capital gain and no other income or deductions. Your taxable income before the NOL deduction is $1,000,000. Even if you have accumulated $1,500,000 in post-2017 NOLs, this year you can only deduct $800,000 of that balance. The remaining $200,000 of gain stays taxable. The $700,000 of unused NOL carries into next year.
The trade-off for the cap is that post-2017 NOLs carry forward indefinitely. The old 20-year expiration is gone, and the loss will not vanish on a clock.8Internal Revenue Service. Instructions for Form 172 The TCJA also eliminated the general two-year carryback. Farming losses are the exception and can still be carried back two years, with an election available to waive that carryback.7Office of the Law Revision Counsel. 26 US Code 172 – Net Operating Loss Deduction
Pre-2018 NOLs Are More Valuable
If you still hold NOLs from tax years beginning before January 1, 2018, those older losses are not subject to the 80% cap. A pre-2018 NOL can eliminate 100% of your taxable income for the carryforward year, capital gain included.
The IRS requires you to use the oldest NOLs first. This first-in, first-out ordering means the uncapped pre-2018 losses come off the top before any 80%-limited post-2017 losses are touched.8Internal Revenue Service. Instructions for Form 172 The rule works in your favor when you have a mix. Track each year’s loss separately, because everything about how it can be used depends on when it originated.
Impact on the 3.8% Net Investment Income Tax
Anyone with a capital gain large enough to worry about NOL offsets is usually in Net Investment Income Tax territory. The 3.8% NIIT applies once your modified adjusted gross income crosses $200,000 (single) or $250,000 (married filing jointly), on the lesser of net investment income or the amount your MAGI exceeds the threshold. Those thresholds are not indexed for inflation.
The NOL helps in two distinct ways. First, because the deduction reduces AGI (and therefore MAGI), a large enough NOL can push you below the threshold and eliminate the surtax entirely. Second, a portion of the NOL can be subtracted directly from net investment income on Form 8960, line 7, but only to the extent the original loss was attributable to investment activities.9Internal Revenue Service. Instructions for Form 8960 This is the “Section 1411 NOL,” computed for each loss year as the lesser of (a) the NOL you would have had if only investment income and investment-related deductions were counted, or (b) your actual NOL for that year.
In practice, if your NOL came from a trade or business rather than investment activity, it will still lower your MAGI, but the direct offset against net investment income will be small or zero. Losses that originated in investment activities give you the benefit on both sides.
The AMT Floor
If you are subject to the Alternative Minimum Tax, the NOL faces a tighter ceiling. The alternative tax net operating loss deduction is limited to 90% of alternative minimum taxable income, calculated before the ATNOLD itself.10Internal Revenue Service. Instructions for Form 6251 (2025) The AMT system uses its own version of taxable income, so the figures will not match the regular calculation. The 90% cap means at least 10% of your AMTI survives as a floor, no matter how large the NOL.
Ordinary Loss Character Is the Point
Compare the NOL to a plain net capital loss and the value of the offset becomes clear. Individuals can deduct only $3,000 of net capital losses against ordinary income each year. Corporations cannot deduct net capital losses against ordinary income at all.2Internal Revenue Service. Topic No. 409, Capital Gains and Losses The NOL carries no such character restriction. It reduces the whole taxable income base, whether that income is a capital gain, wages, rent, or business profit.
Section 382 Cap for Corporations
Corporations carrying substantial NOL balances face a limitation individuals do not. Under Section 382, if the corporation undergoes an “ownership change,” the annual amount of pre-change NOL it can use going forward is capped. An ownership change occurs when one or more 5-percent shareholders increase their combined stake by more than 50 percentage points over a rolling three-year testing period.11Office of the Law Revision Counsel. 26 US Code 382 – Limitation on Net Operating Loss Carryforwards and Certain Built-In Losses Following Ownership Change
Once triggered, the annual usage cap equals the value of the loss corporation immediately before the change multiplied by the federal long-term tax-exempt rate.12eCFR. 26 CFR 1.382-5 – Section 382 Limitation That rate is 3.58% as of mid-2025.13Internal Revenue Service. Rev. Rul. 2025-24 A corporation valued at $10,000,000 before the change would face an annual NOL usage cap of roughly $358,000. Excess NOLs still carry forward indefinitely, but the yearly ceiling makes it impossible to shelter a single large capital gain with a big accumulated loss right after an ownership change. This most often surfaces in acquisitions where the target’s NOL balance is part of the appeal.
State Tax Is a Separate Question
Federal NOL rules do not carry over automatically. Many states have not adopted the TCJA’s indefinite carryforward and instead impose their own windows, often ranging from 5 to 20 years. Some cap the annual dollar amount of NOL that can be used, and a few states with gross receipts taxes do not offer NOL deductions at all. Before you count on a federal NOL to erase the tax on a gain, check your state’s conformity. A gain that is fully offset on the federal return can still generate a substantial state bill.