Capital Gains Calculator

The Home Sale Tax Exclusion

When you sell your primary home at a profit, the IRS lets most people pay no capital gains tax on it at all. Under the Section 121 exclusion, a single filer can exclude up to $250,000 of gain and a married couple filing jointly up to $500,000, as long as the home was your main residence for at least 2 of the last 5 years. Only gain above your limit is taxed. To see what a sale above the exclusion would owe, use the free capital gains tax calculator.

In short: exclude up to $250,000 of home-sale gain if single, $500,000 if married filing jointly. You must have owned and lived in the home as your main residence for at least 2 of the 5 years before the sale. Anything above the exclusion is taxed at long-term capital gains rates.

What the exclusion actually is

The home-sale exclusion (IRS Section 121) removes a chunk of the profit on your main home from your taxable income. It is not a deduction or a credit; it simply means that up to your limit, the gain is never counted. Your gain is the sale price minus your cost basis, which is what you paid plus buying costs and qualifying improvements over the years. If that gain fits under your exclusion, you owe no federal capital gains tax on the sale.

How much you can exclude: single vs married

The amount you can shield depends on your filing status:

Filing statusMaximum gain excluded
Single$250,000
Married filing jointly$500,000
Head of household$250,000

The $500,000 amount for a married couple is essentially two $250,000 exclusions combined. To claim the full $500,000, both spouses generally need to meet the use test and at least one needs to meet the ownership test, and neither spouse can have used the exclusion on another sale in the prior two years.

The ownership and use tests

To qualify, you have to pass two tests measured over the five years ending on the date of sale:

The two years do not have to be continuous, and the ownership and use periods do not have to be the same 24 months. What matters is that each adds up to at least two years within that five-year window. This is why a home that qualifies for the exclusion has always been held long enough to count as a long-term asset.

What happens to gain above the exclusion

If your profit is larger than your exclusion, only the excess is taxable. Say a married couple bought a home for $300,000, sold it for $950,000, and had $650,000 of gain. The first $500,000 is excluded, leaving $150,000 of taxable long-term capital gain. That taxable slice is taxed at the 0%, 15%, or 20% long-term rates based on their taxable income, and high earners may also owe the 3.8% net investment income tax on it.

The calculator handles this automatically: check the primary-home box, enter your numbers, and it subtracts the exclusion for your filing status before figuring the tax on whatever is left. For the wider picture on how those long-term rates and NIIT work, see the capital gains tax guide.

Basis is your friend. The bigger your cost basis, the smaller your gain. Keep records of major improvements (a new roof, an addition, a renovated kitchen) and your original buying costs. They raise your basis and can keep more of the sale, or all of it, under the exclusion.

When the exclusion does not apply

The exclusion is generous but not automatic. It generally will not fully apply when:

Frequently asked questions

How much home-sale profit is tax-free?

Up to $250,000 of gain if you file single or head of household, and up to $500,000 if you are married filing jointly, provided you owned and lived in the home as your main residence for at least 2 of the last 5 years. Only gain above your limit is taxed.

Do both spouses have to be on the title to get $500,000?

Not necessarily. To claim the full $500,000, both spouses generally must have used the home as their main residence for the required period and at least one must meet the ownership test, and neither can have claimed the exclusion on another sale in the prior two years.

Is the taxable part short-term or long-term?

Long-term. Because the exclusion requires two years of ownership and use, any qualifying home has been held long enough to be a long-term asset, so gain above the exclusion is taxed at the 0%, 15%, or 20% long-term rates.

Does the exclusion apply to a rental or second home?

Generally no. The exclusion is for a primary residence. Vacation homes, second homes, and investment properties do not qualify, and time a home spent as a rental can reduce the benefit even if you later moved in.

Ready to see your number? The free capital gains tax calculator applies the exclusion for your filing status and estimates the tax on anything above it, including NIIT and your state.

More guides

This guide is general information, not tax or financial advice. Exclusion rules have conditions and exceptions that depend on your situation. Confirm details with a tax professional or the IRS.

← Back to the calculator