In the United States, Section 121 of the tax code lets you exclude up to $250,000 of gain on the sale of your main home ($500,000 for a married couple filing jointly). To qualify, you must have owned the home and used it as your main home for at least 2 years (24 months) during the 5 years before the sale. You can use the exclusion once every two years. This calculator shows the gain, the exclusion, the taxable gain and the tax, with a reduced exclusion for sales caused by a job change, health or another unforeseen event.
How the calculation works
- Gain = sale price − selling costs − cost basis (purchase price plus improvements)
- Exclusion = $250,000, or $500,000 for joint filers, if you meet the 24-month tests
- Reduced exclusion = the full amount × months ÷ 24, if you qualify for an exception
- Taxable gain = gain − exclusion, never below zero
- Tax = taxable gain × the long-term capital gain rate
Example
You sell for $650,000 with a basis of $300,000 and 6 % selling costs, so the gain is $311,000. As a single filer who lived there for 60 months, you exclude $250,000. The taxable gain is $61,000 and the federal tax at 15 % is $9,150. The exclusion saves you $37,500, and you keep $601,850 from the sale before paying off the mortgage.
Why it matters
For most homeowners, the exclusion removes all tax on the sale, but in high-priced markets or after decades of price rises, the gain can exceed the limit. Keeping receipts for improvements raises your basis and lowers the taxable gain. Married couples must both meet the use test but only one needs to meet the ownership test for the $500,000 limit.
Good to know
Gain from depreciation claimed after 1997, for instance on a home office or a rental, is taxed and cannot be excluded (up to 25 %). A home used partly for business or rented can limit the exclusion. A surviving spouse can use the $500,000 limit for two years. The 3.8 % net investment income tax can apply to a large gain, and states have their own rules. Military and certain other service members can suspend the five-year period.
In practice
Collect your purchase documents and improvement receipts, ask your tax adviser about depreciation and report the sale if the gain exceeds the exclusion. This tool is educational and is not tax advice.