Free tool · runs in your browser
Capital gains calculator: rental property sale
Enter your purchase basis, sale price, depreciation taken and tax rates to see federal recapture tax, long-term capital gains tax, NIIT and your true net proceeds.
Inputs
Results
How the capital gains math works
- Amount realized = sale price − selling costs (commission, transfer taxes, title and closing fees).
- Adjusted cost basis = purchase price + capital improvements + purchase closing costs − accumulated depreciation. Land value sits in your basis but never depreciates, so it is excluded from the depreciation calculation.
- Depreciation is straight-line over 27.5 years for residential rental property (building portion plus closing costs and improvements), accumulated over the years held (capped at a full 27.5-year life).
- Depreciation recapture (unrecaptured §1250 gain): the part of the gain equal to the depreciation you took is taxed at a maximum federal rate of 25% — regardless of your regular capital gains bracket.
- Long-term capital gain = total gain − recapture, taxed at your LTCG rate (0%, 15% or 20% federal).
- NIIT (net investment income tax): an extra 3.8% on the whole gain for high-income filers — single filers with MAGI above $200,000 and joint filers above $250,000 (2025 thresholds, not indexed for inflation).
- State tax: a flat rate applied to the total gain. Most states tax capital gains as ordinary income with no 0/15/20 break; a few states have no income tax at all.
Worked example
You sell the rental above for $350,000. Selling costs at 6% take $21,000, leaving $329,000 realized. You bought for $200,000 with $40,000 of land value and $4,000 of purchase closing costs, so the depreciable basis is $164,000. Straight-line over 27.5 years that is $5,963.64 per year; held 5 years, accumulated depreciation is $29,818.20.
Adjusted basis = $200,000 + $4,000 − $29,818.20 = $174,181.80. Total gain = $329,000 − $174,181.80 = $154,818.20.
Of that, $29,818.20 is unrecaptured §1250 gain taxed at 25% = $7,454.55, and $125,000 is long-term capital gain taxed at 15% = $18,750. Total tax: $26,204.55 — an effective 16.9% of the gain. With no mortgage to pay off, net cash at close: $302,795.45.
Frequently asked questions
What is depreciation recapture and why is it taxed at 25%?
Every year you depreciate a rental, your cost basis drops by that deduction — so the eventual capital gain gets bigger without any cash changing hands. To claw some of that back, the IRS taxes the portion of your gain matched to straight-line building depreciation ("unrecaptured §1250 gain") at a maximum 25% federal rate. It applies whether or not you actually claimed the depreciation on your returns, which is why accurate records of your depreciation schedule matter on sale.
Do I owe the 3.8% NIIT on my property sale?
The net investment income tax applies the 3.8% rate to investment gains when your modified adjusted gross income exceeds $200,000 (single or head of household) or $250,000 (married filing jointly) — thresholds that are not indexed for inflation. It stacks on top of federal LTCG tax and recapture. If your income is below the threshold the tax is zero; if you only breach it by $10,000, the tax applies to the lower of that breach and your net investment income.
How does my state tax a rental property sale?
Most states simply add capital gains to your ordinary income — so a sale can push you into a high bracket (California goes up to 13.3%). A few states (Texas, Florida, Nevada, Washington, and others for wage income) levy no broad income tax on investment gains, though Washington now taxes very large gains. Enter your marginal state rate on the gain; the calculator applies it flat to the total gain.
Can I sell a rental without paying capital gains tax now?
Yes — a 1031 exchange defers the entire gain, including depreciation recapture and state tax, if you reinvest in a like-kind investment property through a qualified intermediary within 45/180-day deadlines. You can also defer the taxable event by doing a cash-out refinance instead of selling, or defer forever by holding until death, when heirs get a step-up in basis. See the 1031 Exchange Calculator to model the deferral.
Formulas last reviewed . Results are estimates for educational use; not financial advice. Methodology →