Skip to main content

Capital Gains Tax on Home Sale Calculator

Estimate the federal capital gains tax owed when you sell a home, including the IRC §121 primary-residence exclusion of up to $250,000 ($500,000 married filing jointly).

Sale details

What you paid for the home, not counting improvements.

Agent commission, closing costs, transfer taxes — reduces your amount realized.

Remodels, additions, a new roof — not routine repairs. Increases your basis.

Determines both your exclusion amount and your capital-gains bracket.

As opposed to a rental, vacation home, or vacant land.

The IRC §121 ownership-and-use test — required to exclude any gain from tax.

Capital gains tax owed

$0

Fully covered by the primary-residence exclusion

Total gain

$136,200

Exclusion applied (IRC §121)

$136,200

Taxable gain

$0

Capital gains tax

$0

Detail

Amount realized (sale price − selling costs)$451,200
Adjusted basis (purchase price + improvements)$315,000
Exclusion limit for your filing status$500,000

Assumes a long-term gain (the home was owned more than one year), taxed at the federal long-term capital gains rates. State income tax on the gain, if your state has one, isn't included here.

Estimate calculated from the numbers you entered. This is not financial, tax, or legal advice — always consult a qualified professional before making significant financial decisions.

What this capital gains calculator does

Estimates the federal tax you'd owe on the profit from selling a home. The US has no equivalent to a municipal tax on land-value increase — instead, the IRS taxes the actual gain you realize on the sale, and gives most homeowners a large exclusion on their primary residence. Enter your purchase price, sale price, selling costs, and any capital improvements, and this calculator works out your taxable gain and the tax owed on it.

How the gain and exclusion are calculated

Gain = (Sale price − Selling costs) − (Purchase price + Capital improvements)

If it was your primary residence and you owned and lived in it for at least 2 of the 5 years before the sale (IRC §121), up to $250,000 of that gain is excluded from tax entirely for single filers, or $500,000 for married couples filing jointly. Only the gain left over after the exclusion is taxed, at the long-term capital gains rates (0%, 15%, or 20%, depending on your total taxable income and filing status).

Two worked examples

A single filer bought a home for $300,000, made $20,000 in capital improvements, and sold it a decade later for $550,000 with $33,000 in selling costs. Their gain is $197,000 — under the $250,000 exclusion, so with the 2-of-5-years test met, they owe $0 in federal capital gains tax.

A married couple filing jointly bought a home for $300,000, made $30,000 in improvements, and sold it for $1,200,000 with $72,000 in selling costs. Their gain is $798,000. The $500,000 exclusion covers most of it, leaving $298,000 taxable — which comes to $29,865 in federal capital gains tax, an effective rate of about 3.7% on the full gain.

Common mistakes

  • Forgetting the exclusion entirely: most primary-residence sales owe nothing in federal tax once the exclusion applies — don't assume every home sale generates a tax bill.
  • Not tracking capital improvements: keep receipts for renovations over the years you own a home — they directly reduce your taxable gain when you eventually sell, and are easy to forget years later.
  • Applying the exclusion to a rental or vacation home: the §121 exclusion only applies to a primary residence that passes the ownership-and-use test — an investment property's full gain is taxable (and may also trigger depreciation recapture, which this calculator doesn't model).
  • Ignoring the short-term case: selling within a year of purchase means ordinary income tax rates apply instead of the lower long-term capital gains rates this calculator uses.

Frequently asked questions

Is this the same as the property tax I pay every year?

No. Annual property tax is a separate, ongoing local tax on your home's assessed value, charged every year you own it. This calculator is about a one-time federal tax on the profit you make when you actually sell — completely different tax, different trigger, different authority (IRS, not your county).

What counts as a "capital improvement" versus a repair?

A capital improvement adds value, extends the home's useful life, or adapts it to new uses — a new roof, an addition, a kitchen remodel, a new HVAC system. Routine repairs and maintenance — repainting, fixing a leaky faucet, replacing a broken window — don't count and can't be added to your basis, even though they're real expenses.

What if I don't meet the 2-of-5-years ownership and use test?

Then none of your gain qualifies for the IRC §121 exclusion, and the entire gain is taxable at the long-term capital gains rates (assuming you owned the home more than a year). There are some partial exclusions for specific situations — a job change, health reasons, or other unforeseen circumstances — that this calculator does not model; talk to a tax professional if one of those might apply to you.

Can I use the exclusion more than once?

Generally only once every 2 years — you have to wait 2 years between sales to claim the exclusion again on a different primary residence.

What if I sold the home within a year of buying it?

This calculator assumes a long-term sale (owned more than a year), which covers the vast majority of home sales and qualifies for the lower 0/15/20% capital gains rates. A sale within a year of purchase is a short-term gain instead, taxed as ordinary income at your regular federal tax bracket — which is usually higher. This calculator doesn't model that case; if it applies to you, use the Paycheck Calculator's federal bracket data as a rough guide instead.

What actually moves this number

Specific levers, and roughly what each one is worth. Not “save more” — the things that change the figure above by an amount you can measure.

  • Find the improvement receipts before you list

    A roof, a kitchen, an addition, central air — each adds to basis and removes that amount from a taxable gain. $75,000 of documented improvements is $75,000 of gain that never existed. Bank statements and permits work where receipts are gone.

  • Check the two-year clock before accepting an offer

    The exclusion needs two of the previous five years of both ownership and use. If you are two months short, delaying the closing can be worth up to $250,000 or $500,000 of excluded gain — the largest single return available on a calendar decision.

  • A partial exclusion may still apply if you must sell early

    A job relocation, a health reason, or certain unforeseen circumstances allow a prorated exclusion. Eighteen months of the required twenty-four still shelters three quarters of the normal amount, which is not nothing.

  • Selling costs reduce the gain too

    Agent commissions, transfer taxes, and title fees come off the amount realized before the gain is computed. On a $700,000 sale that is commonly $40,000-$50,000 of gain removed, and it is frequently forgotten.

What this calculator does not cover

Every calculator simplifies, and the useful thing is knowing exactly where. These are the specific gaps between this estimate and your real situation:

  • The gain is measured against your adjusted basis, not your mortgage balance. The loan is irrelevant to the calculation, and treating it as the cost is the most common error.
  • Capital improvements raise your basis and reduce the gain — but only the ones you can document. Repairs and maintenance do not qualify.
  • It does not model depreciation recapture. If the home was ever a rental, depreciation you claimed or could have claimed is taxed separately and is not covered by the exclusion.
  • State tax is not included. Some states tax capital gains as ordinary income, several have no income tax, and the difference can be substantial on a large gain.
  • Partial exclusions for a qualifying early sale — a job move, a health reason, certain unforeseen circumstances — are not modeled here.

For anything that turns on an exact figure, use the primary sources below or a qualified professional. How these limits are decided and disclosed is described in the editorial standards.

Written and maintained by Víctor Gil VázquezData last verified: 07/28/2026