Home Sale Exclusion Calculator
When you sell your primary residence, IRC Section 121 lets you exclude up to $250,000 of capital gain from federal income tax if you are a single filer, or up to $500,000 if you are married filing jointly and both spouses meet the use test. To qualify for the full exclusion you must have owned the home and used it as your principal residence for at least two of the five years preceding the sale, and you may claim the exclusion no more than once every two years. The gain subject to potential tax is calculated as the sale price minus selling costs, minus your adjusted basis, which equals the original purchase price plus the cost of capital improvements, minus any depreciation you claimed for a home office or rental use. If your actual gain is less than the applicable exclusion amount, there is no federal capital gains tax owed on the sale. If your gain exceeds the exclusion, the excess is taxed at preferential long-term capital gains rates (0%, 15%, or 20% depending on taxable income), and any depreciation previously claimed is subject to unrecaptured Section 1250 tax at up to 25%. This calculator computes your adjusted basis, total realized gain, excluded amount, taxable gain, and estimated federal tax so you can plan your sale and understand any liability.
Home sale at $650,000 with purchase price $300,000 and improvements $25,000 yields a gain of --, with estimated capital gains tax of --.
How the home sale exclusion is calculated
The home sale capital gains exclusion is calculated by finding your total gain (sale price minus adjusted basis minus selling costs), then excluding the first $250,000 (single) or $500,000 (married filing jointly) of that gain from taxation. Any gain above the exclusion is taxed as a long-term capital gain at 0%, 15%, or 20% depending on your income. Depreciation taken on the home is recaptured separately at 25%.
Adjusted basis = purchase price + improvements - depreciation taken
Capital gain = sale price - selling costs - adjusted basis
Exclusion = $250,000 (single) or $500,000 (married)
Taxable gain = max(0, capital gain - exclusion)
Capital gains tax = taxable gain x LTCG rate
Depreciation recapture = min(depreciation taken, capital gain) x 0.25
Total tax = capital gains tax + depreciation recapture
Worked example
Single filer: sale $650,000, purchase $300,000, selling costs $40,000, improvements $25,000, depreciation $8,000:
- Adjusted basis = $300,000 + $25,000 - $8,000 = $317,000
- Capital gain = $650,000 - $40,000 - $317,000 = $293,000
- Exclusion (single) = $250,000
- Taxable gain = $293,000 - $250,000 = $43,000
- Capital gains tax = $43,000 x 0.15 = $6,450
- Depreciation recapture = min($8,000, $293,000) x 0.25 = $2,000
- Total tax = $6,450 + $2,000 = $8,450
- Net proceeds = $650,000 - $40,000 - $8,450 = $601,550
Ownership and use requirements
To qualify for the full exclusion, you must have owned and used the home as your primary residence for at least 2 of the 5 years before the sale. These years do not need to be consecutive. If you have not met the 2-year test but are selling due to job relocation, health issues, or other unforeseen circumstances as defined by the IRS, you may claim a partial exclusion based on the fraction of the 2-year period you owned and used the home.
The 2-year test is applied per sale. You can only claim the exclusion once every 2 years. If you sold another home and claimed the exclusion within the past 2 years, you do not qualify for the full exclusion on this sale unless you meet certain exceptions for job relocation, health, or other unforeseen circumstances.
If you file married filing jointly, both spouses must meet the use test (owned and lived in the home for 2 of the 5 years). Only one spouse needs to meet the ownership test. If one spouse does not meet the use test, the exclusion is reduced to $250,000. Keep documentation of your residency and the dates you lived in the home.
Home sale exclusion: frequently asked questions
What is the home sale exclusion and who qualifies?
IRC Section 121 allows you to exclude up to $250,000 (single) or $500,000 (married filing jointly) of capital gain on the sale of your primary residence, provided you owned and used it as your main home for at least 2 of the 5 years before the sale. You may also qualify for a partial exclusion if the sale was due to unforeseen circumstances, job relocation, or health reasons. The exclusion can only be claimed once every 2 years.
How is capital gain calculated?
Capital gain equals the sale price minus adjusted basis minus selling costs. Your adjusted basis is generally your original purchase price plus the cost of improvements (such as additions or renovations) minus any depreciation you took if you rented out part of the home or had a home office. Selling costs include realtor commissions, closing costs, and attorney fees. Land value does not appreciate for tax purposes if you depreciated part of the home.
What is depreciation recapture and when does it apply?
Depreciation recapture applies if you took depreciation deductions on your home for a rental portion or a home office. Depreciation taken is recaptured at a 25% tax rate, which is often higher than your long-term capital gains rate. For example, if you took $8,000 in home office depreciation, you would owe $2,000 in depreciation recapture tax (25% of $8,000), in addition to regular capital gains tax on the remaining gain.
What if my gain exceeds the exclusion amount?
If your capital gain exceeds the exclusion limit for your filing status, the excess is treated as a long-term capital gain (assuming you held the home for more than 1 year) and taxed at preferential capital gains rates: 0%, 15%, or 20% depending on your income. For example, if you are single and your gain is $400,000, the first $250,000 is excluded, and the remaining $150,000 is taxed as a long-term capital gain.
Can both spouses claim the full $500,000 exclusion?
No. If you file married filing jointly, the combined exclusion is $500,000, not $500,000 each. This applies only if both spouses meet the ownership test and both meet the use test. If one spouse does not meet the requirements, the exclusion is limited to $250,000. Each spouse's share of the exclusion is generally determined by their contribution to the purchase.
What if I have not owned the home for 2 years but must sell due to unforeseen circumstances?
If you sell before meeting the 2-year ownership and use test due to a change in employment, health issues, or other unforeseen circumstances, you may claim a partial exclusion. The exclusion is reduced proportionally to the time you owned and used the home. For example, if you owned the home for 1 year and must sell due to job relocation, you would qualify for roughly 50% of the exclusion.
Official sources
- Home sale exclusion rules: IRS Publication 523.
- Statutory authority: IRC Section 121 and IRS Topic 701.
- Depreciation recapture: IRS Publication 946.
Reviewed by the CalculatorHub team, edited by James Graham, 13 June 2026. See our methodology. General information, not tax advice.