Real estate · intermediate · 9 min
Home sale exclusion (Section 121): $250,000 / $500,000
Updated 2026-10-12
Educational only. Not tax advice.
- You may owe tax when you sell your home
- What the exclusion removes
- The $250,000 and $500,000 caps
- The home has to be your main home
- Owned and used for 2 of the last 5 years
- The 24 months need not be in a row
- Price, selling costs, and basis
- Once during a 2-year period
- Gain above the cap is taxed
- A reduced exclusion for a forced move
- A rental or a business in the home
- Depreciation is not excluded
- Divorce, death, and service
- A home you inherit
- This exclusion is not a 1031 exchange
- How the sale is reported
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.
- Investment property stops here: no exclusion. A main home, or mixed use that includes the main home, continues.
- Owned for fewer than 2 of the last 5 years: full exclusion not available.
- Used as the main home for fewer than 2 of the last 5 years: full exclusion not available.
- 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.
- Month 1, shaded
- Month 2, shaded
- Month 3, shaded
- Month 4, shaded
- Month 5, shaded
- Month 6, shaded
- Month 7, shaded
- Month 8, shaded
- Month 9, shaded
- Month 10, shaded
- Month 11, shaded
- Month 12, shaded
- Month 13, open
- Month 14, open
- Month 15, open
- Month 16, open
- Month 17, open
- Month 18, open
- Month 19, open
- Month 20, open
- Month 21, open
- Month 22, open
- Month 23, open
- Month 24, open
- Month 25, open
- Month 26, open
- Month 27, open
- Month 28, open
- Month 29, open
- Month 30, open
- Month 31, open
- Month 32, open
- Month 33, open
- Month 34, open
- Month 35, open
- Month 36, open
- Month 37, shaded
- Month 38, shaded
- Month 39, shaded
- Month 40, shaded
- Month 41, shaded
- Month 42, shaded
- Month 43, shaded
- Month 44, shaded
- Month 45, shaded
- Month 46, shaded
- Month 47, shaded
- Month 48, shaded
- Month 49, open
- Month 50, open
- Month 51, open
- Month 52, open
- Month 53, open
- Month 54, open
- Month 55, open
- Month 56, open
- Month 57, open
- Month 58, open
- Month 59, open
- 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.
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.
