Lesson 4 of 10 intermediate

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

Selling property is like selling a bike you rebuilt over ten years. The tax office does not ask 'what did the bike cost new?' — it asks 'what have you put into it in total?' Every new wheel and frame you paid for raises your number. Every part you already claimed back on your taxes lowers it. Only the difference between that running total and the sale price is what you get taxed on.

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

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. 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. 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. 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. 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. 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. 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.'
Need a hint?
One phrase in the tax code kills the first sentence; one repealed rule from 1997 kills the second.
Show answer
Both halves fail. First, depreciation recapture applies to depreciation ALLOWED OR ALLOWABLE. If the property was a rental, the depreciation was allowable whether or not it was claimed — so basis is reduced and the recapture is owed regardless. Skipping the deduction did not avoid the tax, it just threw away the deduction. Second, the rollover rule that let sellers defer gain by buying a more expensive home was repealed by the Taxpayer Relief Act of 1997 and replaced with the Section 121 exclusion. Buying a bigger house today defers nothing. Also note that after four years as a rental, the 2-of-the-last-5-years use test for Section 121 may already have failed. This is exactly the scenario where a real estate CPA earns their fee — see the next lesson.

Explain like I'm 5

When you sell a house for more than it cost you, the government takes a share of the extra money. But before they work out 'the extra money', they let you add in the big improvements you paid for, like a new roof. If you were renting the house out and getting a tax break every year for wear and tear, they subtract those breaks back out — so the extra money looks bigger than you expected. If it was the home you actually lived in, a big chunk of that extra money may not be taxed at all.

Fun fact

The $250,000 and $500,000 main-home exclusion amounts were set by the Taxpayer Relief Act of 1997 and have never been indexed to inflation. They are the same dollar figures now as they were nearly three decades ago, which is why sellers in long-appreciating markets increasingly find their gain running past the exclusion.

Hands-on challenge

Open a blank note and build the adjusted basis of a property you own or plan to own. Line 1: purchase price. Then list every capital improvement with a year and a dollar amount you could actually prove with a receipt. Subtract any depreciation if it has ever been rented. That single note, kept updated, is worth real money on the day you sell — most people rebuild it from memory years later and lose deductions they genuinely earned.

More resources

Open interactive version (quiz + challenge) ← Back to course: Real Estate