RE Investor Advisor Match

Section 1231 Gains for Real Estate Investors

IRC §1231 is the section of the tax code that explains why selling a long-held rental property produces favorable capital gains rates on the appreciation — and why a net loss on a property sale is fully deductible against ordinary income rather than capped at $3,000 like a stock loss. It also contains a five-year lookback rule that recharacterizes gains as ordinary income if you claimed §1231 losses in recent years — a provision that can cost an investor $50,000+ in unexpected tax and that most investors have never heard of.

What is §1231 property?

Section 1231 of the Internal Revenue Code applies to real property and depreciable property used in a trade or business, held for more than one year.1 For real estate investors, this means:

What is NOT §1231 property:

The §1231 "best of both worlds" mechanics

At the end of each tax year, you net all your §1231 gains and losses from transactions during the year:

The asymmetry: If your rental properties produce §1231 gains, you pay capital gains rates (potentially 15–20%). If they produce §1231 losses, you deduct them at ordinary income rates (potentially 37%). This is why §1231 is called the "best of both worlds" — except for the five-year lookback rule that partially eliminates it.

The five-year lookback rule (§1231(c)) — the catch most investors miss

This provision is the most important and least-understood part of §1231. The rule: if you have a net §1231 gain in the current year, that gain is recharacterized as ordinary income to the extent of any net §1231 losses you claimed in the previous five tax years that haven't already been "recaptured."2

In plain terms: you can't take ordinary income treatment on a loss and then get capital gain treatment on gains in the following years without first "paying back" the ordinary income you saved. The IRS essentially recaptures the advantage of the ordinary loss rate over time.

Lookback example

You sell a rental in 2021 for a $60,000 net §1231 loss (property values dropped in that market, you had no recapture). You deduct the full $60,000 against ordinary W-2 income — saving roughly $22,000 in tax at the 37% bracket.

In 2026, you sell a different rental for a $100,000 §1231 gain (appreciation plus basis). Under the lookback rule:

The five-year window means the 2021 loss still affects you in 2026 (within the five preceding years). A 2020 loss would not — that's outside the window by 2026.

The lookback is tracked on Form 4797 and requires you (or your CPA) to keep a running tally of prior-year §1231 losses used in previous cycles. Most tax software handles this, but many investors don't realize it's happening — and discover it only when their CPA explains a higher-than-expected tax bill on a sale.

How §1245 and §1250 recapture interact with §1231

Here's where it gets layered. A typical rental property sale involves multiple tax sections applied in sequence. Recapture provisions take priority over §1231 — they're carved out first, then what remains enters the §1231 calculation.

The calculation order

  1. §1245 recapture (first priority) — applies to cost segregation components (5-year and 7-year personal property). All depreciation claimed on those components up to the gain is recaptured as ordinary income. At 37% federal rate plus 3.8% NIIT for passive investors, this is the most expensive layer. Form 4797 Part III handles this.
  2. §1250 — unrecaptured gain (second layer) — for real property placed in service after 1986 using MACRS straight-line depreciation, §1250 generates zero additional ordinary recapture (because MACRS is already straight-line and §1250 only recaptures depreciation in excess of straight-line). But the accumulated straight-line depreciation on the building is "unrecaptured §1250 gain" — taxed at a special maximum rate of 25% (per IRC §1(h)(1)(D)), not regular capital gain rates.
  3. §1231 gain (remaining appreciation) — the gain above all depreciation claimed. This enters the §1231 netting calculation. If the overall §1231 net is a gain, this flows to Schedule D as long-term capital gain — taxed at 0%, 15%, or 20% depending on income.
  4. NIIT 3.8% — stacks on top of all layers for passive investors above $200,000 single / $250,000 MFJ income thresholds.
Important: The §1231 lookback in Step 3 applies to the remaining §1231 gain (the appreciation portion), not to the §1245 or §1250 layers. Prior §1231 losses can push your appreciation gain from 15–20% LTCG treatment into ordinary income territory — but they don't change how your depreciation recapture is taxed.

Form 4797: where §1231 actually gets calculated

When you sell a rental property, you don't report it on Schedule D (which is for capital assets). Instead, §1231 transactions go on Form 4797 (Sales of Business Property):3

Form 4797 PartWhat Goes HereTax Treatment
Part ILong-held §1231 assets (held >1 year) — the overall gain/loss netting happens hereNet gain → Schedule D (LTCG); Net loss → ordinary loss on Form 1040
Part IIShort-term assets (held ≤1 year) and ordinary gains (e.g., short-term rental property)Ordinary income
Part III§1245 and §1250 recapture calculation for property in Part I or II§1245 recapture → ordinary income; §1250 unrecaptured gain → 25% max rate on Schedule D

The net §1231 gain from Part I flows to Schedule D as a long-term capital gain — which is where the §1231 lookback in §1231(c) is also applied. The §1250 unrecaptured gain also appears on Schedule D but in a separate column taxed at the 25% maximum rate.

Worked example: the full §1231 tax stack

A real estate investor (MFJ, $350,000 W-2 income) sells a residential rental in 2026:

Step 1 — §1245 recapture (Form 4797 Part III):
The $85,000 cost seg components were personal property. On sale, all $85,000 of depreciation claimed is recaptured as ordinary income under §1245.
Tax: $85,000 × (37% + 3.8% NIIT) = $85,000 × 40.8% = $34,680

Step 2 — §1250 unrecaptured gain:
The $98,909 of straight-line depreciation on the building is unrecaptured §1250 gain. Taxed at the 25% maximum rate (+ 3.8% NIIT = 28.8% effective for passive investors).
Tax: $98,909 × 28.8% = $28,486

