United States · federal tax
Home sale capital gain exclusion calculator.
Work out your gain, how much of it the Section 121 exclusion covers ($250,000 single, $500,000 joint) and the federal tax on any excess at 0%, 15% or 20%.
Your sale
Estimate
Worked example
A single seller sells for $650,000 with $39,000 of selling costs. They bought for $300,000 and added $50,000 of improvements. Gain = ($650,000 − $39,000) − ($300,000 + $50,000) = $261,000. The $250,000 exclusion removes most of it, leaving $11,000 taxable. With $80,000 of other taxable income, that $11,000 sits above the $49,450 zero-rate threshold, so it is taxed at 15%: $1,650.
How the estimate works
Gain = (sale price − selling costs) − (purchase price + capital improvements). Exclusion = the smaller of the gain and $250,000 ($500,000 for a qualifying joint return), applied only if you meet the 24-month ownership and use tests within the 5 years before the sale and did not exclude another home's gain in the prior 2 years. Tax: the taxable gain is stacked on top of your other taxable income and taxed at 0%, 15% or 20% by band.
2026 band limits used (taxable income, 0% up to / 15% up to): single $49,450 / $545,500; married filing jointly $98,900 / $613,700; head of household $66,200 / $579,600; married filing separately $49,450 / $306,850. Above the second figure the rate is 20%.
Sources, as of October 1, 2026: IRS Topic 701, Sale of your home; IRS Publication 523, Selling Your Home; IRS Topic 409, Capital gains and losses; Rev. Proc. 2025-32 for the 2026 thresholds. The reduced (partial) exclusion for moves caused by work, health or unforeseen circumstances is not calculated here; see Pub 523.
The calculation, step by step
Capital gains on a home sale depend on four numbers, and each is worth getting right before you touch the form above.
- Amount realized is the sale price minus selling costs such as agent commissions, transfer taxes and legal fees. The formula on this page subtracts selling costs from the price, so enter them in the costs field, not as an improvement.
- Adjusted basis is what you paid plus capital improvements, such as a new roof or an addition, that add value or extend life. Routine repairs are generally not added. Closing costs you paid when you bought can usually be added to basis, so check your closing statement.
- Gain is the amount realized minus the adjusted basis. A negative result is a loss, and a loss on a personal residence is not deductible, so there is nothing to exclude.
- Exclusion under section 121 removes up to $250,000 of gain, or up to $500,000 on a qualifying joint return. Whatever is left is taxable capital gain.
Who qualifies for the exclusion
The IRS describes two tests. In the 5 years ending on the date of sale, you must have owned the home for at least 24 months and used it as your main home for at least 24 months. The two periods can be different 2-year windows. If you file jointly, either spouse can meet the ownership test but both spouses must meet the use test individually. Under the statute, you cannot use the exclusion if you excluded gain from another home sale in the 2 years before this one. The $500,000 limit requires the joint-return conditions in section 121(b)(2) to be met, including that neither spouse is barred by a recent exclusion, which is why the tool falls back to $250,000 when only one spouse meets the use test.
More worked examples
- Fully excluded. A married couple sells their main home of 11 years for $900,000 with $54,000 of selling costs. They paid $350,000 and added $40,000 of improvements. Amount realized: $846,000. Basis: $390,000. Gain: $456,000. Under the $500,000 joint limit the whole gain is excluded, so the taxable gain is $0.
- Partly taxable. The same couple, with a gain of $620,000 instead, has $120,000 above the exclusion. Suppose they also have $150,000 of other taxable income. The 2026 zero-rate band for joint filers ends at $98,900, which their other income already exceeds, and the 15% band runs to $613,700. Their $120,000 sits entirely in the 15% band: $18,000 of federal tax, before any state tax or the 3.8% net investment income tax.
- Does not qualify. A single seller lived in a house for 14 months, sold it, and has a $90,000 gain. Without a reduced-exclusion exception, the 24-month tests are not met, so the whole $90,000 is taxable. Pub 523 describes reduced exclusions for a work-related move, a health-related move and certain unforeseeable events, but this tool does not compute them.
Do you have to report the sale?
IRS Topic 701 says that if you receive an information return such as Form 1099-S, Proceeds From Real Estate Transactions, you must report the sale even if the gain is excludable. You must also report the sale if you cannot exclude all of your capital gain. In those cases you use Form 8949 and Schedule D. If you have no 1099-S and the entire gain is excluded, you generally do not report it. Keep records of purchase, improvements and sale for at least as long as you may need to support the basis.
Common mistakes and edge cases
- Adding mortgage payoff to basis. The loan balance is not part of basis; the price you paid is.
- Counting repairs as improvements. Painting or fixing a leak is a repair. A kitchen remodel is an improvement.
- Forgetting depreciation. If part of the home was a rental or home office, depreciation allowed after May 6, 1997 is not excluded and is taxed at up to 25 percent. The tool does not compute that.
- Nonqualified use. Periods after 2008 when the home was not your main home can reduce the exclusion. Pub 523 covers the exceptions.
- Assuming the exclusion is automatic in software. Answer the ownership and use questions carefully.
- Ignoring state tax. Many states tax gain above the exclusion, and some do not follow federal rules exactly.
Who this is for, and what it does not cover
It is for owners considering a sale, and for sellers who want a quick estimate of the federal tax on any gain above the exclusion. It is not a substitute for a closing statement or a tax return. For net cash at closing, use the seller net proceeds calculator. For gains on other assets try the capital gains tax calculator, and for the extra 3.8% surtax see the net investment income tax calculator.
Sources
Primary sources used for this page, each retrieved October 2026.
- IRS Topic No. 701, Sale of your home (retrieved 2026-10) – exclusion amounts and when to report
- IRS Publication 523, Selling Your Home (retrieved 2026-10) – ownership and use tests, joint returns, partial exclusion
- IRS Topic No. 409, Capital gains and losses (retrieved 2026-10) – capital gain rates
- IRS Revenue Procedure 2025-32 (PDF) (retrieved 2026-10) – 2026 capital gain rate thresholds
- 26 U.S.C. 121, Exclusion of gain from sale of principal residence (retrieved 2026-10) – statutory limits and the 2-year rule
Frequently asked questions
How much capital gain on a home sale is excluded?
Up to $250,000 of gain if you file as single, or up to $500,000 on a qualifying joint return, if you meet the ownership and use tests. Gain above that is taxed as capital gain.
Who qualifies for the exclusion?
You must have owned the home and used it as your main home for at least 24 months of the 5 years ending on the sale date. The two tests can be met in different 2-year windows. You generally cannot use it if you excluded gain on another home in the 2 years before the sale.
Why is the joint limit sometimes only $250,000?
A joint return gets $500,000 only when either spouse meets the ownership test, both spouses meet the use test and neither is barred by a prior exclusion. If one spouse fails the use test, the limit drops to $250,000.
What if I lived in the home less than 2 years?
A reduced exclusion may apply if you moved because of work, health or certain unforeseen circumstances. This page does not calculate it and shows no exclusion in that case. See IRS Publication 523.
Do I have to report the sale of my home to the IRS?
Yes if you receive a Form 1099-S, even when the gain is excludable, and yes if you cannot exclude all of your gain. If you have no 1099-S and the whole gain is excluded, you generally do not report it.
What tax rate applies to gain above the exclusion?
Long-term gain is taxed at 0%, 15% or 20% depending on taxable income. For 2026 the 0% band for single filers ends at $49,450 of taxable income and the 15% band ends at $545,500.
How do I calculate gain on a home sale?
Subtract selling costs from the sale price, then subtract your adjusted basis, which is what you paid plus capital improvements. The result is your gain before any exclusion.
What is not included in the tax estimate?
State tax, the 3.8% net investment income tax, the 25% rate on depreciation recapture such as a home office or rental period, and nonqualified-use rules. See Topic 409, Topic 559 and Pub 523.
Estimate only
Federal arithmetic on figures you enter. It leaves out state tax, the net investment income tax, depreciation recapture and nonqualified use. It is not tax or legal advice. Confirm with a tax professional or Pub 523 before filing.