Home Sale Capital Gains Calculator

U.S. only tools

Selling a home is not automatically a taxable event: the Section 121 exclusion lets a single filer walk away from up to $250,000 of gain tax free (up to $500,000 married filing jointly) on a home owned and lived in for two of the last five years.

Your filing status, which sets the exclusion amount.

$

What the home sold for, before selling costs.

$

What you paid for the home plus capital improvements, minus any depreciation you claimed.

$

Commissions, transfer taxes and closing costs that reduce the proceeds.

$

Your other taxable income before this gain - long-term gains are stacked on top of it.

The ownership and use test for the home-sale exclusion: two of the last five years.

Results update as you type. Nothing leaves your device.

Currency symbol

Symbol only - nothing is converted and no exchange rate is used. Figures quoted in the explanation text stay as the sources publish them.

Taxable gain after the Section 121 exclusion

$30,000.00

Gain on the sale
$280,000
Section 121 exclusion
$250,000
Capital gains tax
$4,500.00

From sale price to taxable gain

LineAmount
Sale price$600,000
Less cost basis-$300,000
Less selling costs-$20,000
Gross gain$280,000
Less Section 121 exclusion-$250,000
Taxable gain$30,000

The exclusion is $250,000 for single and head-of-household filers and $500,000 for married filing jointly, and it protects a gain only on a home you owned and used as your main home for two of the five years before the sale.

How the taxable gain is taxed

LineAmount
Ordinary taxable income the gain stacks on$80,000
Long-term capital gains tax$4,500.00
Total tax on the gain$4,500.00

The taxable gain is long term and is stacked on top of ordinary taxable income, then charged on the 0%, 15% and 20% long-term ladder, with the 3.8% net investment income tax added when modified AGI passes its threshold.

The exclusion sheltered $250,000 of the $280,000 gain. The remaining $30,000 is long-term gain taxed on its own ladder, stacked on top of ordinary taxable income.

Enter the sale price, what you paid plus improvements, and your selling costs, and this calculator works out the gain, how much of it the exclusion shelters, and the long-term capital gains tax on whatever remains.

About this home sale capital gains calculator

Sold from a home owned and lived in long enough, a profit can escape tax altogether rather than just fall to a lower rate. It estimates how much of a home-sale profit becomes taxable after the Section 121 exclusion - up to $250,000 for a single owner, $500,000 for a married couple filing jointly, when the home was owned and used as a main residence for 2 of the last 5 years - then prices the remaining gain at the long-term capital gains rates and checks the 3.8% net investment income tax.

It is an estimate, not a tax return: the reduced exclusion for a job-related move or unforeseen circumstance, depreciation recapture on a rented portion and state taxes are left out, and the NIIT is applied as a threshold check rather than the full modified-AGI computation. Everything runs in your browser, the rules are committed here as IRS Publication 523 and Topic 701 with their source hashes, and the page is reviewed on a schedule and corrected openly when something is off. An estimate, not a return, and not tax advice.

How this home sale capital gains calculator works

The gain is sale price minus basis minus costs

The gain on a sale is the sale price less your cost basis less the selling costs - commissions, transfer taxes and closing costs. The cost basis is what you paid plus capital improvements, minus any depreciation you claimed while renting part of the home.

A sale that loses money produces no gain and nothing to tax: the page floors the result at zero, prints the loss amount and switches the note to a warning that names the shortfall. That branch also says plainly that the Section 121 exclusion is not used and that a capital loss offsetting other income is outside the model.

A sale price of $0 returns a single warning instead of a breakdown, because there is no transaction to price. Every other money input is clamped at zero and at the page ceiling, so the arithmetic always has a finite answer even for an absurd entry.

The Section 121 exclusion shelters up to $250K or $500K

A qualified seller can exclude up to $250,000 of gain - $500,000 for married couples filing jointly - on the sale of a main home, as set out in IRS Publication 523. The exclusion is applied to the gain first, and only what spills over is taxed.

The filing status select decides the number: married filing jointly gets $500,000, and every other status gets $250,000, including head of household and married filing separately. That is the statutory shape of Section 121, and it means a couple filing separate returns cannot reach the joint amount on this page.

The exclusion is not a general first $250,000 of profit is free rule. Without the 2-of-5-year ownership-and-use test there is no exclusion at all, and the table then prints the exclusion line at zero while the full gain stays taxable - the case the warning tone is reserved for.

The remaining gain is stacked and taxed long term

A gain that exceeds the exclusion is a capital gain. The page treats it as long term, stacks it on top of the ordinary taxable income you enter, and charges it on the 0%, 15% and 20% long-term ladder, so the rate is the one that applies at the top of your income rather than a single flat figure.

The 3.8% net investment income tax is added as a separate line when modified AGI passes its threshold. The page builds MAGI from your ordinary taxable income plus the standard deduction for your status plus the gain, applies the 3.8% only to the part of the gain that fits above the threshold, and prints the NIIT attributable to this sale rather than the tax on the whole return.

A home held a year or less produces short-term gain taxed at ordinary rates. The page has no holding-period field and always uses the long-term ladder, so that case cannot be entered; the note names the gap instead of quietly assuming the better answer.

The 2-of-5-year test governs the whole thing

You must have owned and used the home as your main home for at least two years of the five ending on the sale date. This is a physical-use test - military and Foreign Service exceptions and a prorated exclusion for a qualifying job move exist, but the default rule is all or nothing.

