The short answer

When you sell a rental property you have held for more than a year, your gain is the sale price minus selling expenses and your adjusted basis. Because depreciation lowers your basis, it increases your gain. The part of a long-term gain that comes from depreciation is unrecaptured section 1250 gain, taxed at your regular rate but no more than 25%. The rest is generally taxed at the 0%, 15%, or 20% capital gain rates. You report the sale on Form 4797.

Step 1: adjusted basis

Your basis generally starts with what you paid for the property, plus certain purchase costs and the cost of improvements. It is then reduced, most importantly by depreciation.

  • Land is not depreciated. Only the building and improvements are.
  • Allowed or allowable: you reduce basis by the depreciation you deducted or could have deducted under your method. If you took no depreciation, Publication 551 says to reduce basis by the full amount you could have taken.

Step 2: amount realized and gain

On Form 4797, the gross sales price includes money and any mortgage the buyer assumes, and your selling expenses (such as commissions) are added to your basis. Your gain is the sales price minus that total, after subtracting depreciation from basis.

Step 3: section 1231

Real property used as rental property is not a capital asset; when held more than one year it is section 1231 property. You combine all of your section 1231 gains and losses for the year:

  • A net section 1231 loss is an ordinary loss.
  • A net section 1231 gain is ordinary income up to your nonrecaptured section 1231 losses from the 5 preceding years. The rest is long-term capital gain.

Step 4: recapture vs. unrecaptured section 1250 gain

Section 1250 ordinary recaptureUnrecaptured section 1250 gain
What it isAdditional depreciation: depreciation above the straight-line amountThe rest of the long-term gain that comes from depreciation
How it is taxedAs ordinary incomeAs capital gain, at your regular rate but no more than 25%
Typical U.S. residential rental (27.5-year MACRS, straight-line)Does not apply, per the Form 4797 instructionsGenerally equals the depreciation, limited to your net section 1231 gain
Where it is figuredForm 4797, line 26Unrecaptured Section 1250 Gain Worksheet, Schedule D line 19

Section 1250 ordinary recapture can apply if accelerated depreciation, a special depreciation allowance, or the commercial revitalization deduction was claimed, or if the property was held one year or less.

Example (illustrative, 2025)

Lee bought a rental house in 2016 for $300,000 ($60,000 for the land and $240,000 for the building) and depreciated the building over 27.5 years on a straight-line basis, with no special depreciation allowance. Through the sale, the depreciation allowed or allowable totals $80,000. In 2025 Lee sells the house for $520,000 and pays $30,000 in selling expenses.

Assumptions: based on fair market values at the sale, $104,000 of the price is allocated to the land and $416,000 to the building, and the selling expenses are split the same way ($6,000 and $24,000). Lee has no other section 1231 transactions, no nonrecaptured section 1231 losses from the 5 preceding years, and no collectibles losses or capital loss carryovers.

StepAmount
Whole property: $520,000 price − ($300,000 cost + $30,000 selling expenses − $80,000 depreciation)$270,000 total gain
Building, Form 4797 Part III line 20 — gross sales price$416,000
Building, line 21 — cost ($240,000) plus expense of sale ($24,000)$264,000
Building, line 22 — depreciation allowed or allowable$80,000
Building, line 23 — adjusted basis ($264,000 − $80,000)$184,000
Building, line 24 — gain ($416,000 − $184,000)$232,000
Building, line 26 — section 1250 ordinary recapture (27.5-year residential rental)$0
Land, Form 4797 Part I — $104,000 − ($60,000 + $6,000)$38,000
Net section 1231 gain ($232,000 + $38,000), carried to Schedule D as long-term capital gain$270,000
Unrecaptured section 1250 gain (smaller of line 22, $80,000, or line 24, $232,000)$80,000
Remaining long-term gain at the 0%, 15%, or 20% rates$190,000

The $80,000 is not taxed at a flat 25%: it is taxed at Lee's regular rates, capped at 25%. If Lee had nonrecaptured section 1231 losses from the 5 preceding years, part of the $270,000 would instead be ordinary income. If accelerated depreciation or a special depreciation allowance had been claimed, line 26 could show ordinary recapture.

Step 5: forms

  • Form 4797: for a rental held more than one year, allocate the amount realized between the building and the land based on their fair market values. Report the building in Part III, with the gain carried to Part I, and the land in Part I. Property held one year or less goes in Part II.
  • Schedule D: a net section 1231 gain from Form 4797 is reported as long-term capital gain. Complete the Unrecaptured Section 1250 Gain Worksheet and enter the result on Schedule D, line 19.
  • Form 1099-S: the closing agent may report the sale to you and the IRS.

The net investment income tax

Gain from selling rental property is generally net investment income unless the property was held in a trade or business that is not a passive activity for you. Even then, the 3.8% tax applies only if your modified adjusted gross income exceeds your threshold ($200,000 single or head of household; $250,000 married filing jointly or qualifying surviving spouse; $125,000 married filing separately). See the NIIT guide.

Common mistakes

  • Forgetting to subtract depreciation from basis, or subtracting only what was claimed when more was allowable.
  • Treating 25% as a flat rate on the whole gain.
  • Calling unrecaptured section 1250 gain "recapture" and taxing it as ordinary income.
  • Reporting the sale on Form 8949 instead of Form 4797.
  • Depreciating the land.
⚠️ Have the sale reviewed

Installment sales, like-kind exchanges, suspended passive losses, a property that was once your main home, depreciation that was never claimed, and property abroad all change the calculation and are not covered here. State tax treatment is also not covered.