Capital Gains Tax on Selling a Rental Property

Every layer of tax on a rental sale — and how to plan around them.

Illustration for Capital Gains Tax on Selling a Rental Property

The two-part federal calculation

When you sell a rental at a gain, the taxable gain splits into two components. (1) Depreciation recapture: the portion of your gain equal to depreciation claimed is Section 1250 gain, taxed at up to 25% federally. (2) Long-term capital gain: any remaining gain above the recapture amount is taxed at 0%, 15%, or 20% based on your taxable income. If you held the property one year or less, the entire gain is taxed at your ordinary income rate with no preferential treatment.

Additional layers: NIIT and state tax

High-income sellers may also owe the 3.8% Net Investment Income Tax on the gain (see our NIIT guide for thresholds and details). State income taxes add another layer in most states, often without a 25% federal cap equivalent on the recapture portion. In high-tax states with elevated income, the total effective rate on a rental sale gain — federal recapture plus federal capital gains plus NIIT plus state — can exceed 35%.

Strategies to reduce or defer the tax

1031 exchange: defer all gain into replacement property. Installment sale: spread the capital gain component across multiple years; recapture must be recognized in year one under Section 453(i). Capital loss harvesting: use losses from other investments to offset gains in the same year. Sell in a low-income year: retire first, sell second to hit the 0% or 15% capital gains bracket. Hold until death: heirs receive a step-up in basis, eliminating deferred recapture permanently.

Start with the right adjusted basis

Every dollar of tax on a rental sale flows from two numbers: your amount realized and your adjusted basis. Adjusted basis starts with your original purchase price, plus capitalized acquisition costs (title fees, transfer taxes, legal fees, and settlement charges you did not deduct), plus the cost of capital improvements you made over the years (a new roof, an addition, a full kitchen remodel — not routine repairs), minus the total depreciation you claimed or were allowed to claim. Getting basis right is where taxpayers most often over- or under-pay. Landlords frequently forget to add years of improvements — which lowers the gain — and forget that the IRS reduces basis by depreciation whether or not you actually deducted it ('allowed or allowable'). Reconstruct the full basis history before you estimate the tax.

A full worked example, layer by layer

Assume you bought a rental for $300,000 (allocating $240,000 to the building), spent $40,000 on a capital improvement, and claimed $95,000 of depreciation over the hold. You sell for $560,000 and pay $34,000 in commissions and closing costs. Amount realized = $560,000 - $34,000 = $526,000. Adjusted basis = $300,000 + $40,000 - $95,000 = $245,000. Total gain = $281,000. Now split it: the first $95,000 is unrecaptured Section 1250 gain, taxed at up to 25% = about $23,750; the remaining $186,000 is long-term capital gain, taxed at 15% for a mid-income seller = $27,900. Federal income tax so far: roughly $51,650. Add the 3.8% NIIT on the gain if you are over the MAGI threshold (about $10,678) and, say, a 5% state tax ($14,050), and the all-in bill approaches $76,000 — an effective rate near 27% on the $281,000 gain. The selling costs and the forgotten $40,000 improvement together saved roughly $18,000 versus ignoring them.

How selling costs and improvements shrink the gain

Two categories of spending directly reduce your taxable gain, and both are easy to overlook. Selling costs — real estate commissions, transfer taxes, title and escrow fees, attorney fees, and advertising — reduce your amount realized, so a 6% commission on a $560,000 sale trims the gain by about $33,600. Capital improvements add to basis and reduce the gain dollar for dollar, but only if they are true improvements that add value, prolong the property's life, or adapt it to a new use — not repairs and maintenance you already deducted. A common mistake is deducting an improvement as a repair in the year you paid for it and adding it to basis at sale; you cannot double-count. Keep an improvements ledger with receipts for the full ownership period; at a 20-30% effective rate, every $10,000 of documented improvement is worth $2,000-$3,000 at sale.

Reporting the sale: Form 4797 and Schedule D

A rental is Section 1231 business property, so the sale is reported on Form 4797, not directly on Schedule D. The depreciation-recapture computation happens in Part III of Form 4797, which separates the unrecaptured Section 1250 gain. Net Section 1231 gain then flows to Schedule D, where it is treated as long-term capital gain. The 25% rate on the unrecaptured 1250 portion is applied through the Unrecaptured Section 1250 Gain Worksheet and the Schedule D Tax Worksheet — the software does this automatically, but understanding the flow helps you sanity-check the result. If you sold on the installment method, the sale also runs through Form 6252. NIIT, if it applies, is computed on Form 8960. Give your preparer the closing statement, the depreciation schedules for every year, and the improvement records.

