Tax
Capital gains tax on a home sale: how the $250,000 exclusion works
Many sellers owe no federal tax on the profit from their main home. Here is who qualifies, how to figure the gain and what happens to the part that is taxed.
By AbodePine Editorial Team Updated 7 min read
- Exclusion, single filer
- Up to $250,000 of gain
- Exclusion, joint return
- Up to $500,000 of gain
- Ownership and use
- 24 months in last 5 years
- If you get a 1099-S
- Report it even if excluded
In brief
If you sell your main home, federal law lets you exclude up to $250,000 of gain from income, or $500,000 on a joint return, when you owned and lived in the home for at least 24 months of the five years before the sale and have not used the exclusion on another home in the past two years. Gain is the price minus selling costs minus your adjusted basis, so it is not the cash you walk away with. Any gain above the limit is taxed as a capital gain.
The home sale exclusion
This section applies to the sale of your main home by an individual, as the IRS describes it on Topic No. 701 (page updated November 9, 2026). You may qualify to exclude up to $250,000 of gain from your income, or $500,000 if you file a joint return with your spouse. Both tests below must be met in the five years ending on the date of sale.
- Ownership test: you (or your spouse) owned the home for at least 24 months in that five-year window.
- Use test: you used it as your main home for at least 24 months in the same window. On a joint return, each spouse must meet the use test. The two tests can be met in different two-year stretches.
- Look-back: you generally cannot take the exclusion if you excluded gain from another home sale in the two years before this sale.
The 24 months do not have to be in a row. IRS Publication 523 says all that is required is a total of 24 months, or 730 days, of residence in the five-year period. Some situations change the count. Service members and some other officials on qualified extended duty may elect to suspend the five-year period for up to 10 years. A surviving spouse who sells within two years of the other spouse's death may be able to use the $500,000 limit if other conditions are met. If you move before 24 months because of a work-related move, a health reason or another unforeseen event, you may qualify for a reduced exclusion. For a single filer, take the shortest of your time living there, owning it or since your last exclusion, divide it by 24 months and multiply by $250,000. Living there 12 months would give 12 ÷ 24 × $250,000 = $125,000. Publication 523 has the worksheets and the list of qualifying events.
Treasury Regulation 1.121-3 gives two safe harbors, which are tests that are treated as meeting the rule. A sale counts as work-related if the change in place of employment happens while you own and use the home as your main home, and the new workplace is at least 50 miles farther from the home than the old one was (or at least 50 miles from the home if you had no former workplace). A sale counts as health-related if a physician recommends a change of residence for health reasons. The regulation also lets the taxpayer's spouse, a co-owner or a member of the household be the person whose job or health triggers the move. If your reason does not fit a safe harbor, ask a tax professional whether it still qualifies; do not assume it does not.
How to figure your gain
Gain is the amount realized minus your adjusted basis. The amount realized is the selling price minus selling expenses such as commissions, advertising, legal fees and the other costs of selling (Publication 523). Your basis starts with what you paid and the related purchase costs. IRS Topic No. 703 says to add the cost of improvements that add value; routine repairs such as painting generally do not count (Publication 523). Keep the receipts for improvements. A home you inherited or received as a gift follows different basis rules, covered in IRS Publication 551.
Here is an example with round numbers. A home bought for $300,000 gets $60,000 of improvements, so the adjusted basis is $360,000. It sells for $850,000 with $50,000 in selling expenses. These figures are examples, not averages.
| Line | Married, joint return | Single filer |
|---|---|---|
| Sale price | $850,000 | $850,000 |
| Selling expenses | −$50,000 | −$50,000 |
| Amount realized | $800,000 | $800,000 |
| Adjusted basis ($300,000 + $60,000) | −$360,000 | −$360,000 |
| Gain | $440,000 | $440,000 |
| Exclusion (limit $500,000 or $250,000) | −$440,000 | −$250,000 |
| Taxable gain | $0 | $190,000 |
Your payoff and net cash do not enter the formula; see seller closing costs and net proceeds for the cash side. A loss on the sale of your personal home is not deductible, according to the worksheet in Publication 523.
When part of the gain is taxed
Gain above the exclusion is a capital gain. If you owned the home more than one year, it is long-term, and the IRS says most net capital gain is taxed at no more than 15% for most people, with some taxed at 0% and higher incomes at 20% (Topic No. 409). The thresholds below are taxable income levels for tax year 2026 from IRS Revenue Procedure 2025-32. They apply to sales reported on 2026 returns. IRS Topic No. 409 still shows the lower 2025 levels, so use the right year.
| Filing status | 0% up to | 15% up to (20% above) |
|---|---|---|
| Single | $49,450 | $545,500 |
| Married filing jointly | $98,900 | $613,700 |
| Head of household | $66,200 | $579,600 |
Take the single filer above with $190,000 of taxable gain and $100,000 of other taxable income, an example. The $100,000 already fills the 0% band, and the total, $290,000, is below $545,500, so the gain is taxed at 15%: $190,000 × 15% = $28,500 in federal capital gains tax before any net investment income tax. Your state may tax the gain too, so check your state's revenue department.
A few things push the tax up. The net investment income tax is 3.8% on the lesser of your net investment income or the amount your modified adjusted gross income exceeds $200,000 (single or head of household), $250,000 (married filing jointly) or $125,000 (married filing separately). IRS Topic No. 559 says it does not apply to the part of a home sale gain that is excluded, but the taxable part can count. Also, you cannot exclude gain equal to depreciation you took or could have taken after May 6, 1997, for example on a home office or rental use, and gain tied to periods after 2008 when the home was not your main home may not qualify. Topic No. 409 says unrecaptured section 1250 gain is taxed at a maximum of 25%. A tax professional can work through these for your return.
Reporting the sale and keeping records
Topic No. 701 says you must report the sale if you received Form 1099-S, even if all of the gain is excludable, and also if you cannot exclude all of the gain. Reporting uses Form 8949 and Schedule D. Publication 523 lists the full conditions. If none apply, you do not need to report it.
The closing agent is generally the one who files Form 1099-S. The IRS instructions say a sale of a main home can be reportable even if the gain is excludable. They also say the form need not be filed when the sale is for $250,000 or less ($500,000 if you certify you are married) and you give the filer a signed certification that it was your principal residence, that the whole gain is excludable and that there was no nonqualified use after 2008. The filer may rely on that certification. If you are asked to sign one, read it and be sure the statements are true for you.
See a tax professional if the home was a rental or office, was inherited, was owned with someone you divorced, or if your gain exceeds the exclusion. Rules can change, so check the IRS publication for the year of your sale.
Questions people ask
Do I have to pay capital gains tax when I sell my house?
Not necessarily. If you meet the ownership and use tests, up to $250,000 of gain ($500,000 on a joint return) is excluded from federal income. Gain above that, or on a home that does not qualify, is taxed as a capital gain.
Do the 24 months have to be consecutive?
No. IRS Publication 523 says a total of 24 months (730 days) of residence within the five years before the sale is what is required.
Can I deduct a loss on my home sale?
No. The worksheet in IRS Publication 523 says you cannot deduct a loss on the sale of your main home.
Do I need to report the sale if all the gain is excluded?
You do if you received a Form 1099-S. If you did not receive one and the whole gain is excludable, Publication 523 lays out when reporting is still required, so check its list.
Sources
- IRS — Topic No. 701, Sale of your home
- IRS — Publication 523, Selling Your Home (for 2025 returns)
- IRS — Topic No. 703, Basis of assets
- IRS — Topic No. 409, Capital gains and losses
- IRS — Topic No. 559, Net investment income tax
- IRS — Revenue Procedure 2025-32 (tax year 2026 inflation adjustments)
- IRS — Instructions for Form 1099-S
- Cornell Law School Legal Information Institute — 26 CFR 1.121-3, Reduced maximum exclusion for taxpayers failing to meet certain requirements
- U.S. Government Publishing Office — 26 U.S.C. 121, Exclusion of gain from sale of principal residence (2024 edition)
This page describes federal rules for individuals selling a main home. The $850,000 price, $60,000 of improvements, $100,000 of other income and other dollar amounts are examples, not quotes or averages. Publication 523 is the 2025 edition, written for 2025 returns, and the statute text is the 2024 edition of the U.S. Code (Cornell Law School's Legal Information Institute shows the same $250,000 and $500,000 limits); check the current IRS publication for the year you sell. This page is general information, not tax advice. Facts on this page were checked against these sources on November 20, 2026.
Next to read
-
Selling guide
Seller closing costs and net proceeds
What comes out of your sale price at closing, with a worked example of the cash you keep.
-
Selling guide
Selling and buying at the same time
Sell first, buy first or overlap: how to line up the money, the lender and the closing dates.
-
Owning guide
Homeowner tax deductions
What you can and cannot deduct, and when itemizing beats the standard deduction.