Form 4797 Rental Property Sale: Section 1231 Gain, Loss, Lookback
Some links pay us a referral fee; each one says so. Disclosure
Quick Answer
A rental building sold after more than one year is a section 1231 asset, so the sale goes on Form 4797: the building in Part III (to find any ordinary recapture) and the land in Part I, and every 1231 gain and loss of the year is netted on line 7. A net loss is an ordinary loss; a net gain is long-term capital gain, except that it is ordinary income up to the net 1231 losses of the 5 preceding tax years that were never recaptured (lines 8 and 9). Publication 544 says property held for the production of rents is generally considered used in a trade or business, which is what puts a rental in section 1231 rather than on Form 8949. As of October 22, 2026, the latest edition we found is the 2025 form and instructions. In our hypothetical 2026 sale (our arithmetic), $378,000 of gain splits into $368,600 of long-term capital gain and $9,400 of ordinary income on appliances, with $120,000 of the capital gain in the 25% layer; a sale at an $84,000 loss is a fully ordinary loss, and if it is followed in 2028 by a $120,000 net 1231 gain, $84,000 of that gain is ordinary income and $36,000 is capital gain.
Key Takeaways
- Rental real estate held more than 1 year is usually section 1231 property: the Form 4797 instructions count real or depreciable property used in a trade or business, and Publication 544 says property held for the production of rents is generally considered used in a trade or business.
- Land and building go in different parts: when you sell both together, the instructions require you to allocate the amount realized by fair market value and report the building in Part III and the land in Part I (Instructions for Form 4797, 2025).
- A loss is not a capital loss: Publication 544 says a net section 1231 loss is an ordinary loss. The $3,000 limit in the instructions applies to depreciable property held for investment and not used in a trade or business, which is reported on Form 8949 instead.
- A net 1231 gain is ordinary income to the extent of nonrecaptured net 1231 losses from the 5 preceding tax years (26 U.S.C. 1231(c)). In our example a 2026 loss of $84,000 turns $84,000 of a 2028 gain of $120,000 ordinary, and no longer counts in 2032.
- Only losses you actually used count: the instructions include losses only to the extent taken into account in figuring taxable income, so a loss still suspended under the passive rules is not yet a lookback loss (our reading).
- Fund investors do not fill Part III themselves: the instructions send Schedule K-1 (Form 1065) box 10 to Part I, and a fund's own sale is netted on its Schedule K.
CSV · 84 rows
Form 4797 and section 1231 on a rental property sale: rules, form lines, IRS examples and three worked examples
84 rows: 26 U.S.C. 1231 and its 5-year lookback, the Form 4797 (2025) line map, the IRS rules for a rental sale, the IRS lookback examples, and our worked gain, loss and lookback examples.
Is your rental a section 1231 asset? Three cases, three forms
The first decision is not arithmetic but which form the sale lands on. The Instructions for Form 4797 list the transactions that are section 1231 transactions: sales of real or depreciable property used in a trade or business and held for more than 1 year, counting from the day after you acquired it through the day you sold it.
| What you sold | Where it goes | Character of the result | Source |
|---|---|---|---|
| Rental building or rental house held more than 1 year | Form 4797, Part III for recapture, Part I for the gain or loss | Net 1231 gain: long-term capital gain after any ordinary recapture. Net 1231 loss: ordinary loss | Pub. 544 ch. 3; Instructions for Form 4797, Part I |
| Land under that rental | Form 4797, Part I (not Part III) | Same netting as the building | Instructions for Form 4797, same-transaction rule |
| Appliances, carpet or other section 1245 items | Form 4797, Part III, then line 13 | Gain up to depreciation taken is ordinary income | Form 4797 (2025) lines 25a and 25b |
| Items you expensed under the de minimis safe harbor ($2,500 or $5,000 limit) | Form 4797, Part II, line 10 | Ordinary gain, not section 1231 | Pub. 544 ch. 3 |
| Rental held 1 year or less | Form 4797, Part II | Ordinary | Instructions for Form 4797, Part II, line 10 |
| Depreciable property held for investment but not used in a trade or business | Form 8949 and Schedule D, with Part III only for recapture | Gain is generally capital. A loss is a capital loss, limited to $3,000 a year beyond capital gains ($1,500 if married filing separately) | Instructions for Form 4797, Disposition of Depreciable Property Not Used in Trade or Business |
For a normal landlord the second row of the table is the one that matters: the rental is treated as used in a trade or business, so a loss on the sale keeps its ordinary character. Section 1231(b)(1) defines the term as depreciable property or real property used in the trade or business and held for more than 1 year. Which side of the line a particular property falls on can depend on facts we cannot see, such as whether the activity is a trade or business; that is a question for a preparer. How the depreciation layer inside a gain is taxed is in our guide to depreciation recapture on a rental property; this page is about the form and the netting.
The map of the form: which line does what
Form 4797 (2025) has four parts. Part I and Part III are the two a rental sale uses most; Part II holds ordinary items.
| Line | What it does | Where it goes |
|---|---|---|
| Part I, line 2, columns (d) to (g) | Gross sales price, depreciation allowed or allowable, cost plus improvements and expense of sale; column (g) is (d) plus (e) minus (f) | Gain or loss for each 1231 property, including land and a building sold at a loss |
| Line 6 | Part III gain that is not ordinary recapture (line 32) | Added into line 7 |
| Line 7 | Combine lines 2 through 6 | Zero or loss: line 11. Gain with no prior unrecaptured 1231 losses: long-term capital gain on Schedule D |
| Line 8 | Nonrecaptured net 1231 losses from prior years | Reduces the capital gain; the amount on line 8 is carried to line 12 |
| Line 9 | Line 7 minus line 8 | The excess over zero is long-term capital gain on Schedule D |
| Line 11 | Loss from line 7 | Part II: ordinary loss |
| Line 12 | Gain from line 7, or the line 8 amount | Part II: ordinary gain |
| Line 13 | Recapture from Part III line 31 | Part II: ordinary gain |
| Line 18b | Net of Part II after the personal-property carve-out in line 18a | Schedule 1 (Form 1040), Part I, line 4 |
| Part III, lines 20 to 24 | Gross sales price, cost plus expense of sale, depreciation allowed or allowable, adjusted basis, total gain | One column per property |
| Line 25b, line 26g | Section 1245 recapture, section 1250 recapture | Added on line 31 and carried to line 13 |
Three details from the instructions are easy to miss. First, the gross sales price on line 20 includes any debt the buyer assumes or takes the property subject to. Second, line 22 is depreciation “allowed or allowable”, so a missed year of depreciation still reduces basis. Third, a straight-line 27.5-year residential rental building placed in service after 1986 has no section 1250 recapture, so line 26g is zero; accelerated depreciation or a special depreciation allowance can change that. If you reported the sale on an installment basis, the 1231 gain comes in through line 4 from Form 6252; see our guide to the installment sale and to a like-kind exchange, which reports on line 5 or 16 through Form 8824.
Worked example A: a gain sale with land, building and equipment
All figures here are our assumption for a 2026 sale and use the line structure of the 2025 form. A landlord sells a rental for $700,000 and pays selling costs of 6% ($42,000). The price is allocated by fair market value: land $175,000, building $515,000, and 5-year appliances and carpet $10,000. Selling costs follow the same proportions. The building is 27.5-year straight-line property with $120,000 of depreciation allowed; the appliances cost $15,000 and are fully depreciated.
| Piece | Price (line 20 / col d) | Cost + selling costs | Depreciation (line 22) | Adjusted basis (line 23) | Gain (line 24) |
|---|---|---|---|---|---|
| Land (Part I) | $175,000 | $110,500 | $0 | $110,500 | $64,500 |
| Building (Part III) | $515,000 | $330,900 | $120,000 | $210,900 | $304,100 |
| Appliances (Part III) | $10,000 | $15,600 | $15,000 | $600 | $9,400 |
| Total | $700,000 | $457,000 | $135,000 | $322,000 | $378,000 |
How it flows (our arithmetic). The building has no section 1250 recapture (line 26g is $0). The appliances are section 1245 property: line 25b is the smaller of the gain ($9,400) or the depreciation ($15,000), so $9,400 is ordinary income on line 13. Line 30 is $313,500, line 31 is $9,400, and line 32 is $304,100, which goes to line 6. Line 7 is the land gain of $64,500 plus $304,100, or $368,600. With no prior 1231 losses it goes to Schedule D as long-term capital gain. The Schedule D worksheet for unrecaptured section 1250 gain starts with the smaller of line 22 or line 24 for the building, $120,000, so that much of the $368,600 can be taxed up to 25% and the other $248,600 at 0%, 15% or 20%; for the rates and the brackets see our depreciation recapture guide and the capital gains guide. The $9,400 flows through line 18b to Schedule 1, line 4. The Form 8960 instructions say line 5a of the net investment income tax form combines Form 1040 line 7a and Schedule 1 line 4, so both land in the NIIT calculation; whether the tax applies depends on your status, covered in our net investment income tax guide.
Worked example B: the same rental sold at a loss
Now the market has gone the other way. Assume a rental bought for $500,000 (land $120,000, building $380,000), $40,000 of depreciation allowed, sold in 2026 for $400,000 (land $100,000, building $300,000) with 6% selling costs ($6,000 and $18,000).
| Piece | Price (col d) | Depreciation (col e) | Cost + selling costs (col f) | Gain or loss (col g) |
|---|---|---|---|---|
| Land | $100,000 | $0 | $126,000 | ($26,000) |
| Building | $300,000 | $40,000 | $398,000 | ($58,000) |
| Line 7 | ($84,000) |
Part III is for gain, so a loss on the building is figured in Part I, column (g): $300,000 plus $40,000 minus $398,000 is a $58,000 loss (our arithmetic). Line 7 is negative, so it goes to line 11 as an ordinary loss of $84,000, through line 18b to Schedule 1, line 4. Compare the other treatment: if the same $84,000 were a capital loss with no capital gains, the instructions allow a deduction of the lower of $3,000 or the excess of losses over gains, leaving $81,000 for later years (our arithmetic). That gap is why the character question comes first.
Two checks before the loss is used. The instructions tell you that if the asset was used in a passive activity, you use Form 8582 to see how much loss is allowed before entering it on Form 4797, and the Form 8582 instructions say that when you dispose of your entire interest to an unrelated person in a fully taxable transaction, the losses of the activity, including prior-year unallowed losses, are not limited by the passive rules. For the allowance and the suspended-loss ledger, see our Form 8582 guide. The second check is the lookback below.
Worked example C: the 5-year lookback
Section 1231(c) is the part nobody sees until it bites. The net section 1231 gain of a year is ordinary income up to the non-recaptured net 1231 losses of the 5 most recent preceding taxable years. The loss in example B is such a loss.
| Year | Event (our assumption) | Form 4797 result (our arithmetic) |
|---|---|---|
| 2026 | Example B: net 1231 loss of $84,000 | Ordinary loss on line 11; $84,000 becomes a nonrecaptured loss |
| 2028 | A second rental is sold at a net 1231 gain of $120,000 | Line 7 $120,000; line 8 $84,000; line 9 $36,000. $84,000 is ordinary income on line 12 and $36,000 is long-term capital gain |
| 2032 | Another net 1231 gain | The 5 preceding years are 2027 to 2031, so the 2026 loss no longer counts |
The IRS shows the same mechanics with small numbers. In the Form 4797 instructions, net 1231 losses of $4,000 (2020) and $6,000 (2021) and net gains of $3,000 (2024) and $2,000 (2025) give nonrecaptured losses of $7,000 on line 8, so the whole $2,000 gain for 2025 is ordinary. Publication 544 has a $2,500 loss in 2022, a $1,800 gain in 2024 and a $2,000 gain in 2025: $700 is ordinary and $1,300 is capital gain. The lookback also reaches the 25% layer: the Schedule D worksheet for unrecaptured section 1250 gain subtracts the Form 4797 line 8 amount from the gain it uses (worksheet lines 8 and 9), so, in our reading, gain made ordinary by the lookback is taken out of the 25% layer.
Two quirks follow from the statute. Losses and gains are only included if taken into account in computing taxable income or gross income (section 1231(a)(4)(A)), so a loss still suspended under the passive rules in the loss year is, in our reading, not yet a lookback loss. And a gain and a loss sold in the same year are netted on line 7 before the lookback applies, while the same two sales in different years are not. That is a timing fact, not advice: the tax in each year also depends on brackets and on the 25% and NIIT layers.
If you own through a fund: K-1 box 10 and Part I
A syndication or crowdfunding partnership that sells a property does the Part I and Part III work itself. The Form 4797 instructions say partnerships and S corporations report the net gain or loss on Schedule K (line 10 of Form 1065) and skip lines 8, 9, 11 and 12. The investor receives it on Schedule K-1, and the instructions tell the investor to enter amounts from Schedule K-1 (Form 1065), box 10, in Part I of Form 4797, where they are netted with the investor's own 1231 items and the lookback applies at the investor level. A loss still goes through Form 8582 first. For the other boxes see our K-1 boxes guide and our guide to real estate crowdfunding taxes. Shares in a REIT or a non-traded fund do not go through Form 4797; they go through Form 8949, covered in our Form 8949 guide.
What a reader can do with this
- Sort the sale into the right bucket before you open software. Rental held more than 1 year: land in Part I, building in Part III. Held for investment only, or 1 year or less: a different part or Form 8949.
- Write down the allocation. The settlement statement gives one price; the instructions require an allocation by fair market value between building, land and equipment, and the split drives the recapture.
- List your 1231 gains and losses for the last 5 years. Look at line 7 of each prior Form 4797. An old net loss that was never recaptured is a line 8 number.
- If you hold a loss property and a gain property, know that same-year sales net and different-year sales do not. Ask your preparer to model both years before the closing dates are fixed.
- Check the passive loss status first. A loss that is suspended or allowed changes both the loss year and the lookback.
FAQ
Update alert · free
An email when the form 4797 and section 1231 rental sales numbers change
When a rate, rule or filing behind this page changes: what changed, the one number that matters, and the source to check it yourself.
Sources, read and saved on October 22, 2026: Instructions for Form 4797 (2025) and Form 4797 (2025), Internal Revenue Service; IRS Publication 544 (2025), Sales and Other Dispositions of Assets, chapter 3; 26 U.S.C. 1231 as published by the Legal Information Institute at Cornell; Instructions for Schedule D (Form 1040) (2025), including the Unrecaptured Section 1250 Gain Worksheet; Instructions for Form 8582 (2025); Instructions for Form 8960 (2025). The 2026 editions of the forms had not been found when we checked. This is analysis of public documents, not investment, legal or tax advice.
Keep reading.
- 0124 min read
401(k) Rollover to an IRA in 2026: Direct, 60-Day, Withholding
401(k) to IRA rollover rules from the Code and IRS Pubs 590-A and 575: direct vs 60-day, 20% withholding, what cannot roll, and the once-a-year limit.
- 0221 min read
529 Superfunding 2026: $95,000, Form 709 and the Roth Rollover
A 529 can take $95,000 per child in 2026 ($190,000 for a couple) under the five-year election. Form 709 steps, death inside 5 years, the $35,000 Roth rollover.
- 0319 min read
AMT in 2026: Exemption Shrinks 50 Cents per Dollar From $500,000
The 2026 AMT exemption ($90,100 single, $140,200 joint) now phases out at 50% from $500,000 or $1,000,000 of AMT income. Worked cases and IRS 2022 data.