Skip to main content
capitalgaintaxcalc.com

Real estate · intermediate · 9 min

Home sale exclusion (Section 121): $250,000 / $500,000

Updated 2026-10-12

Educational only. Not tax advice.

Short answer

You may exclude up to $250,000 of gain on your main home. A joint return can exclude up to $500,000 when both spouses meet the use test. You must have owned the home and used it as your main home for 2 of the last 5 years. Gain above the cap is still taxed.

Key takeaways

  • The cap is $250,000, or $500,000 when both spouses meet the use test and neither used the exclusion in the prior two years.
  • You need 24 months of ownership and 24 months of use in the 5 years before the sale. Those months need not be in a row.
  • Gain above the cap is taxable. Depreciation you were allowed to claim is not excluded.

You may owe tax when you sell your home

A home sale can create taxable gain, and the Section 121 exclusion can remove some or all of that gain from federal income, though it is not a credit and it is not a 1031 deferral.

What the exclusion removes

Section 121 excludes gain on a main home from federal income, up to the cap, and Topic 701 states those caps as $250,000, or $500,000 if you file a joint return with your spouse, while Publication 523 is the IRS narrative for the tests and the exceptions.

The $250,000 and $500,000 caps

The cap is $250,000, and the $500,000 cap applies only when both spouses meet the use test and neither has used the exclusion in the two years before the sale, while on a joint return only one spouse has to meet the ownership test and each spouse must meet the residence test. Topic 701 still states those two dollar caps, which are not adjusted for inflation and have stayed at those amounts since 1997. Verified on 12 October 2026.

The calculator applies $500,000 whenever the filing status is married filing jointly and the year fields are at least 2, and it does not check each spouse or the prior two years.

The home has to be your main home

The exclusion is for your main home, so a second home or a rental that was never your main home is not this exclusion. Choose real estate and a primary residence on the real estate calculator. State pages include Arizona, Ohio, Kentucky, Maryland, Pennsylvania, West Virginia, Kansas, Oklahoma, Washington, and Arkansas.

Owned and used for 2 of the last 5 years

You meet the ownership test with at least 24 months of ownership in the 5 years ending on the sale date, and you meet the residence test with at least 24 months of use as your main home in that same period, even when the two stretches are different, as long as both fall inside those 5 years. The calculator asks for whole years, 2 of 5. It does not count days.

The 24 months need not be in a row

The 24 months of residence can fall anywhere in the 5-year period, and Publication 523 says the time does not have to be a single block. The strip shades two separate blocks. The year fields cannot show a split month pattern.

Eligibility path for this example

Primary residence, single, owned 2 of the last 5 years, and used 2 of the last 5 years. The same facts drive the list and the strip.

  1. Investment property stops here: no exclusion. A main home, or mixed use that includes the main home, continues.
  2. Owned for fewer than 2 of the last 5 years: full exclusion not available.
  3. Used as the main home for fewer than 2 of the last 5 years: full exclusion not available.
  4. This example meets both year tests. Exclusion available, cap $250,000.

24 months inside 60, in two blocks

The strip is 60 months. Months 1 through 12 are one shaded block. Months 37 through 48 are the other. The months between them are open, so the 24 months are not in a row. The calculator counts whole years, so 2 years meets the test. The year fields cannot show a split month pattern.

  1. Month 1, shaded
  2. Month 2, shaded
  3. Month 3, shaded
  4. Month 4, shaded
  5. Month 5, shaded
  6. Month 6, shaded
  7. Month 7, shaded
  8. Month 8, shaded
  9. Month 9, shaded
  10. Month 10, shaded
  11. Month 11, shaded
  12. Month 12, shaded
  13. Month 13, open
  14. Month 14, open
  15. Month 15, open
  16. Month 16, open
  17. Month 17, open
  18. Month 18, open
  19. Month 19, open
  20. Month 20, open
  21. Month 21, open
  22. Month 22, open
  23. Month 23, open
  24. Month 24, open
  25. Month 25, open
  26. Month 26, open
  27. Month 27, open
  28. Month 28, open
  29. Month 29, open
  30. Month 30, open
  31. Month 31, open
  32. Month 32, open
  33. Month 33, open
  34. Month 34, open
  35. Month 35, open
  36. Month 36, open
  37. Month 37, shaded
  38. Month 38, shaded
  39. Month 39, shaded
  40. Month 40, shaded
  41. Month 41, shaded
  42. Month 42, shaded
  43. Month 43, shaded
  44. Month 44, shaded
  45. Month 45, shaded
  46. Month 46, shaded
  47. Month 47, shaded
  48. Month 48, shaded
  49. Month 49, open
  50. Month 50, open
  51. Month 51, open
  52. Month 52, open
  53. Month 53, open
  54. Month 54, open
  55. Month 55, open
  56. Month 56, open
  57. Month 57, open
  58. Month 58, open
  59. Month 59, open
  60. Month 60, open

Price, selling costs, and basis

Gain is the selling price, minus selling expenses, minus adjusted basis, and basis starts with the purchase price plus improvements, while repairs that only keep the home in good condition do not add to basis and improvements do. The $30,000 of selling costs in the example is why the taxable slice is $20,000 rather than $50,000, and the calculate guide owns the general formula.

Once during a 2-year period