Timing the sale to control the rate

Because the long-term capital gains brackets (0/15/20%) ride on top of your other taxable income, when you sell can change the rate on the capital-gain slice. A large gain can push part of itself from 15% into 20% and can trigger or worsen NIIT and the phase-out of other tax benefits. Two levers help: sell in a year your other income is low (an early-retirement year, a sabbatical, a business-loss year) to keep more of the gain in the 15% — or even 0% — bracket; and consider an installment sale to spread the capital-gain component across several years so less of it stacks into the top bracket in any one year. Remember the recapture slice does not benefit from spreading — Section 453(i) forces all depreciation recapture into the year of sale regardless of when you collect the cash.

Common mistakes that inflate the bill

The recurring errors on rental sales all cost real money. Forgetting improvements overstates the gain. Assuming you skip recapture because you never deducted depreciation is wrong — the IRS reduces basis for 'allowed or allowable' depreciation either way, so failing to depreciate just wastes deductions without avoiding recapture (Form 3115 can recover missed depreciation). Treating the whole gain as 15% capital gain ignores the 25% recapture layer and understates the tax. Overlooking NIIT and state tax can leave a five-figure surprise. And missing 1031 deadlines — 45 days to identify, 180 days to close, with a qualified intermediary engaged before closing — converts an intended deferral into a fully taxable sale. Run the full, layered calculation before you list, not after you close.

Plan for the year-of-sale cash-flow and estimated-tax shock

A large rental sale can create a tax bill that dwarfs anything you have paid before, and the IRS wants much of it during the year — not just at filing. Because withholding from a W-2 job rarely covers a six-figure gain, you may owe an estimated tax payment for the quarter in which the sale closes, and falling short can trigger an underpayment penalty. The safe-harbor rules generally protect you from that penalty if your total withholding and estimates equal at least 90% of this year's tax or 100% of last year's (110% if your prior-year AGI exceeded $150,000) — so a common move is to pay in the smaller safe-harbor amount by the quarterly deadline and settle the rest at filing. Also remember many states require their own estimated payment, and some states impose withholding at closing on real estate sales (especially by nonresidents), which you later reconcile on the state return. Set the cash aside the day you close; do not spend the gross proceeds and scramble in April.

Mixed-use and partial-year rental complications

Not every property is a clean, full-time rental for its entire hold, and mixed use changes the math. If you used part of the property personally (a duplex where you lived in one unit, or a home you rented for only some years), you generally must allocate basis, depreciation, and gain between the personal and rental portions — only the rental share carries depreciation recapture, and only the personal share can qualify for the Section 121 exclusion. A property converted from a primary residence to a rental (or vice versa) triggers the nonqualified-use allocation rules and requires tracking the correct basis at conversion (the lower of cost or fair market value at the date of conversion, for depreciation). Vacation homes with significant personal use follow yet another set of loss-limitation rules while owned. If your property was anything other than a straightforward full-time rental, map out the personal-versus-rental split before estimating the tax — the allocation can swing the result by tens of thousands of dollars.

Frequently asked questions

What taxes do I pay when selling a rental property?

Depreciation recapture (up to 25%), long-term capital gains (0/15/20%), possibly the 3.8% NIIT, and state income or capital gains tax. The exact amount depends on your income and hold period.

Can I avoid capital gains tax on a rental?

You can defer with a 1031 exchange, reduce with loss harvesting, or eliminate via step-up in basis at death. Outright avoidance on a profitable long-hold sale is generally not possible.

How do I calculate my adjusted basis for the sale?

Start with the purchase price, add capitalized acquisition costs and the cost of capital improvements, then subtract all depreciation claimed or allowable. That adjusted basis, compared to your amount realized (sale price minus selling costs), determines the gain.

What form do I use to report the sale of a rental?

Form 4797 for the sale of business property; the depreciation recapture is computed in Part III, and the net gain flows to Schedule D. Installment sales also use Form 6252, and NIIT is computed on Form 8960.

Do selling costs reduce my capital gains tax?

Yes. Commissions, transfer taxes, title and escrow fees, and legal costs reduce your amount realized, which lowers the taxable gain dollar for dollar.

Sources

Educational information and estimates only. Not tax advice. Tax rules change and vary by situation; consult a qualified tax professional before acting.

Related