Capital Gains on the Sale of Your Home: the $250,000 / $500,000 Exclusion and the Tax on the Rest
When you sell your main home, up to $250,000 of the gain is tax-free, or $500,000 for a married couple filing jointly, if you owned the home and lived in it as your main home for at least two of the five years before the sale and have not excluded the gain on another home in the two years before (26 U.S.C. §121; IRS Publication 523, Selling Your Home). The gain above that is a capital gain, taxed at 0%, 15% or 20% if you owned the home more than a year, plus the 3.8% net investment income tax at higher incomes (26 U.S.C. §1411). A married couple with $120,000 of wages who sell with a $650,000 gain owe $21,595 of 2026 federal tax on the $150,000 above the exclusion.
The section 121 exclusion on the sale of your main home, the ownership and use tests, the partial exclusion, how to work out the gain, and a calculator of the 2026 federal tax on what is left.
Official rules The rates, brackets and limits are the published ones, each linked to its source; every tax amount on this page is computed from them by QuantCalc’s federal tax engine.
| Household (standard deduction) | Gain | Excluded | Taxable gain | Federal tax |
|---|---|---|---|---|
| Single, $70,000 of wages | $200,000 | $250,000 | $0 | $0 |
| Single, $70,000 of wages | $350,000 | $250,000 | $100,000 | $15,000 |
| Married filing jointly, $120,000 of wages | $650,000 | $500,000 | $150,000 | $21,595 |
| Married filing jointly, both 66, $60,000 of pensions | $800,000 | $500,000 | $300,000 | $39,220 |
| Single, $70,000 of wages, sold after 12 months for a new job | $200,000 | $125,000 | $75,000 | $11,250 |
In the married couple’s row $760 of the tax is the net investment income tax, on the part of the taxable gain that lifts modified AGI over $250,000 ($200,000 single); the excluded gain counts for neither the tax nor the NIIT (26 U.S.C. §1411). The retired couple pays $39,220 on $300,000.
The ownership and use tests
- Ownership: you owned the home for at least 24 months (730 days) in the five years ending on the date of sale.
- Use: you lived in it as your main home for at least 24 months in those five years. The months need not be in a row, and need not be the same months as the ownership test (26 U.S.C. §121; IRS Publication 523, Selling Your Home).
- Nonqualified use: even when you pass both tests, the exclusion does not cover the share of the gain for periods after 2008 when the home was not your main home, such as years as a rental or second home before you moved in. That share is those periods over the whole time you owned it; time after you move out, within the five years before the sale, does not count (26 U.S.C. §121(b)(5); IRS Publication 523, Selling Your Home).
- Once every two years: you did not exclude the gain on another home sold in the two years before this sale (26 U.S.C. §121).
- Married couples: the $500,000 applies on a joint return if either spouse meets the ownership test, both meet the use test and neither excluded a gain in the two years before; otherwise each spouse figures his or her own exclusion, up to $250,000. A surviving spouse who sells within two years of the death and has not remarried can still exclude up to $500,000 (26 U.S.C. §121; IRS Publication 523, Selling Your Home).
The partial exclusion
If you fail the tests because you sold for a change of place of employment, for health, or for unforeseen circumstances, you can still exclude part: the full amount times the months you owned and lived in the home (or, if shorter, the months since your last excluded sale) divided by 24. The last row of the table above: a single owner who moves for a new job after 12 months excludes $125,000 of a $200,000 gain and pays $11,250 on the rest (26 U.S.C. §121; IRS Publication 523, Selling Your Home).
Working out the gain
The gain is the selling price less selling costs (commissions, legal and title fees) less your adjusted basis: what you paid, plus closing costs you paid when you bought, plus the cost of improvements, less any depreciation you claimed for a home office or a rental period (IRS Publication 523, Selling Your Home). A loss on the sale of your home is not deductible (IRS Topic No. 701, Sale of your home). Depreciation claimed after May 6, 1997 cannot be excluded: that part of the gain is taxed as unrecaptured section 1250 gain, at up to 25% (26 U.S.C. §1(h)(1)(E); IRS Publication 523, Selling Your Home). More on basis: cost basis →
Home sale capital gains calculator, 2026
The exclusion is $250,000, or $500,000 married filing jointly (both spouses lived there), after 24 months of ownership and use; fewer months count only with a qualifying reason, as months / 24. The tax engine works out your 2026 federal return with the taxable gain and without it (long-term rates and the NIIT; short-term if owned a year or less); the other income is counted as wages. Not modelled: depreciation from a home office or rental, nonqualified use (years as a rental or second home before it became your main home, §121(b)(5)), an exclusion used on another home in the last two years, state tax. With 13 or more months entered you owned the home more than a year, so the gain is long-term whatever the box says. Age counts only at 65, through the extra standard deduction and the senior deduction. Amounts up to $10,000,000.
See how long your savings last with your own numbers: free, 3 runs a day, no account.
Run my plan → Personal PRO, $49 once: what’s included. Paid via Creem, our payment provider. Key by email.A home sale is one of the largest gains most retirees ever take, and the year it lands in matters. QuantCalc runs your whole retirement — Social Security, withdrawals, taxes, Medicare surcharges — year by year.
Run the free tax-aware simulation →Common questions
How much capital gain on a home sale is tax-free?
Up to $250,000, or $500,000 for a married couple filing jointly, on the sale of your main home if you owned and lived in it for two of the five years before the sale (26 U.S.C. §121; IRS Publication 523, Selling Your Home).
What is the 2-out-of-5-year rule?
You must have owned the home for at least 24 months and lived in it as your main home for at least 24 months during the five years ending on the date of sale; the two periods need not be the same months (26 U.S.C. §121; IRS Publication 523, Selling Your Home).
Can I get a partial exclusion if I sell before two years?
Yes, if the main reason was a change of job location, health or unforeseen circumstances: the exclusion is prorated by the months you qualified out of 24. Twelve months gives half, $125,000 single (26 U.S.C. §121; IRS Publication 523, Selling Your Home).
How is the gain above the exclusion taxed?
As a long-term capital gain at 0%, 15% or 20% if you owned the home more than a year, as ordinary income if not, plus the 3.8% net investment income tax once modified AGI passes $200,000 ($250,000 joint) (26 U.S.C. §1411; IRS Publication 523, Selling Your Home).
Do I have to report the sale of my home?
Only if you have a gain you cannot exclude, or you received a Form 1099-S; then it goes on Form 8949 and Schedule D (IRS Publication 523, Selling Your Home).
What about a widow or widower selling the home?
A surviving spouse who has not remarried can exclude up to $500,000 on a sale within two years of the spouse’s death, if the tests were met just before the death (26 U.S.C. §121).
Sources
- 26 U.S.C. §121
- IRS Publication 523, Selling Your Home
- IRS Topic No. 701, Sale of your home
- 26 U.S.C. §1411
- 26 U.S.C. §1(h)
Every figure on this page is read at build time from one dataset and was checked against the text of the documents above on December 2, 2026. Every figure with its source: JSON. QuantCalc is calculation software, not tax, legal or benefits advice.
Related
Capital gains tax rate 2026 (long-term) → Short-term capital gains tax → Cost basis calculator → Net investment income tax calculator → 1031 exchange rules and the tax it defers → 2028 IRMAA brackets: a 2026 sale sets the 2028 premium → Qualifying surviving spouse → Homestead exemption by state →