Home Sale Capital Gains Tax Calculator

Most people who sell their main home owe nothing, because the first $250,000 of gain — $500,000 for a married couple — is excluded from tax entirely.

The two things that change the answer are whether you meet the ownership and residence tests, and how much of the gain is left over after the exclusion.

Your expected filing status for the year of the sale.

$

Wages, interest and other ordinary income, before the standard deduction. This fills the lower tax brackets first, which is what pushes your gain into a higher rate.

$

What you paid for the home.

$

Capital improvements — a new roof, an addition, a remodel. Repairs and maintenance do not count, but improvements add to your cost basis and shrink the gain.

$

What you sold it for, before selling costs.

$

Agent commission and closing costs. These reduce your gain just like improvements do.

yrs

Ownership period. Section 121 requires at least two years of ownership.

Both tests — ownership and residence — must be met to claim the full exclusion. Move out too soon and the whole gain can become taxable.

Results

Total gain on the sale Sale price less selling costs, less purchase price and improvements.
$286,000.00
Section 121 exclusion The amount shielded from tax, if you qualify.
$250,000.00
Taxable gain
$36,000.00
Federal tax on the sale
$5,400.00
Net investment income tax (3.8%)
$0.00
Total federal tax
$5,400.00
You keep from the gain
$280,600.00
Effective rate on the gain
1.89%

Calculated in your browser. Nothing is uploaded.

Why most home sales owe nothing

The short answer for most people is that they owe no tax at all. The first $250,000 of gain on a main home is excluded from tax, and $500,000 for a married couple filing jointly — and because the exclusion applies to gain rather than sale price, it covers more than most people expect.

On the default figures here — bought at $300,000, $25,000 of improvements, sold at $650,000 with $39,000 of selling costs — the gain is $286,000. The exclusion wipes out $250,000 of it, leaving $36,000 taxable. The federal bill is $5,400, which is an effective rate of 1.89% on a gain of nearly three hundred thousand dollars.

That is the typical case. The exclusion is large enough that it absorbs the entire gain on most main-home sales, which is why so many people sell a house for a large profit and never think about capital gains tax at all.

The two-year cliff

The exclusion is not automatic. You must pass two separate tests: you must have owned the home for at least two years, and you must have lived in it as your main home for at least two of the last five years. Failing either one removes the exclusion entirely.

The effect is not gradual — it is a cliff:

  • Owned 8 years, lived there — $250,000 excluded, tax $5,400.
  • Owned 8 years but did not live there for two of the last five — nothing excluded, tax $49,018.
  • Lived there but owned for only one year — nothing excluded, tax $49,018.

The same sale, the same gain, and a difference of $43,618 depending on two years of occupancy. There is no partial credit for being close — at 23 months you get nothing, at 24 months you get the full exclusion.

This catches people who convert a home to a rental and then sell, and anyone who has to relocate for work sooner than planned. It is the single most expensive mistake available in this area, and worth checking well before you list.

Filing status doubles the exemption

A married couple filing jointly excludes $500,000 rather than $250,000. Because the exclusion applies to the gain, that difference matters most exactly where gains are largest.

Here is the same home sold at various prices, single filer against joint filers:

  • Sold at $600,000 — no tax either way.
  • Sold at $650,000 — $5,400 single, nothing joint.
  • Sold at $700,000 — $12,900 single, nothing joint.
  • Sold at $800,000 — $30,218 single, nothing joint.

Joint filers owe nothing at every price on this list, because their $500,000 exclusion still covers the whole gain. Married filing separately does not get the doubled amount — it drops back to $250,000, and the narrower capital gains bands make the tax on any excess slightly worse than for a single filer.

Improvements are worth 15% back

Capital improvements add to your cost basis, which reduces the gain. Repairs and routine maintenance do not — a new roof is an improvement, repointing a few loose slates is a repair. Once your gain exceeds the exclusion, every dollar of documented improvements saves you the rate on that excess, which is usually 15%.

At a $700,000 sale price, single filer, with no improvements the gain is $361,000 and the tax is $16,650. Add improvements:

  • $25,000 of improvements — tax falls to $12,900, saving $3,750.
  • $50,000 — tax falls to $9,150, saving $7,500.
  • $100,000 — tax falls to $1,650, saving $15,000.

