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

?Enter your cost basis.
?The price you sold the asset for.
?How many years you plan to own the home before selling it.
?Enter your ordinary taxable income.
End of inputs

Your Capital Gains Tax Estimate

Capital Gain
$50,000.00

Long-term

Total Tax
$7,500.00

ST + LT + NIIT

Short-Term Tax
$0.00

Ordinary rates

Long-Term Tax
$7,500.00

0/15/20% rates

NIIT
$0.00

3.8% surtax

Net Proceeds
$92,500.00

After tax

Effective Rate
15.00%

Total tax ÷ gain

Marginal LTCG Rate
15.00%

Top LTCG bracket

Cost basis: $50,000.00. Sale price: $100,000.00. Gain: $50,000.00 (Long-term). Holding period: 18 months. Ordinary income: $95,000.00. Filing status: Single. Short-term tax: $0.00. Long-term tax: $7,500.00. NIIT: $0.00. Total tax: $7,500.00 (15.00% effective). Net proceeds: $92,500.00.
Where Your Sale Proceeds Go
Key Insights
Your $50,000.00 gain is classified as long-term because you held the asset for 18 months (more than 1 year). Long-term gains are taxed at preferential rates of 0%, 15%, or 20% — significantly lower than ordinary income rates. This saves you money compared to selling before the 1-year mark.
You held the asset for 18 months — just past the 1-year threshold that unlocks long-term rates. This timing saved you from the higher short-term (ordinary) rates. In the future, consider holding well past 12 months to avoid edge cases near the cutoff, and note that the holding period is measured from the day after acquisition to the sale date.
Your long-term gains are taxed at the 15% rate — the most common LTCG bracket for middle-to-upper income filers. On a $50,000.00 gain, the long-term portion of your tax is $7,500.00. This 15% rate is well below the ordinary income rates (up to 39.6%), which is why holding assets over 1 year is so valuable.
Your total capital gains tax of $7,500.00 is 15.00% of your $50,000.00 gain — a moderate burden. This is typical when the 15% long-term rate applies. You keep $92,500.00 after tax from the sale. Holding assets longer than 1 year is the key reason this rate stays below ordinary income rates.
The Net Investment Income Tax (NIIT) does not apply because your modified adjusted gross income is below the threshold ($200,000 for single, $250,000 for married filing jointly). You avoid the additional 3.8% surtax on investment income. High earners should plan sales carefully, as a large gain can push MAGI over the threshold and trigger the NIIT.

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.