Capital Gains on Home Sale Calculator

Calculate the capital gains tax on your home sale using the IRS Section 121 exclusion. Find out if you qualify for the $250,000 (single) or $500,000 (married) exclusion and estimate your tax liability.

Total years you owned the home
Years used as primary residence (2+ for exclusion)
Used to determine your capital gains tax rate
Capital improvements, not regular maintenance
Commissions, legal fees, marketing costs

How This Calculator Works

This calculator estimates the capital gains tax you may owe when selling your primary residence. It follows IRS Section 121 rules for the home sale exclusion.

1. Calculate Your Gross Gain

Gross Gain = Sale Price โˆ’ Purchase Price. This is the total profit you made from selling your home before any adjustments.

2. Subtract Improvements and Selling Costs

Net Gain = Gross Gain โˆ’ Improvements Cost โˆ’ Selling Expenses. Capital improvements (not repairs) increase your cost basis. Selling expenses like realtor commissions and legal fees are deducted from your gain.

3. Apply the Section 121 Exclusion

If you lived in the home for at least 2 of the last 5 years, you may exclude up to $250,000 (single) or $500,000 (married filing jointly) of the gain from taxation.

4. Determine Taxable Gain and Tax

Taxable Gain = max(0, Net Gain โˆ’ Exclusion). If you owned the home for more than 1 year, long-term capital gains rates apply (0%, 15%, or 20% based on your income). Otherwise, your ordinary income tax rate applies.

Calculation completed successfully!
Please check your input values and try again.

Calculator Features

๐Ÿ 
Section 121 Exclusion

Applies the correct IRS exclusion based on your filing status and primary residence qualification.

๐Ÿ“Š
Complete Breakdown

Shows gross gain, improvements, selling costs, exclusion amount, taxable gain, and estimated tax.

๐Ÿ’ฐ
Long-Term Rates

Automatically applies the correct long-term capital gains rate (0%/15%/20%) based on your income.

๐Ÿ“‹
Step-by-Step Guide

Clear, numbered steps explaining exactly how your result was calculated from start to finish.

Related Tax & Legal Calculators

More from Finance

What is the Home Sale Exclusion? (Section 121)

IRS Section 121 allows homeowners to exclude a significant portion of capital gains from the sale of their primary residence. This is one of the most valuable tax benefits available to homeowners. Under current law, single filers can exclude up to $250,000 of gain, while married couples filing jointly can exclude up to $500,000.

To qualify for the full exclusion, you must have owned and used the home as your primary residence for at least 2 of the last 5 years before the sale. This is commonly known as the "2-out-of-5-year rule."

Any gain that exceeds the exclusion amount is subject to capital gains tax. If you owned the home for more than one year, the gain is taxed at long-term capital gains rates (0%, 15%, or 20%) depending on your taxable income. If owned for one year or less, it's taxed as short-term capital gains at your ordinary income tax rate.

How to Qualify for the Home Sale Exclusion

The 2-out-of-5-Year Rule

To qualify for the Section 121 exclusion, you must meet both the ownership test and the use test:

The 2 years do not need to be consecutive โ€” any 24-month period within the 5-year window counts.

Partial Exclusion

If you don't meet the 2-out-of-5-year requirement, you may still qualify for a partial exclusion if the sale was due to:

The partial exclusion is calculated as (months of qualifying use / 24) ร— full exclusion amount.

Frequency Limit

You can only claim the Section 121 exclusion once every 2 years. This rule applies per person, not per property.

Strategies to Minimize Capital Gains Tax on Home Sale

1. Keep Track of Home Improvements

Capital improvements increase your cost basis, which reduces your taxable gain. Keep receipts for major renovations like kitchen remodels, new roofing, added rooms, landscaping, and HVAC replacements. Repairs and maintenance (painting, fixing leaks) generally do not count.

2. Document Selling Expenses

Real estate commissions, attorney fees, title insurance, escrow fees, and advertising costs can all be deducted from your gain. These expenses can add up to 8-10% of the sale price.

3. Time Your Sale

If you're close to meeting the 2-year residency requirement, consider waiting until you qualify for the full exclusion. Even a few extra months can save you tens of thousands in taxes.

4. Consider Filing Status

If you're married, filing jointly doubles your exclusion from $250,000 to $500,000. If both spouses qualify, you can exclude up to $500,000 even if one spouse owned the home before marriage.

5. Use Tax-Loss Harvesting

If you have capital losses from investments, you can use them to offset capital gains from your home sale. Capital losses can offset an unlimited amount of capital gains, plus up to $3,000 of ordinary income per year.

Frequently Asked Questions (FAQ)

Do I have to pay capital gains tax when I sell my primary residence?
Not necessarily. Under IRS Section 121, you can exclude up to $250,000 (single) or $500,000 (married filing jointly) of gain on the sale of your primary residence if you meet the 2-out-of-5-year ownership and use test. Only gains exceeding these limits are taxable.
What counts as a capital improvement versus a repair?
Capital improvements add value to your home, prolong its useful life, or adapt it to new uses. Examples include room additions, new roof, kitchen remodel, new HVAC system, and new windows. Repairs are routine maintenance like painting, fixing leaks, or replacing broken windows โ€” these do not increase your cost basis and cannot be deducted from your gain.
What happens if I sell before living in the home for 2 years?
You may still qualify for a partial exclusion if the sale was due to a change in employment, health reasons, or unforeseen events. The partial exclusion is calculated as (months lived in the home / 24) ร— the full exclusion amount. Otherwise, the entire gain may be taxable as a capital gain.
How are capital gains on a home sale taxed?
If you owned the home for more than 1 year, the gain is taxed as a long-term capital gain at rates of 0%, 15%, or 20% depending on your taxable income. If you owned the home for 1 year or less, it's taxed as short-term capital gain at your ordinary income tax rate. Most home sales qualify for long-term treatment.
Can I claim the exclusion on a second home or rental property?
The Section 121 exclusion only applies to your primary residence, not second homes or rental properties. However, if you convert a rental property into your primary residence and live there for at least 2 years, you may qualify for the exclusion on gain that accrued during the primary residence period. Rental use before the conversion may be subject to depreciation recapture.
How often can I use the home sale exclusion?
You can only use the Section 121 exclusion once every 2 years. This is a per-person limit, so each spouse in a married couple can qualify separately if they each meet the requirements. If you sell multiple homes within 2 years, only one sale can qualify for the exclusion.

โš ๏ธ Important: Consult a Tax Professional

This calculator provides estimates for informational and educational purposes only. Tax laws are complex and subject to change. The Section 121 exclusion has specific qualification requirements and exceptions that may apply to your situation. State and local taxes may also apply. Always consult with a qualified tax professional or CPA for personalized tax advice regarding your home sale.