Capital Gains Tax on Real Estate: The Number You Owe When You Sell
Gain is not profit on the price — it is sale proceeds minus your ADJUSTED BASIS, and that word is where the money is
Open interactive version (quiz + challenge)Real-world analogy
What is it?
Capital gains tax on real estate is the tax on the GAIN from a sale: the amount realized (sale price minus selling costs) minus your adjusted basis (what you paid, plus capital improvements, minus depreciation you were allowed to take). Held more than one year, the gain is long-term and taxed at 0%, 15% or 20% depending on your taxable income, per IRS Topic No. 409. Held one year or less, it is short-term and taxed as ordinary income. This lesson is educational only — the IRS publications linked below are the authority, not this page.
Real-world relevance
Three very different situations use the same word 'gain'. Selling your MAIN HOME: IRS Topic No. 701 states that "if you have a capital gain from the sale of your main home, you may qualify to exclude up to $250,000 of that gain from your income, or up to $500,000 of that gain if you file a joint return with your spouse" — provided you owned it and lived in it as your main home for at least 2 of the last 5 years. Selling a RENTAL: no exclusion, plus the depreciation you took (or were allowed to take) comes back as unrecaptured Section 1250 gain, taxed at up to 25%. Selling INVESTMENT property and buying another: a Section 1031 like-kind exchange can defer the gain if you meet the deadlines.
Key points
- Basis is your running total, not your purchase price — Start with what you paid. ADD capital improvements — a new roof, an addition, a replaced HVAC system. SUBTRACT depreciation taken on a rental. Repairs and paint do not add to basis. Ten years of unfiled receipts is ten years of tax you may pay for no reason.
- One year and a day is the line that changes the rate — More than one year of holding gets long-term rates of 0%, 15% or 20% by income band. One year or less is short-term, taxed at your ordinary rate, which is why flippers often pay the highest rate in real estate.
- The main-home exclusion is $250,000 single / $500,000 married filing jointly — You generally must have owned AND used the home as your main home for at least 2 of the 5 years before the sale, and generally not have used the exclusion on another home in the prior 2 years. These dollar amounts are set by statute and are not indexed to inflation — they have been the same figures since 1997.
- Depreciation recapture surprises rental sellers — Depreciation you claimed while renting reduced your basis, so it increases your gain on sale. That portion — unrecaptured Section 1250 gain — is taxed at a rate of up to 25%, higher than the 15% many sellers expect. And the recapture applies to depreciation ALLOWED OR ALLOWABLE, so not claiming it does not save you.
- ⚠️ Common misconception: 'I can roll my home sale profit into a new house and pay nothing' — That rollover rule was repealed in 1997 and replaced by the Section 121 exclusion. Buying a more expensive house does not defer anything today. Section 1031 exchanges still exist, but since the Tax Cuts and Jobs Act they apply only to real property held for business or investment — never to your personal residence.
- A 3.8% surtax can sit on top — The Net Investment Income Tax under IRC Section 1411 adds 3.8% on net investment income when modified adjusted gross income exceeds $200,000 (single) or $250,000 (married filing jointly). Those thresholds are not indexed to inflation, so more sellers cross them every year.
Code example
SELLING A RENTAL: THE FOUR-LAYER TAX BILL
==========================================
(Illustrative federal-only sketch. Confirm every
rate in the IRS publications for YOUR year.)
STEP 1 - AMOUNT REALIZED
Sale price ................... $520,000
Selling costs (commission,
title, transfer tax) ....... -$ 34,000
Amount realized .............. $486,000
STEP 2 - ADJUSTED BASIS
Original purchase price ...... $300,000
+ New roof + HVAC (capital) .. $ 40,000
- Depreciation taken
(10 yrs on a rental) ....... -$ 85,000
Adjusted basis ............... $255,000
STEP 3 - TOTAL GAIN
$486,000 - $255,000 .......... $231,000
STEP 4 - SPLIT THE GAIN BY TYPE
a) Unrecaptured Sec.1250
(= depreciation taken) .... $ 85,000
taxed at up to 25% ........ $ 21,250
b) Remaining long-term gain .. $146,000
at a 15% bracket .......... $ 21,900
ESTIMATED FEDERAL TAX ........ $ 43,150
(+ state tax, + 3.8% NIIT if
your MAGI crosses the
$200k / $250k threshold)
NOTE: the same property as a MAIN HOME
owned and lived in 2 of the last 5 years
could exclude up to $250k/$500k of gain
instead — a completely different answer.Line-by-line walkthrough
- 1. STEP 1: Start with the amount realized, not the sticker price. Commission, title fees and transfer tax come off first, taking $520,000 down to $486,000.
- 2. STEP 2: Build the adjusted basis. The $300,000 purchase price goes up by $40,000 of genuine capital improvements — and DOWN by the $85,000 of depreciation claimed over ten years of renting.
- 3. That depreciation subtraction is the step people forget. It is why an adjusted basis of $255,000 is lower than what was actually invested in the property.
- 4. STEP 3: Gain is $486,000 minus $255,000 = $231,000. Note this is far larger than 'sale price minus purchase price' feels like it should be.
- 5. STEP 4: The gain splits into two buckets with two rates. The $85,000 that came from depreciation is unrecaptured Section 1250 gain, taxed at up to 25%. The remaining $146,000 gets the long-term rate for your income band.
- 6. OUTCOME: roughly $43,150 of federal tax before state tax and before the 3.8% net investment income tax. Change one fact — the property being your main home for 2 of the last 5 years — and the Section 121 exclusion could remove up to $250,000 or $500,000 of that gain. Same building, same price, opposite outcome.
Spot the bug
Seller's plan: 'I rented my old house out for the last four years. I have never claimed depreciation on it, so there is nothing to recapture. And I will just buy a bigger house with the money, so the gain rolls over anyway.'