Yes, a net operating loss can offset capital gain income. The NOL deduction reduces your taxable income dollar for dollar, and capital gains — both short-term and long-term — are part of that taxable income. The size of the offset depends on when the loss arose: NOLs from tax years beginning after December 31, 2017 are capped at 80% of your taxable income for the year, while older NOLs can eliminate 100% of the gain.
How the Offset Works
The NOL deduction is reported as a negative number on Schedule 1 (Form 1040), line 8a, and flows into total income before your adjusted gross income is calculated.1Internal Revenue Service. 2025 Schedule 1 (Form 1040) Because it reduces AGI itself, the loss shrinks the income base the tax is computed on. Long-term capital gains keep their preferential 0%, 15%, or 20% rates, but the taxable amount they apply to is what remains after the NOL has been subtracted.2Internal Revenue Service. Topic No. 409, Capital Gains and Losses
An NOL treats capital gain income no differently from wages or business profits. That is a meaningful contrast with net capital losses, which individuals can deduct against ordinary income only up to $3,000 per year, and which corporations cannot deduct against ordinary income at all.2Internal Revenue Service. Topic No. 409, Capital Gains and Losses The NOL faces no such character restriction.
The 80% Cap on Post-2017 NOLs
The Tax Cuts and Jobs Act limits the deduction for NOLs arising in tax years beginning after December 31, 2017 to 80% of taxable income for the carryforward year.3Internal Revenue Service. Tax Cuts and Jobs Act – A Comparison for Businesses Taxable income for this purpose is figured without the NOL itself, the Section 199A qualified business income deduction, or the Section 250 foreign-derived intangible income deduction.4Office of the Law Revision Counsel. 26 USC 172 – Net Operating Loss Deduction
A worked example makes the ceiling concrete. Say you have $1,000,000 of long-term capital gain and no other income or deductions. Your taxable income before the NOL is $1,000,000. Even if your accumulated post-2017 NOL is $1,500,000, the most you can deduct this year is $800,000. That leaves $200,000 of the gain taxable and $700,000 of NOL carried forward.
The trade-off is that post-2017 NOLs carry forward indefinitely, so unused amounts do not expire.5Internal Revenue Service. Instructions for Form 172 The general two-year carryback was eliminated, with a narrow exception for farming losses.6Office of the Law Revision Counsel. 26 US Code 172 – Net Operating Loss Deduction
Pre-2018 NOLs Are Not Capped
If you still have NOLs from tax years beginning before January 1, 2018, those losses can offset 100% of your taxable income, including the full amount of a capital gain. That makes older NOLs meaningfully more valuable when you face a large gain concentrated in one year.
The IRS requires you to apply the oldest NOLs first. This first-in, first-out order works in your favor: the uncapped pre-2018 losses absorb income at full value, and the 80%-limited post-2017 losses come into play only after the older losses are used up.5Internal Revenue Service. Instructions for Form 172 Track each year’s NOL separately, because the limitation depends entirely on the loss year.
Section 1231 Gains From Business Property
Many gains that feel like capital gains actually come from selling business assets and pass through Section 1231. When your Section 1231 gains for the year exceed your Section 1231 losses, the net gain is treated as long-term capital gain and qualifies for the lower rates.7eCFR. 26 CFR 1.1231-1 – Gains and Losses From the Sale or Exchange of Certain Property Used in the Trade or Business It also lands in your taxable income like any other capital gain, so an NOL can offset it under the same rules described above. Selling a building, heavy equipment, or other depreciable business property held more than a year and coming out with a net gain? The NOL applies.
The 3.8% Net Investment Income Tax
A capital gain large enough to make you think about NOLs will almost certainly put you in the range of the Net Investment Income Tax. The NIIT is 3.8% and kicks in when modified adjusted gross income exceeds $200,000 for single filers or $250,000 for joint filers. It applies to the lesser of net investment income or the amount by which MAGI exceeds the threshold. These thresholds are not indexed for inflation.
The NOL helps in two ways. It reduces AGI, and therefore MAGI, so a large enough NOL can push you below the surtax threshold entirely. It also lets you subtract a portion of the loss directly against net investment income on Form 8960, but only to the extent the original loss came from investment activities rather than a trade or business.8Internal Revenue Service. Instructions for Form 8960 The mechanism is the “Section 1411 NOL” for each loss year, defined as the lesser of the NOL you would have had counting only investment income and investment-related deductions, or the actual NOL for that year. That fraction is what reduces NII on Form 8960, line 7.
The practical result: if the NOL grew out of a trade or business, expect the MAGI reduction to do most of the work and the direct NII offset to be small or zero. If the loss came from investment activities, you benefit on both sides.
Alternative Minimum Tax
Under the AMT, the NOL is subject to a tighter cap. The alternative tax net operating loss deduction is limited to 90% of alternative minimum taxable income, computed before the ATNOLD itself.9Internal Revenue Service. Instructions for Form 6251 (2025) AMT uses its own taxable income calculation, so the numbers will not match the regular tax computation. At least 10% of alternative minimum taxable income is preserved as a floor no matter how large the NOL is.
What the NOL Does Not Do
An NOL does not reduce self-employment tax. Carryforwards and carrybacks have no effect on the SE tax liability for the year to which they are carried.10Internal Revenue Service. Net Operating Loss Cases SE tax is computed on Schedule SE from that year’s actual net earnings from self-employment, not from AGI after the NOL is applied. If your capital gain is accompanied by self-employment income, the SE tax on that income stays.
Section 382 Limits for Corporations
Corporations carrying large NOL balances face a restriction individuals do not. Under Section 382, if a corporation undergoes an “ownership change,” the annual amount of pre-change NOL it can use is capped. An ownership change occurs when one or more 5-percent shareholders increase their ownership 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
The annual cap equals the value of the loss corporation immediately before the ownership change multiplied by the federal long-term tax-exempt rate.12eCFR. 26 CFR 1.382-5 – Section 382 Limitation As of mid-2025, that rate is 3.58%.13Internal Revenue Service. Rev. Rul. 2025-24 A corporation valued at $10,000,000 immediately before the change would face an annual cap of roughly $358,000, regardless of how large the capital gain is or how much NOL sits on the books. Excess NOL still carries forward, but the yearly ceiling makes it impossible to erase one large gain with one large accumulated loss.
Check Your State Rules
Federal NOL treatment does not automatically flow through to your state return. Many states have not adopted the indefinite carryforward and impose their own windows, often somewhere between 5 and 20 years. Some cap the dollar amount usable in a given year. A few states with gross receipts taxes do not allow NOL deductions at all. A capital gain fully wiped out on the federal return can still produce a substantial state tax bill, so confirm state conformity before assuming the offset is complete.