Set the test to no and the exclusion drops to zero: the whole gain is exposed to the long-term ladder, the table prints the exclusion line at zero, and the warning tone marks the result. There is no partial credit on the page for a seller who lived in the home for eighteen months.

Set it to yes and the exclusion applies up to the statutory cap, with the gain and the sheltered amount both printed so the arithmetic can be checked by hand. The page takes your answer as given; it cannot verify occupancy, and it does not ask for the dates that would.

Worked examples

Each example below was run through the calculator on this page when the site was built, so the numbers match what you see when you enter the same inputs.

A single filer above the exclusion, fully sheltered

Filing status: Single · Sale price: $600,000.00 · Cost basis: $300,000.00 · Selling costs: $20,000.00 · Other taxable income: $80,000.00 · Owned and lived in the home 2 of the last 5 years?: Yes

Taxable gain after the Section 121 exclusion

$30,000.00

Gain on the sale: $280,000 · Section 121 exclusion: $250,000 · Capital gains tax: $4,500.00

The $280,000 gain beats the $250,000 single exclusion by $30,000, so $250,000 is sheltered and the remaining $30,000 is stacked above the 0% long-term threshold and taxed at 15%.

Married filing jointly on $800,000

Filing status: Married filing jointly · Sale price: $800,000.00 · Cost basis: $400,000.00 · Selling costs: $30,000.00 · Other taxable income: $100,000.00 · Owned and lived in the home 2 of the last 5 years?: Yes

Taxable gain after the Section 121 exclusion

$0.00

Gain on the sale: $370,000 · Section 121 exclusion: $370,000 · Capital gains tax: $0.00

The $370,000 gain fits entirely inside the $500,000 joint exclusion, so no federal capital gains tax is due on the sale.

The same single sale, but failing the use test

Filing status: Single · Sale price: $600,000.00 · Cost basis: $300,000.00 · Selling costs: $20,000.00 · Other taxable income: $80,000.00 · Owned and lived in the home 2 of the last 5 years?: No

Taxable gain after the Section 121 exclusion

$280,000.00

Gain on the sale: $280,000 · Section 121 exclusion: $0 · Capital gains tax: $42,000.00

Without the 2-of-5-year test there is no exclusion, so the whole $280,000 gain is taxed on the long-term ladder - and would be taxed at ordinary short-term rates if the home was held a year or less.

A modest sale that never approaches the limit

Filing status: Single · Sale price: $250,000.00 · Cost basis: $100,000.00 · Selling costs: $10,000.00 · Other taxable income: $50,000.00 · Owned and lived in the home 2 of the last 5 years?: Yes

Taxable gain after the Section 121 exclusion

$0.00

Gain on the sale: $140,000 · Section 121 exclusion: $140,000 · Capital gains tax: $0.00

The $140,000 gain fits inside the $250,000 exclusion, so the entire gain is sheltered and no federal tax is due.

Frequently asked questions

What is the Section 121 exclusion?

Section 121 of the Internal Revenue Code lets you exclude up to $250,000 of gain ($500,000 married filing jointly) on the sale of a main home, provided you owned and used it as your main home for the required period. Publication 523 explains the full rules.

What is the 2-of-5-year test?

You must have owned and used the home as your main home for at least two years during the five years ending on the sale date. Years do not need to be consecutive, and short temporary absences usually still count toward the two years.

Who gets $250,000 and who gets $500,000?

Single and head-of-household filers get $250,000; married taxpayers filing a joint return get $500,000 when both spouses meet the ownership and use requirements. Taxpayers filing separately do not get the full $500,000.

What counts in the cost basis?

The basis starts at what you paid plus settlement costs, then adds capital improvements that add value or extend the life of the home, and subtracts any depreciation you claimed. Selling costs reduce the amount realized, which is the other side of the gain.

What if the home was held less than two years?

Held a year or less, the gain is short term and taxed at ordinary rates. Held more than a year, it is long term and taxed on the 0/15/20 ladder - but without the 2-of-5-year use test there is no exclusion in either case, unless a reduced exclusion for a qualifying move applies.

Are these the 2026 numbers?

The exclusion amounts are from Section 121 as set out in IRS Publication 523, and the long-term and net investment income tax figures come from IRS Topic No. 701 and the 2026 adjustments - all verified against the official texts and kept on record.

Assumptions and sources

  • The Section 121 exclusion - $250,000 single, $500,000 married filing jointly, owned and used as a main home 2 of the last 5 years: IRS Publication 523, verified against the official source and kept on record.
  • The long-term capital gains brackets and the net investment income tax applied to the remaining gain: IRS Topic No. 701, verified against the official source and kept on record, with the 2026 adjustments from IRS Revenue Procedure 2025-32.
  • Not modelled: the reduced exclusion for a qualifying job-related move or unforeseen circumstance, depreciation recapture on a rented portion, state taxes on the sale, and the exact NIIT modified-AGI computation beyond the threshold check.

Last reviewed 2026-10-09. An estimate, not a return, and not tax advice. Read the full disclaimer.

Where a figure on this page comes from an official agency — HUD, IRS, FICO or a state body — the site keeps a dated snapshot of the source page in its sources library, and a scheduled job re-checks that snapshot, so the number can be traced back to the document it came from.