What is section 1231 gain?
Section 1231 gain is the recognized gain from selling or exchanging business-use property that is depreciable or is real property, held for more than one year. For real estate investors, the classic example is a rental building and the land it sits on.
The section gives business owners a one-way benefit. If all your section 1231 transactions for the year net to a gain, the gain is treated as long-term capital gain. If they net to a loss, the loss is ordinary and can offset wages or other income without the $3,000 capital loss limit.
What counts as section 1231 property?
Section 1231 property is depreciable property and real property used in a trade or business and held more than one year, minus a few exclusions in section 1231(b)(1). For a landlord that usually means the building, the land and the building’s components.
- Included: rental buildings, apartment complexes and the land they sit on, held over one year
- Included: depreciable equipment and personal property used in the rental, held over one year
- Excluded: inventory and property held primarily for sale to customers, such as a dealer’s or flipper’s homes
- Excluded: copyrights, patents and similar created property in certain hands
- Held one year or less: gain is ordinary and reported in Part II of Form 4797
How section 1231 netting works
Each year you combine every section 1231 gain and loss, and the net result decides the character of all of them. A net gain is long-term capital gain; a net loss is an ordinary loss.
That makes timing important if you own several properties. Selling a loser and a winner in the same year nets them together. Selling the loser one year and the winner the next can give you an ordinary loss first and capital gain later, but the lookback rule below limits that.
| Year’s 1231 result | How it is taxed | Where it goes |
|---|---|---|
| Net section 1231 gain | Long-term capital gain, after any lookback recapture | Form 4797 line 9 to Schedule D |
| Net section 1231 loss | Ordinary loss, no $3,000 cap | Form 4797 Part II |
| Gain recharacterized by the lookback | Ordinary income | Form 4797 line 12 |
The five-year lookback: section 1231(c)
Section 1231(c) treats this year’s net section 1231 gain as ordinary income to the extent of net section 1231 losses you deducted in the five most recent preceding years and haven’t already recaptured. It is designed to stop owners from taking an ordinary loss one year and capital gain the next.
On Form 4797 the prior losses go on line 8, and the matching amount of gain moves to line 12 as ordinary income. Keep a running schedule of your 1231 losses by year, because the IRS instructions apply them oldest first and expect you to track what is left.
Unrecaptured section 1250 gain and the 25% rate
Unrecaptured section 1250 gain is the part of your gain on depreciable real property that equals the straight-line depreciation you took, and section 1(h)(6) taxes it at your ordinary rate but no more than 25%. On a rental building held for years, it is often the single biggest bucket after plain capital gain.
Because residential rental property placed in service after 1986 is depreciated straight-line over 27.5 years, there is usually no additional depreciation to recapture as fully ordinary income under section 1250. The whole depreciation amount, up to your gain, lands in the 25% bucket instead. The IRS also counts depreciation you were allowed but didn’t claim, so skipping it doesn’t avoid the tax. Our rental property depreciation guide and depreciation recapture calculator cover the basics; the rest of this page shows how the buckets interact.
Section 1245 recapture on cost segregation assets
Components a cost segregation study reclassified as personal property, such as appliances, carpeting, cabinetry and dedicated electrical, are section 1245 property, and their depreciation is recaptured as ordinary income up to the gain on those assets. That ordinary rate can reach 37%, not 25%.
The recapture is limited to the gain on each asset, which depends on the asset’s fair market value at the sale. If five-year property that cost $600,000 is fully depreciated but worth $150,000 when you sell, the 1245 recapture is $150,000, not $600,000. A defensible allocation of the price, backed by an appraisal or the cost segregation firm, is worth the effort.
Land improvements such as paving and fencing are generally section 1250 property, but the IRS instructions say section 1250 recapture applies when you claimed a special depreciation allowance. Bonus depreciation on them can create ordinary recapture of the excess over straight-line. Our cost segregation and bonus depreciation guides explain how those deductions were built.
How a sale flows through Form 4797
A rental building sale is reported on Form 4797, which separates the gain into recapture, section 1231 gain and ordinary items before anything reaches Schedule D. The order matters because each step feeds the next.
- Part III, lines 19–32: list each asset (land, building, 1245 property) with price, basis and depreciation
- Line 25: section 1245 recapture, ordinary
- Line 26: any section 1250 additional depreciation, ordinary
- Part I, line 7: net section 1231 gain or loss after recapture is pulled out
- Line 8: nonrecaptured 1231 losses from the prior five years
- Line 9: line 7 minus line 8, carried to Schedule D as long-term gain
- Line 12 in Part II: the line 8 amount, taxed as ordinary income
- Schedule D worksheet: unrecaptured 1250 gain, reduced by the line 8 amount
Worked example: selling an apartment building in 2026
A married couple bought an apartment building in 2019 for $8,000,000: $1,600,000 for land, $5,800,000 for the building and $600,000 of five-year property identified by cost segregation and fully expensed with 100% bonus depreciation. By the 2026 sale they have taken $1,460,000 of straight-line depreciation on the building. They had a $120,000 net section 1231 loss in 2023 that has not been recaptured.
They sell in 2026 for $11,000,000 and pay $440,000 of selling costs, for an amount realized of $10,560,000. They allocate $150,000 to the personal property, $2,400,000 to land and $8,010,000 to the building. Total gain is $10,560,000 minus an adjusted basis of $5,940,000, or $4,620,000.
Gain on the personal property is $150,000, all section 1245 recapture. The building gain is $3,670,000 and the land gain $800,000, so net section 1231 gain is $4,470,000. The lookback turns $120,000 of that into ordinary income, and the Schedule D worksheet removes it from the 25% bucket. That leaves $1,340,000 of unrecaptured section 1250 gain and $3,010,000 of regular long-term gain.
With $250,000 of other taxable income, the $270,000 of ordinary income adds $74,342.50 of tax at the 24%, 32% and 35% brackets. The 25% bucket costs $335,000, the 20% bucket $602,000, and the 3.8% net investment income tax on the full $4,620,000 is $175,560. Total federal tax is $1,186,902.50 before any state tax.
| Bucket | Amount | 2026 federal rate | Tax |
|---|---|---|---|
| Section 1245 recapture | $150,000 | Ordinary (24%–35% here) | Included below |
| 1231(c) lookback recapture | $120,000 | Ordinary (24%–35% here) | Included below |
| Ordinary income total | $270,000 | 24%, 32%, 35% | $74,342.50 |
| Unrecaptured section 1250 gain | $1,340,000 | 25% | $335,000 |
| Long-term capital gain | $3,010,000 | 20% | $602,000 |
| Net investment income tax | $4,620,000 | 3.8% | $175,560 |
| Total | $4,620,000 | $1,186,902.50 |
Section 1231 gain in an installment sale or 1031 exchange
In an installment sale, all section 1245 and 1250 ordinary recapture is taxed in the year of sale under section 453(i), even if you collect most of the price in later years. Treas. Reg. 1.453-12 then treats the unrecaptured section 1250 gain as coming out of each payment first, before the 20% gain.
A 1031 exchange defers section 1231 gain, including unrecaptured section 1250 gain, as long as you trade real property for real property and take no boot. Since 2018 section 1031 covers only real property, so personal property components you sell with the building can trigger 1245 recapture even inside an exchange. Your qualified intermediary and CPA should agree on the allocation before closing.
How this works for a 5+ unit apartment building
For a 5+ unit apartment building, the price allocation in the purchase agreement drives the whole calculation. How much goes to land, building and personal property sets the 1245 recapture, the 25% bucket and the 20% bucket, and buyers and sellers often want different splits.
Owners who sold or wrote off another property at a loss in the last five years should check the lookback before they price the sale. If the building is held in a partnership, the K-1 reports your share of 1231 gain and unrecaptured 1250 gain separately, and the netting happens on your own return together with any other 1231 items you have that year.
Selling your apartment building to Skyline
Skyline Capital Investments buys apartment buildings with five or more units anywhere in the U.S. We are open to a reasonable allocation of the price among land, building and personal property that your CPA can support, and we work with seller-carry terms and 1031 exchange timelines when they fit.
Send the address and unit count through the form on this page or call (469) 660-2977. We typically respond within 48 hours.