Step 3 — §1231 gain (remaining appreciation):
$433,909 total gain − $85,000 §1245 − $98,909 §1250 = $249,000 §1231 gain.
But $30,000 of prior §1231 losses trigger the lookback: $30,000 recharacterized as ordinary income.
Tax on $30,000 lookback: $30,000 × (37% + 3.8%) = $12,240
Remaining $219,000 LTCG: $219,000 × (20% + 3.8%) = $52,122 (at 20% rate because MFJ income above $613,700 threshold)4

Total federal tax on the sale: approximately $127,528 — on a $433,909 gain. The lookback alone added ~$6,000 vs. if there had been no prior §1231 losses.

Strategic planning around §1231

Track your §1231 loss carryovers

Keep a running tally. If you sold a property at a loss in the last five years, your CPA should have noted "§1231 loss carryover" on your return. The Form 4797 instructions require this tracking. Many investors (and some CPAs) miss this and are surprised by ordinary income treatment on what they expected to be a capital gain.

Timing dispositions around the lookback window

If you took a $50,000 §1231 loss in 2021, wait until 2027 to sell the gain property if you can — the 2021 loss falls outside the five-year window by then, and the full gain qualifies for capital rates. This requires holding or deferring the sale for two years, which may or may not make economic sense, but the tax difference can be meaningful at high income levels.

§1031 exchange eliminates both the §1231 gain and recapture

A properly structured 1031 exchange defers the entire tax stack — §1245 recapture, §1250 unrecaptured gain, §1231 gain, and the lookback recharacterization all roll to the replacement property. No current-year §1231 gain = no lookback triggered. No current-year §1231 loss either, since the loss basis carries forward to the replacement.

PAL carryforwards release on disposition and can offset the §1231 stack

Suspended passive activity losses under §469 are released when you dispose of the property in a fully taxable transaction (§469(g)). These PAL carryforwards can offset the §1231 gain (and even the §1245 and §1250 amounts, to the extent they're net ordinary income). A property with large accumulated PAL carryforwards may have minimal net tax even on a large gross gain.

The "best of both worlds" is real but partial

The §1231 asymmetry does genuinely exist — a net loss in a year is fully ordinary-deductible. But the lookback means you can't string together loss years followed by gain years and pay ordinary rates on the losses while paying capital rates on all the gains. The first five years of gains after losses are "clawed back" at ordinary rates. After the five-year window, the gains are purely capital again.

§1231 vs. pure capital gains (§1221)

Feature§1231 Property (Rental RE)§1221 Capital Asset (Stocks)
Net gain tax rateLTCG rates (0/15/20%) after recaptureLTCG rates (0/15/20%)
Net loss deductionFully ordinary — no capCapped at $3,000/year against ordinary income
Recapture layersYes — §1245 ordinary + §1250 at 25% maxNone
5-year lookbackYes — §1231(c) recharacterizes gainsNo
NIIT on saleYes, if passive investorYes, on net investment income
Form usedForm 4797 → Schedule DForm 8949 → Schedule D

Sources

  1. IRC §1231 — Property Used in the Trade or Business and Involuntary Conversions. §1231(a): Net gain from §1231 transactions treated as LTCG; net loss treated as ordinary loss. §1231(b): Scope — real property and depreciable property held >1 year in a trade or business. Values verified 2026; OBBBA (2025) and SECURE 2.0 (2022) did not modify §1231 netting rules.
  2. IRC §1231(c) — Recapture of Net Ordinary Losses. Five-year lookback: current-year net §1231 gain is ordinary income to the extent of net §1231 losses in the 5 preceding taxable years not already recaptured. Cross-checked against IRS Form 4797 Instructions, Part I Section B (Recapture of Prior Year Ordinary Losses).
  3. IRS Form 4797 Instructions (2025). Part I: long-held §1231 assets; Part II: short-term/ordinary; Part III: §1245/§1250 recapture. Net §1231 gain flows to Schedule D line 11.
  4. IRS Rev. Proc. 2025-32 — 2026 Tax Inflation Adjustments. 2026 LTCG 0% threshold: $49,450 single / $98,900 MFJ. 15% rate: $49,451–$545,500 single / $98,901–$613,700 MFJ. 20% rate above those. §1411 NIIT thresholds: $200,000 single / $250,000 MFJ (not indexed). §1250 unrecaptured gain max 25% rate: IRC §1(h)(1)(D).
  5. IRC §1245 — Gain from Dispositions of Certain Depreciable Property. §1245(a)(1): amount of gain recognized equals the lesser of depreciation claimed or the gain on sale — treated as ordinary income. Applies to cost segregation 5-year and 7-year personal property components.
  6. IRC §469(g) — Dispositions of Entire Interest in Passive Activity. Suspended PAL losses released on fully taxable disposition; deductible against all income including §1231 gains. Cross-referenced with Form 8582.

Tax values verified against 2026 IRS inflation adjustments (Rev. Proc. 2025-32). §1231 netting rules and §1231(c) lookback are established Code provisions unchanged by OBBBA (July 2025), SECURE 2.0 (2022), or Social Security Fairness Act (January 2025). Consult a qualified tax advisor for your specific situation.

Get your §1231 tax stack modeled before you sell

Most investors don't know their §1231 loss carryover balance, don't account for the lookback, and don't model the PAL release timing — until their CPA hands them a bill after closing. A fee-only financial advisor who specializes in real estate investors can run the full calculation before you list the property. Free match.