You meet the look-back test if you did not exclude gain on another home during the 2 years before this sale, and Publication 523 says you may take the exclusion only once during a 2-year period. The calculator gives it to the first qualifying home in a session. A second qualifying home in that session does not get it, and a reduced cap is not computed.

Gain above the cap is taxed

Gain above the cap stays in income, and in the example the basis is $220,000, proceeds are $490,000, and the gain is $270,000, so the $250,000 exclusion leaves $20,000 taxable. Of that, $19,450 is taxed at 0% and $550 at 15%, federal tax is $82.50, and NIIT is $0.

A $30,000 selling cost leaves $20,000 taxable

  • Primary residence, single, owned 2 of the last 5 years, used 2 of the last 5 years.
  • Buy price $200,000. Improvements $20,000. Sell price $520,000. Selling costs $30,000.
  • Taxable income before the gain $30,000. Bought 15 January 2024. Sold 15 June 2026, so the holding period is long-term.
  • Repairs are not in these inputs. Improvements are.
Enter these numbers

A reduced exclusion for a forced move

A reduced exclusion can apply when the sale is for a work-related move, a health-related move, or an unforeseeable event, only as Publication 523 states it. This calculator does not compute the reduced cap.

A rental or a business in the home

Renting the home, or using part of it for business, does not automatically end the exclusion if the 2-of-5 tests are still met, but if the home was a rental or a second home before you moved in, nonqualified use can leave part of the gain taxable anyway. Publication 523 says gain allocated to nonqualified use may not be excluded, with exceptions, and time after the last date you used the home as your main home, inside the 5-year window, is one of them. This calculator does not compute that fraction. Investment-only property does not qualify, and the engine does not split the house by square footage or by a home-office percentage.

Depreciation is not excluded

Depreciation allowed or allowable is not excluded, because it is unrecaptured Section 1250 gain taxed at up to 25%, and the rates guide states that ceiling. The same sale, with the $30,000 of selling costs, mixed use, and $40,000 of depreciation, has a basis of $180,000 and a gain of $310,000, so after the $250,000 exclusion, $60,000 is taxable, made up of $40,000 of unrecaptured Section 1250 and $20,000 of long-term gain. Federal tax is $9,760 and NIIT is $0. A primary-only entry would not subtract that depreciation, so choose mixed use if you rented the home or kept a business in it.

Divorce, death, and service

Publication 523 covers divorce, a surviving spouse, and qualified official extended duty, which can suspend the 5-year period for up to 10 years for the uniformed services, the Foreign Service, and the Peace Corps. This calculator does not apply these rules.

A home you inherit

If you inherited the home, Publication 523 says basis is fair market value on the date of death or on a later alternate valuation date, and this calculator has no inherited-basis field, so enter that value as the buy price. The holding period stays in the gifts watch-out on the start-here guide.

This exclusion is not a 1031 exchange

Section 121 is the main-home exclusion, while Section 1031 defers gain on real property held for investment or business use, and a primary residence does not qualify for a 1031 exchange in this calculator. See the 1031 guide.

How the sale is reported

Report the sale if you have taxable gain you cannot exclude, if you received a Form 1099-S, or if you choose to report gain you could have excluded, and a Form 1099-S means the sale goes on Form 8949 even when the gain is fully excluded. If none of those three apply, Publication 523 says you do not have to report it, while the Form 1099-S instructions still treat a main-home sale as reportable by the closing agent.

When the sale is reported, the Form 8949 instructions use code H for the excluded gain on a main home, and their example enters EH when selling expenses were left off the Form 1099-S, while Schedule D carries the net and this page does not fill the forms.

Publication 523 is the IRS narrative for the tests and for the exceptions this calculator does not run.

Next: the 1031 guide, the calculate guide, and the Schedule D guide.

Sources

  1. Topic 701, Sale of your home
  2. Publication 523, Selling your home
  3. Instructions for Form 1099-S
  4. Instructions for Form 8949
  5. Instructions for Schedule D
  6. Topic 409, Capital gains and losses

FAQ

Frequently asked questions

Do I have to buy another home?

No. Publication 523 tests ownership, use, and the look-back. Those tests do not require you to buy a replacement home.

Is a loss on a home sale deductible?

No. Topic 409 says losses from the sale of personal-use property, such as your home, are not tax deductible.

Is there still an over-55 exclusion?

No. Topic 701 and Publication 523, opened on 12 October 2026, do not describe an exclusion that starts at age 55. That one-time rule was repealed in 1997. The current tests are 2 of 5 years and the $250,000 or $500,000 cap.

Does my state follow the federal exclusion?

States differ. This page does not list state rules. The [state overview](/us/) is the place to start for a state calculation.

Can I exclude gain on a vacation home?

Only if it was your main home for 24 months of the 5 years before the sale. A vacation home that was never your main home does not qualify.

What if I already sold a home last year?

If you excluded gain on another home during the 2-year period before this sale, you do not meet the look-back test for a full exclusion. This calculator does not compute a reduced cap.

Do closing repairs add to basis?

Publication 523 says you cannot add repairs that only keep the home in good condition. Improvements that add value or prolong the life of the home do add to basis.

What if I lived in the home for 2 years but owned it for less?

You need both tests. Fewer than 24 months of ownership means the full exclusion is not available, even if you lived there for 2 years.