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:
- Rental properties — single-family, multi-family, commercial, and industrial held as rentals qualify as §1231 property as long as you're in the trade or business of renting (even one property can qualify).
- Land held for rental or investment use — but land held primarily for sale to customers (a developer's lot inventory) is §1221 inventory, not §1231 property.
- Depreciable personal property used in the business — the 5-year and 7-year cost segregation components in a rental building are also §1231 property, though §1245 recapture rules apply first (discussed below).
What is NOT §1231 property:
- Inventory held for sale to customers (dealer status under IRC §1221(a)(1)) — house flippers in dealer status pay ordinary income on every flip, no §1231 benefit.
- Property held for investment but not used in a trade or business (e.g., raw land you've never rented) — those gains are capital gains under §1221, not §1231. The distinction matters because investment property losses hit the capital loss limitation ($3,000/year against ordinary income); §1231 losses do not.
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:
- Net §1231 gain → treated as long-term capital gain. Taxed at 0%, 15%, or 20% depending on your income, plus 3.8% NIIT if you're a passive investor above the thresholds. The same favorable rates as selling Apple stock held over a year.
- Net §1231 loss → treated as ordinary loss. Fully deductible against W-2 income, business income, dividends — any ordinary income, with no dollar cap. This is dramatically better than a capital loss, which is limited to $3,000/year against ordinary income.
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 first $60,000 of your 2026 §1231 gain is ordinary income — taxed at up to 37% (plus NIIT for passive investors).
- The remaining $40,000 is a net §1231 gain → long-term capital gain rates (15–20%).
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
- §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.
- §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.
- §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.
- NIIT 3.8% — stacks on top of all layers for passive investors above $200,000 single / $250,000 MFJ income thresholds.
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 Part | What Goes Here | Tax Treatment |
|---|---|---|
| Part I | Long-held §1231 assets (held >1 year) — the overall gain/loss netting happens here | Net gain → Schedule D (LTCG); Net loss → ordinary loss on Form 1040 |
| Part II | Short-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:
- Purchase price: $500,000 (2018). Land value: $75,000.
- Depreciable basis: $425,000 ($75K land excluded).
- Cost segregation study was done at purchase: $85,000 was reclassified to 5/7-year property (100% bonus depreciation claimed in 2018 under prior law at 100% bonus).
- Straight-line depreciation on remaining $340,000 at 27.5 years × 8 years = $98,909 claimed.
- Adjusted basis: $500,000 − $85,000 (cost seg) − $98,909 (SL) = $316,091.
- Sale price: $750,000. Total gain: $750,000 − $316,091 = $433,909.
- Prior §1231 losses: $30,000 (from a 2022 sale at a loss, not yet recaptured).
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 rate | LTCG rates (0/15/20%) after recapture | LTCG rates (0/15/20%) |
| Net loss deduction | Fully ordinary — no cap | Capped at $3,000/year against ordinary income |
| Recapture layers | Yes — §1245 ordinary + §1250 at 25% max | None |
| 5-year lookback | Yes — §1231(c) recharacterizes gains | No |
| NIIT on sale | Yes, if passive investor | Yes, on net investment income |
| Form used | Form 4797 → Schedule D | Form 8949 → Schedule D |
Sources
- 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.
- 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).
- 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.
- 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).
- 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.
- 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.
Related tools and guides
- Depreciation Recapture Calculator — compute your full §1245 + §1250 + LTCG + NIIT tax stack on a sale
- Depreciation Recapture Guide — §1245 vs. §1250 mechanics, four-layer tax stack, five exit strategies
- Taxes When Selling Rental Property (2026) — complete guide to the sale tax stack including PAL release and strategies
- 1031 Exchange Tax-Deferral Calculator — model how a 1031 defers the entire §1231 stack
- How to Avoid Capital Gains on Rental Property — seven strategies including 1031, installment sale, and QOZ
- Passive Activity Loss Rules — how PAL carryforwards release on §1231 disposition
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.