Scenario Calculator
Capital Gains Tax Calculator for Home Sale (Section 121)
Selling your primary residence can trigger capital gains tax, but Section 121 of the IRS code provides a generous exclusion that eliminates or reduces the tax for most homeowners. If you've lived in the home for at least 2 of the last 5 years, you can exclude up to $250,000 of gain (single) or $500,000 (married filing jointly).
For example, if you bought a home for $300,000 and sell it for $600,000, your $300,000 gain is fully excluded if you're married ($500,000 exclusion) and partially taxed if you're single ($250,000 excluded, $50,000 taxed at long-term capital gains rates). The exclusion can be used once every 2 years.
Use the calculator below to estimate your capital gains tax on a home sale. Enter your purchase price, sale price, improvements, and filing status to see your taxable gain and estimated tax.
Investment Sale Details
Your Capital Gains Tax Estimate
Long-term
ST + LT + NIIT
Ordinary rates
0/15/20% rates
3.8% surtax
After tax
Total tax ÷ gain
Top LTCG bracket
Frequently Asked Questions
How does the Section 121 exclusion work?
If you've owned and used the home as your primary residence for at least 2 of the 5 years before the sale, you can exclude up to $250,000 (single) or $500,000 (married filing jointly) of capital gains. The exclusion applies to the gain, not the sale price. For example, a married couple who bought for $400K and sold for $900K has a $500K gain, which is fully excluded — no federal capital gains tax.
What costs can I add to my home's tax basis?
Your basis includes the purchase price plus closing costs (title, legal, recording fees) and capital improvements (additions, renovations, new roof, HVAC, landscaping). Repairs and maintenance don't count. Track all improvement receipts. Example: Bought for $300K + $20K improvements = $320K basis. Sell for $600K → gain = $280K. Single filer: $30K taxable ($280K - $250K exclusion).
What happens if I sell before living in the home for 2 years?
If you sell before meeting the 2-year ownership and use test, you generally don't qualify for the Section 121 exclusion. However, a partial exclusion may apply if the sale is due to a change in employment, health, or unforeseen circumstances (divorce, death, multiple births). The partial exclusion is prorated based on the time lived in the home. Consult a tax professional for your specific situation.
Are there state capital gains taxes on home sales?
Most states follow federal treatment and conform to the Section 121 exclusion, but some do not. California taxes capital gains on home sales as ordinary income (up to 13.3%) even if excluded federally. Some states have their own exclusion rules. Always check your state's specific rules. Also, the excluded gain does not affect your ability to use the exclusion again — you can use it once every 2 years.