Selling your home? Enter the sale price, what you paid, improvements and selling costs, and how long you owned and lived in it. The calculator applies the Section 121 exclusion of up to $250,000 ($500,000 for married couples filing jointly), including partial exclusions, and estimates the tax on any gain that is left.
Last updated:
Sale
$
$
Agent commissions, title, transfer taxes and other closing costs you paid.
Purchase & improvements
$
$
Title, recording, transfer taxes (not loan fees or prepaid interest).
$
Additions, new roof, remodels; not repairs or maintenance.
$
Ownership & use
years
years
Allows a partial exclusion if you don't meet the 2-year tests.
Tax rates
2026: 0% up to $49,450 taxable income (single) / $98,900 (joint); 20% above $545,500 / $613,700.
%
Used when you owned the home 1 year or less.
%
Federal maximum 25%.
%
Applies to taxable gain if MAGI is above $200,000 (single) / $250,000 (joint).
Enter your values to see the result.
Advertisement
Advertisement
How to use the Home Sale Capital Gains Tax Calculator
Enter the sale price and selling costs.
Enter the purchase price, buying closing costs and capital improvements to build your cost basis.
Choose your filing status and enter the years you owned the home and lived in it during the last 5 years.
Tick the boxes if you used the exclusion recently or are moving early for a qualifying reason.
Pick your tax rates and read the taxable gain and estimated tax.
Exclusion = $250,000 (single) or $500,000 (married filing jointly) if you meet the 2-out-of-5-year tests, or a prorated share for a qualifying early move
Taxable gain = gain − exclusion (depreciation after May 6, 1997 is always taxable, at up to 25%)
Example with the default numbers: a couple sells for $850,000 and pays $48,000 in selling costs. They paid $320,000 plus $6,000 of closing costs and spent $75,000 on improvements, so the basis is $401,000 and the gain is $401,000. The $500,000 exclusion covers all of it, so there is no tax. If they were single, $151,000 would be taxable: at 15% + 3.8% NIIT + 5% state, about $35,900.
Exclusion rules at a glance
Situation
Maximum exclusion
Single, head of household, married filing separately (each)
$250,000
Married filing jointly, both lived there 2 of last 5 years
$500,000
Surviving spouse, sold within 2 years of spouse's death
$500,000
Moved early for work, health or unforeseen event
$250,000 / $500,000 × months ÷ 24
Excluded gain on another home within 2 years
None (partial only for a qualifying reason)
Depreciation claimed after May 6, 1997
Not excludable; taxed at up to 25%
The $250,000 and $500,000 limits are set in the tax code and are not adjusted for inflation. The 2-year periods do not have to be continuous: 24 months in total within the 5 years before the sale is enough.
Tips
Your closing statement from the purchase and receipts for improvements are what prove your basis.
If you sold an investment property instead, a 1031 exchange may defer the tax.
Under Section 121 you can exclude up to $250,000 of gain if you are single, and up to $500,000 if you are married filing jointly, as long as you owned and lived in the home as your main home for at least 2 of the 5 years before the sale and haven't used the exclusion in the past 2 years.
How is the gain on a home sale calculated?
Gain = sale price − selling costs − adjusted basis. The adjusted basis is what you paid, plus certain buying closing costs and the cost of capital improvements, minus any depreciation you claimed for a home office or rental use.
What if I haven't lived in the house for 2 years?
You may still get a partial exclusion if you sold mainly because of a job change, health reasons or certain unforeseen circumstances. The exclusion is prorated: for example, 12 months of qualifying ownership and use gives 12/24 = 50% of the $250,000 or $500,000 limit.
Which home improvements increase my basis?
Improvements that add value, extend the home's life or adapt it to new uses count: additions, a new roof, a remodeled kitchen, new HVAC, landscaping, fencing. Ordinary repairs and maintenance, like repainting a room or fixing a leak, do not. Keep receipts for the life of the home.
What capital gains rate applies to a home sale?
If you owned the home for more than a year, any taxable gain is long-term and taxed at 0%, 15% or 20% depending on your taxable income, plus possibly the 3.8% net investment income tax and state tax. Gain from depreciation claimed after May 6, 1997 is taxed at up to 25% and cannot be excluded.
Do married couples always get the $500,000 exclusion?
To get $500,000 on a joint return, either spouse must meet the ownership test, both must meet the 2-year use test, and neither can have used the exclusion in the previous 2 years. If only one spouse qualifies, that spouse can usually exclude up to $250,000. A surviving spouse can use $500,000 if the home is sold within 2 years of the spouse's death.
Does this cover rental periods before I moved in?
Not fully. Gain allocated to periods of nonqualified use (such as renting the home out before you made it your main home, after 2008) is not excludable. This calculator handles depreciation recapture but not the nonqualified use allocation, so ask a tax professional if that applies.
Are all the tools on FreeToolCabin tested for quality and accuracy?
Yes! Every tool on our site undergoes automated Q/A testing in real browser environments to ensure high precision, correct output, and zero errors. If you happen to spot a bug or have a suggestion, please contact us at [email protected] and our team will review it right away.