Capital Gains Tax on Home Sale: How the $250,000 / $500,000 Exclusion Works

Capital gains tax on a home sale: how to figure your gain, who qualifies for the $250,000 or $500,000 IRS exclusion, and three worked examples.

Capital gains tax on a home sale catches many sellers off guard, but most people who sell their main home owe nothing. The IRS lets you exclude up to $250,000 of gain, or up to $500,000 for a married couple filing jointly, if you meet a few conditions. This guide explains how to figure your gain, who qualifies for the exclusion, the special cases, and three worked examples from our free Home Sale Calculator.

Quick answer: if you owned and lived in the home as your main home for at least 2 of the 5 years before the sale, and you have not used the exclusion on another home in the past 2 years, you can usually exclude up to $250,000 of gain ($500,000 if married filing jointly). Only the gain above that limit may be taxed. Source: IRS Topic no. 701.

Step 1: figure your gain, not your sale price

Your gain is not the price you sell for, and it is not the cash you receive at closing. IRS Publication 523 uses this formula:

  • Amount realized = selling price minus selling expenses (for example the agent commission, advertising, legal fees and other costs to sell).
  • Adjusted basis = what you paid for the home plus the cost of improvements, with a few adjustments.
  • Gain = amount realized minus adjusted basis.

Your mortgage balance does not change the gain. Paying off the loan affects your cash at closing, not your taxable profit.

Improvements raise your basis, repairs do not

Improvements add value, prolong the life of the home or adapt it to new uses. Publication 523 lists examples such as a bedroom or bathroom addition, a deck, a fence, a new roof, new siding, insulation, a new furnace or central air, a kitchen modernization and new flooring. Ordinary repairs, such as fixing a broken windowpane, do not count unless they are part of a larger remodeling project. Keep receipts for every improvement: they can lower your gain years later.

Step 2: check whether you qualify for the full exclusion

Publication 523 sets out an eligibility test. In most cases it comes down to four questions:

  1. Ownership: did you own the home for at least 24 months during the 5 years before the sale?
  2. Residence: did you live in it as your main home for at least 24 months during those 5 years? The two periods do not have to be the same months.
  3. Look-back: have you excluded the gain from another home sale during the 2 years before this one? If so, you generally cannot use it again yet.
  4. Automatic disqualifications: for example, you acquired the property through a like-kind (1031) exchange during the past 5 years, or you are subject to expatriate tax.

Married couples: up to $500,000

For the $500,000 limit on a joint return, either spouse can meet the ownership test, but both spouses must meet the residence test, and neither can have used the exclusion in the previous 2 years.

Special cases

  • Surviving spouse. If you sell within 2 years of your spouse’s death and have not remarried, you may still qualify for the $500,000 limit if the other conditions are met.
  • Partial exclusion. If you sell before meeting the 2-year tests because of a work-related move, a health-related move or certain unforeseeable events, you may qualify for a reduced exclusion.
  • Military, Foreign Service, intelligence and Peace Corps. If you are on qualified official extended duty, you can choose to suspend the 5-year test period for up to 10 years.
  • Home office or rental use. Depreciation you claimed (or could have claimed) after May 6, 1997 generally cannot be excluded and may be taxed when you sell.

Three worked examples

All three examples use the same sale, calculated with the capital gain section of the Home Sale Calculator: a $400,000 selling price with $25,000 of selling expenses (a $20,000 commission, $2,000 of seller concessions and $3,000 of closing fees), so the amount realized is $375,000.

Example 1: single seller, gain fully covered

Purchase price $250,000, no improvements. Gain: $375,000 minus $250,000 = $125,000. The seller meets the 2-of-5-year tests, so up to $250,000 can be excluded. Taxable gain: $0.

Example 2: single seller, gain above the limit

Purchase price $100,000 many years ago. Gain: $375,000 minus $100,000 = $275,000. The exclusion covers $250,000. Gain that may be taxable: $25,000. The same sale by a married couple filing jointly would leave $0 taxable, because their limit is $500,000.

Capital gains tax on home sale: steps from the sale price down to the gain that may be taxable
Capital gains tax on home sale: each step, from the sale price to the exclusion, lowers the amount that may be taxed.

Example 3: seller who does not meet the tests

Same $275,000 gain, but the owner lived in the home for only one year and no partial-exclusion reason applies. Gain that may be taxable: $275,000. Because the home was held for more than one year, it would be taxed as a long-term capital gain.

What tax rate applies to the taxable part?

  • Owned more than one year: long-term capital gain rates of 0%, 15% or 20%, depending on your taxable income (IRS Topic no. 409).
  • Owned one year or less: ordinary income tax rates.
  • Net investment income tax: a 3.8% tax may also apply to the taxable gain if your modified adjusted gross income is above $200,000 (single) or $250,000 (married filing jointly). It does not apply to the part of the gain you exclude (IRS Topic no. 559).

Do you have to report the sale?

If you receive Form 1099-S, Proceeds From Real Estate Transactions, you must report the sale even if the whole gain is excluded. If part of the gain is taxable, it is reported on Form 8949 and Schedule D (Form 1040). If you sold at a loss, you cannot deduct the loss on your main home, and you owe no tax on the money you received.

Estimate your own gain in a few seconds

Open the free Home Sale Calculator, enter your sale, then open “Estimate your capital gain and the IRS home sale exclusion”. Add your purchase price, your improvements, your filing status and whether you meet the 2-of-5-year tests. You will see your amount realized, adjusted basis, gain, the exclusion used and the gain that may be taxable. Planning work on the home first? See home improvements that add value before you sell.

FAQ

Do I pay capital gains tax if I sell my house and buy another one?

Buying another home does not change the calculation. The exclusion depends on your ownership, residence and look-back tests, not on whether you buy again.

Does the mortgage I pay off reduce my capital gain?

No. The gain is based on the amount realized and your adjusted basis. The mortgage payoff only reduces the cash you receive.

Can I use the exclusion more than once?

Yes, but generally not more than once every 2 years.

Are home improvements tax deductible?

Not in the year you pay for them. Capital improvements are added to your basis, which lowers your gain when you sell.

This guide gives general information based on IRS Publication 523 and IRS Topics 409, 559 and 701. It is not tax advice. Rules have exceptions; check the IRS sources or ask a tax professional about your situation.