Every dollar saved is exactly 15 cents, because that is the rate applying to the excess. The practical lesson is unglamorous but valuable: keep receipts. A documented improvement is a 15% return at the point of sale, and an undocumented one is worth nothing.

Selling costs work the same way — commission and closing costs reduce the gain before the exclusion is applied.

What the exclusion does not cover

The exclusion is broad but not universal, and the gaps are where surprise bills come from.

  • Depreciation recapture. If you claimed depreciation — on a home office or a period as a rental — that portion is taxed at up to 25% and is not covered by the exclusion.
  • Periods of non-qualified use. Time the home was not your main residence can allocate part of the gain to taxable, even if you meet the two-year test overall.
  • Gains above the exclusion, which are taxed at long-term capital gains rates and may also attract the 3.8% net investment income tax.
  • Investment property and second homes, which get no exclusion at all — though they may qualify for a like-kind exchange.

There are also partial exclusions if you sell early because of a change in workplace, health, or an unforeseeable event. Those are calculated proportionally and are not modelled here — if one applies to you, the real figure is better than what this shows.

What this calculator leaves out

This is a federal estimate and deliberately simplified. The items below are the ones most likely to change the answer.

  • State and local tax, which can add a substantial amount and in some states is withheld at closing.
  • Partial exclusions for work, health or unforeseen moves.
  • Depreciation recapture and any allocation for periods of non-qualified use.
  • The requirement that you have not used the exclusion on another home sale in the last two years.
  • Selling costs beyond what you enter, and any buyer concessions or repair credits.
  • Your basis in the home if you received it as a gift or inherited it, which follows separate rules.

How this calculator works

The gain is the sale price less selling costs, less your purchase price and capital improvements. If you meet both the ownership and residence tests, the first $250,000 ($500,000 for joint filers) is excluded. What remains is taxed at long-term capital gains rates, stacking on top of your other taxable income.

Gain = Sale price − Selling costs − (Purchase price + Improvements) | Taxable gain = Gain − Exclusion

Variables

SymbolMeaningUnit
BasisPurchase price plus capital improvementsUSD
ExclusionSection 121 exclusionUSD ($250,000 / $500,000)
Taxable gainGain remaining after the exclusionUSD

Assumptions this calculation makes

  • Uses 2026 federal figures (IRS Rev. Proc. 2025-32).
  • Partial exclusions for moves caused by work, health or unforeseen events are not modelled — only the full exclusion.
  • Depreciation recapture on any portion used for business or as a rental is not included, and it is taxed even within the excluded amount.
  • State and local tax is not included.
  • Assumes the home was your main residence throughout; mixed use changes the calculation.

Frequently asked questions

Do I have to pay tax when I sell my house?

Usually not. The first $250,000 of gain is excluded if you owned and lived in the home for two of the last five years — $500,000 for joint filers. Because it applies to gain rather than sale price, it covers most main-home sales entirely.

What are the two tests for the exclusion?

You must have owned the home for at least two years and lived in it as your main home for at least two of the last five years. Failing either removes the exclusion completely — there is no partial credit for being close.

What if I have to move before two years?

You may qualify for a partial exclusion if the move was due to a change in workplace, health, or an unforeseeable event. It is calculated proportionally to how long you lived there and is not modelled here.

Do improvements reduce my gain?

Yes. Capital improvements add to your cost basis, shrinking the gain. Repairs and routine maintenance do not. Once your gain exceeds the exclusion, each dollar of documented improvements saves about 15 cents of tax.

Is the exclusion doubled if I am married?

For joint filers, yes — $500,000 rather than $250,000. Married filing separately does not get the doubled amount. The difference matters most where gains are largest.

What if I rented the house out for a while?

Two problems: periods of non-qualified use can allocate part of the gain to taxable, and any depreciation you claimed is recaptured at up to 25% and is not covered by the exclusion. This calculator does not model either.

How often can I use the exclusion?

Generally once every two years. If you excluded a gain on another home sale within the two years before this one, you may not be able to use it again — not modelled here.

Do selling costs reduce the gain?

Yes. Agent commission and closing costs are subtracted along with your basis before the exclusion is applied, so a 6% commission on a large sale meaningfully reduces both the gain and the tax.