The short answer
No. Reg. section 1.1400Z2(a)-1(b)(11) measures eligible gain without taking losses into account, so the gain on each sale stands on its own and a loss on a different position does not reduce the amount you may invest and defer. The trap runs the other way: if you defer the whole gain, the loss has nothing left to offset this year, and section 1211 caps what it can do against ordinary income at $3,000. The usual fix is to defer only part of the gain and let the losses absorb the rest.
At a glance
| Measurement rule | Eligible gain is determined without taking losses into account |
|---|---|
| Unit | Each sale's gain is its own eligible gain and its own election |
| Partial election | You may defer all or part of any eligible gain |
| Loss cap | Net capital loss offsets other income up to $3,000 a year, $1,500 married filing separately |
| Carryover | Unused net capital loss carries forward as short-term or long-term loss |
| Section 1231 gains | Eligible to the extent above section 1245 and 1250 ordinary income, measured per sale |
| Character later | The deferred gain comes back with the same short-term or long-term character |
The regulation counts gains one sale at a time and ignores losses
Reg. section 1.1400Z2(a)-1(b)(11)(i)(A) says an amount of gain is eligible if it is treated as capital gain or is a qualified 1231 gain, determined by not taking into account any losses unless the regulations say otherwise. A $300,000 gain on one stock is therefore $300,000 of eligible gain even if you lost $100,000 on another stock the same week.
The election follows the same shape. Section 1400Z-2(a)(1) defers so much of the gain as does not exceed the amount invested in a qualified opportunity fund within 180 days of that sale, and the IRS opportunity zone FAQs confirm you may defer the gain in whole or in part. Nothing in the statute asks you to net the year first.
The Form 8949 instructions carry this through to the return: each deferral gets its own row with code Z and a negative adjustment, and you choose how much short-term and how much long-term gain to defer. Losses are reported on their own rows and are never subtracted from the deferral row.
Deferring the whole gain can leave your losses with nowhere to go
A capital loss is useful only against capital gain and a small slice of other income. Section 1211(b) allows losses from sales of capital assets only to the extent of gains from such sales plus the lower of $3,000, or $1,500 for a married person filing separately, or the excess of losses over gains.
When you defer a gain, it leaves this year's return. If your remaining gains are smaller than your losses, the excess loss is limited to $3,000 against wages or interest, and section 1212(b) carries the rest forward as a short-term or long-term capital loss for the following year.
The loss is not destroyed. It waits, and it can offset the deferred gain when that gain is included, or any other gain in between. What you give up is its use now, which has a cost if you expect to be in a lower bracket later or would rather not carry the bookkeeping for five years.
A partial election usually keeps both benefits
Because the election can cover part of a gain, the clean answer is often to defer the gain above your losses and let the losses eat the rest. You keep the deferral on the large number and use the loss at full value in the current year, instead of at $3,000 a year.
The amount you invest in the fund then equals the gain you elect to defer, not the whole gain and not the net figure. Do I invest just the gain or the whole sale price covers the amount rule; what date starts the 180-day window covers the clock, which is unaffected by any loss.
Watch the holding period on the losses themselves. Short-term losses offset short-term gains first and long-term losses offset long-term gains first under section 1222 netting, so the gain you leave on the return should be the kind your losses can reach. Your CPA can run the netting before you pick the number.
Hypothetical: a $300,000 gain, a $100,000 loss, two ways to elect
Round, hypothetical figures. In March 2027 you sell one stock for a $300,000 long-term gain and another for a $100,000 long-term loss. You want to use a qualified opportunity fund for as much as makes sense.
Defer all $300,000: the return shows a $100,000 net capital loss, $3,000 of it deductible this year and $97,000 carried forward. Defer $200,000: the $100,000 gain left on the return is absorbed by the $100,000 loss, nothing is taxed, nothing is carried, and $200,000 goes into the fund by day 180 in September 2027.
Either way the deferred amount comes back under the post-2026 rules at the earlier of a sale of the fund interest or five years, reduced by a 10% basis increase, as set out in the rolling five-year deferral. A fund interest is a private, illiquid investment that can lose value, so the second plan also puts less at risk. Run both columns with your CPA at your own rates.
Section 1231 gains follow the same per-sale rule, with one lookback to check
For business property, the regulation defines qualified 1231 gain as the section 1231 gain on a sale to the extent it exceeds any amount treated as ordinary income under sections 1245 and 1250. That too is measured on the sale itself, not on the year's net section 1231 result, so a 1231 loss on another asset does not reduce it.
One provision can. Reg. section 1.1400Z2(a)-1(b)(11)(i)(A)(2) tells you to take into account any Code provision that recharacterizes potential capital gain as ordinary income, and section 1231(c) treats net section 1231 gain as ordinary income to the extent of nonrecaptured net section 1231 losses from the five preceding years. If you deducted 1231 losses recently, ask your CPA how much of this year's gain that lookback converts before you size the investment.
The ordinary slices are never eligible. Can I put depreciation recapture into an opportunity zone fund separates them from the capital gain that qualifies, and stock losses against a rental sale gain covers the mirror question for a seller who is not using a fund at all.
Related questions
Do I have to net my gains and losses before choosing the amount to invest?
No. The regulation measures each eligible gain without losses, so you may invest and defer the gross gain on a sale. Netting happens on the return for whatever gain you leave there.
Can I defer a gain and still deduct my losses this year?
Only against other gains and up to $3,000 of other income under section 1211(b). Anything beyond that carries forward under section 1212(b), which is why a partial election is often the better choice.
Will my carried-forward loss offset the deferred gain when it comes back?
Yes. The deferred gain returns as capital gain with its original character, and a capital loss carryover still available in that year can offset it under the ordinary netting rules.
Does a wash sale change any of this?
A disallowed wash-sale loss is not a loss you can use, so it neither reduces eligible gain nor offsets the gain you leave on the return. The eligible gain on the profitable sale is unaffected.
Does the same rule apply to crypto losses?
Yes. The IRS treats virtual currency as property, so a crypto loss is a capital loss when the coins were a capital asset, and it is handled exactly like a stock loss here. Stock or crypto gains in a fund covers the gain side.
Sources
Checked against these publications on October 8, 2026. Rules and figures change; confirm the current version with your CPA or attorney before you act. This page is general information, not tax or legal advice.
- Reg. section 1.1400Z2(a)-1, Deferring tax on capital gains by investing in opportunity zones
- 26 U.S. Code section 1400Z-2, Special rules for capital gains invested in opportunity zones
- Public Law 119-21, section 70421 (opportunity zone amendments)
- 26 U.S. Code section 1211, Limitation on capital losses
- 26 U.S. Code section 1212, Capital loss carrybacks and carryovers
- 26 U.S. Code section 1231, Property used in the trade or business and involuntary conversions
- IRS, Opportunity Zones Frequently Asked Questions
- IRS, Instructions for Form 8949
