Form 4797 — How to Report the Sale of a Rental Property
TL;DR: When you sell a rental property, Form 4797 reports the transaction and calculates depreciation recapture under Section 1250. You'll separate your adjusted basis (original cost plus improvements minus depreciation taken) from the sale price, allocate land and building consistently with your purchase, and attach Form 6252 if you structured an installment sale. Keep every capital improvement receipt from day one — they raise your basis and lower your taxable gain.
_Last reviewed: July 2026 · 6 min read_
Selling a rental property means filing Form 4797, not just Schedule D. The form exists because rental real estate gets special tax treatment — depreciation you claimed comes back as recapture income, and the IRS wants that separated from your other capital gains. Miss a step and you'll overpay or face questions years later when the agency compares your purchase records to your sale.
Okoniq Property Hub logs capital improvements and tracks your adjusted basis year by year, so you have the documentation ready when you sell.
What does Form 4797 report that Schedule D doesn't?
Form 4797 handles Section 1231 property — assets used in a trade or business, held longer than one year. Rental real estate qualifies. Schedule D is for investment property (stocks, bonds, non-business real estate), not rental property that generated depreciation deductions.
The form calculates three things: your realized gain or loss (sale price minus adjusted basis), any Section 1250 recapture (depreciation taken on the building portion), and whether the rest of the gain qualifies for long-term capital gains treatment. Section 1250 recapture is taxed separately — the IRS treats it as ordinary income up to a cap, currently unverified here but typically distinct from your standard capital gains rate. Confirm the current rate on IRS.gov or with your CPA.
You report the sale on Part III of Form 4797 if you held the property more than one year. If you flip rentals quickly (held one year or less), Part II applies, and the entire gain is ordinary income. Most landlords hold longer and use Part III. The form then flows to Schedule D, where any gain beyond recapture gets taxed at long-term rates. Depreciation recapture is covered in detail here.
If you structured the sale as an installment sale (buyer pays over multiple years), you also file Form 6252 and calculate how much of each payment is gain. The two forms work together — 4797 calculates the total gain, 6252 spreads it across the payment schedule. A common mistake is filing 4797 alone and recognizing the entire gain in year one when the contract says otherwise.
How does Section 1250 recapture work on real property?
Section 1250 recapture applies to depreciable real property — the building, not the land. Every dollar of depreciation you claimed (or were entitled to claim, whether you took it or not) gets recaptured. The recapture is the lesser of the depreciation taken or the gain realized. If you claimed depreciation over the years but sold at a loss, there's nothing to recapture.
Recapture happens first. If your gain is $100,000 and you took $60,000 in depreciation, the first $60,000 is recapture income. The remaining $40,000 is Section 1231 gain, which usually gets long-term capital gains treatment. The recapture portion is taxed at ordinary income rates, subject to a cap — verify the current cap with your CPA or on IRS.gov; it has been a distinct rate in past years.
Section 1250 is gentler than Section 1245, which applies to personal property (appliances, carpets, anything you segregated with cost segregation). Under 1245, recapture can exceed your depreciation if accelerated methods were used. Real property uses straight-line depreciation, so recapture stops at the amount you deducted. If you cost-segregated your property and accelerated some assets, those components hit 1245 recapture on a separate line of Form 4797 — another reason to keep the cost-seg study.
The IRS treats land as non-depreciable. Your land allocation from the purchase carries through to the sale. If you allocated 20% to land at purchase, allocate 20% to land at sale. The land portion of your gain is Section 1231 gain with no recapture, because you never depreciated it.
Why must you separate land from building on the gain calculation?
You allocated at purchase — you must allocate consistently at sale. If your original purchase price was $400,000 and you assigned $80,000 to land and $320,000 to building (based on the county assessor's ratio or an appraisal), those percentages follow you. When you sell for $600,000, apply the same ratio: $120,000 to land, $480,000 to building.
The building's adjusted basis is original cost minus accumulated depreciation plus capital improvements to the building. If you depreciated the building down by $60,000 and added a $30,000 roof, the building's adjusted basis is $320,000 − $60,000 + $30,000 = $290,000. Sale price allocated to building is $480,000, so your building gain is $190,000. The first $60,000 is recapture; the rest is Section 1231 gain.
Land's adjusted basis is simply original cost plus any land improvements (grading, utilities, parking lot). You don't depreciate land, so no recapture. If your land basis stayed $80,000 and you're allocating $120,000 of the sale price to land, you have a $40,000 Section 1231 gain on the land portion. No recapture, just long-term capital gains when it flows to Schedule D.
Inconsistent allocation invites an audit. The IRS compares your original depreciation schedule (which split land and building) to your Form 4797. If the percentages don't match, you'll get a letter asking why. Use the same method you used at purchase — assessor ratio, appraisal, or county land value. Document it in your files. Cost basis is covered in more depth for inherited property, but the allocation principle is identical for purchased property.
What cost basis documentation should you keep from day one?
Your adjusted basis is purchase price plus capital improvements minus depreciation taken. Every capital improvement — new roof, HVAC replacement, kitchen remodel, addition — raises your basis and lowers your taxable gain. If you can't prove the improvement, the IRS won't credit it.
Keep receipts, invoices, permits, and contractor agreements for every improvement. "Improvement" means it extends the life, adapts the property to a new use, or substantially increases value. A repair (fixing a leak, patching drywall) doesn't count; a replacement (new roof, new HVAC system) does. The line is gray; HVAC capitalization is explained here. When in doubt, save the receipt and let your CPA decide at sale time.
Closing statements from the purchase are critical. They show your original basis, including settlement fees and transfer taxes that get added to basis. Your HUD-1 or closing disclosure itemizes what you paid — keep it forever. If you refinanced, save those statements too; some costs (points paid on a refinance) affect your interest deduction but don't adjust basis. Others (title insurance on a cash-out refi used to improve the property) might — ask your CPA.
Depreciation schedules from every year you owned the property form the subtraction side of basis. If you depreciated $4,000/year for 15 years, that's $60,000 off your basis. The IRS has those returns; you should too. Okoniq logs improvements and tracks basis changes, so you're not reconstructing 15 years of improvements from memory when you list the property. Tracking rental expenses from day one is covered in another post.
If you inherited the property, your basis is the fair market value on the date of death, not what the decedent paid. Stepped-up basis is explained here. You still need the estate documents (appraisal, probate records) to prove that basis. No receipts needed for improvements made before you inherited, but keep everything after.
What happens if you structured an installment sale?
An installment sale spreads your gain across multiple years as you receive payments. You report the total gain on Form 4797 in the year of sale, then use Form 6252 to calculate how much of each payment is taxable. The two forms attach to the same return; 4797 calculates the gain, 6252 defers recognition.
Form 6252 applies the gross profit percentage — your gain divided by the contract price — to each payment. If your gain is $200,000 and the buyer is paying $500,000 over five years, your gross profit percentage is 40%. When the buyer pays you $100,000 in year two, $40,000 is recognized gain that year. Recapture is recognized entirely in the year of sale under Section 1250, even if payments stretch out. The rest of the gain defers.
Installment sales work when the buyer can't get full financing and you're willing to carry a note. The tax benefit is deferral — you recognize gain as you receive cash, not all at once. The downside: you're the lender, so if the buyer defaults, you foreclose and deal with a property you already sold. Structure the terms carefully and record the note with the county.
If you later sell the installment note (assign it to a third party for a lump sum), you recognize the remaining deferred gain immediately in the year you sell the note. It's treated as a disposition of the installment obligation. The buyer's payments to you stop; the third party collects going forward. This is rare but happens when a landlord needs liquidity before the note matures.
A 1031 exchange is the other common structure to defer gain, but it's not an installment sale — you're exchanging into like-kind property, not taking payments. The two strategies are mutually exclusive for a given transaction. You either 1031 and defer indefinitely, or you take payments and use 6252 to spread the gain. Talk to your CPA before choosing.
FAQ
Do I file Form 4797 if I sold my primary residence that I used to rent out?
If you converted a rental back to your primary residence and meet the Section 121 exclusion requirements (lived in it two of the last five years), you report the sale on Schedule D and take the exclusion for the years it was your home. The years it was a rental still generate depreciation recapture, which goes on Form 4797. You'll file both forms — 4797 for the recapture portion, Schedule D for the rest. Section 121 exclusion rules are covered here.
What if I took less depreciation than I was entitled to take?
The IRS recaptures the depreciation you should have taken, not what you actually claimed. If you forgot to depreciate for three years, you still reduce your basis by the allowed amount and pay recapture on it at sale. This is why some landlords file amended returns to claim missed depreciation before selling — better to get the deduction in past years than pay recapture on phantom depreciation and never benefit. Talk to a CPA about whether amending makes sense.
Can I avoid recapture by rolling into a 1031 exchange?
Yes. A 1031 exchange defers both the capital gain and the recapture by rolling your basis into the replacement property. When you eventually sell the replacement property without exchanging, recapture applies to the accumulated depreciation from both properties. The recapture isn't forgiven, just postponed. If you die holding the 1031 property, your heirs get a stepped-up basis and the recapture disappears.
Do closing costs from the sale reduce my gain?
Yes. Selling expenses — broker commissions, title fees, attorney fees, transfer taxes — are subtracted from the sale price to arrive at your amount realized. If you sold for $600,000 and paid $36,000 in commissions and fees, your amount realized is $564,000. Those costs don't adjust basis; they reduce the top line of the gain calculation. Keep your closing statement from the sale; it itemizes every deductible cost.
What if I sold at a loss — do I still file Form 4797?
Yes. Losses on rental property are deductible, subject to passive activity loss rules. You report the loss on Form 4797 Part III, and it flows to Schedule D and then Form 8582 if you have passive loss limitations. Passive loss rules and carryforwards are covered in other posts. Even a loss requires full basis documentation — the IRS will check that you're not inflating the loss by overstating basis.
<div class="glass rounded-2xl p-5 mt-7 max-w-4xl border border-red-400/30 bg-red-500/5"> <div class="flex items-start gap-3"> <span class="text-2xl flex-shrink-0">⚠️</span> <div class="flex-1 min-w-0"> <p class="text-red-200 text-sm font-bold">Not tax advice</p> <p class="text-slate-300 text-xs mt-1 leading-relaxed"> This post assumes you held the property as a rental, sold to an unrelated party, and took straight-line depreciation. It does not account for like-kind exchanges, related-party sales, foreclosures, state-specific recapture rules, or legislative changes after July 2026. Tax rules change and depend on your specific situation. Talk to a licensed CPA before acting on anything here, and confirm current figures on IRS.gov. </p> </div> </div> </div>
A snapshot, not a living document
This article reflects the rules as we understood them on the review date shown above. We do not revise posts after publishing them. Tax law changes every year — thresholds, percentages, and deadlines here may since have been superseded, even though this page still comes up in search. Check the current figure on IRS.gov.
Keep reading
Get tax-season tips by email
Deduction checklists and filing-deadline guides for homeowners and landlords. No schedule, no spam — unsubscribe anytime.
Prefer to dive in? Get started free →