Key takeaways
- You can exclude up to $250,000 of gain on selling your main home, or $500,000 on a joint return, if you owned it and lived in it for at least 24 months of the 5 years before the sale.
- The gain is the selling price minus selling costs minus what you paid for the home and the improvements you made, not the sale price.
- Gain above the exclusion is taxed as a long-term capital gain (0%, 15%, 20%), and can add the 3.8% net investment income tax and state tax.
- You can use the full exclusion once every 2 years. A Form 1099-S from the closing means you report the sale even if none of it is taxable.
On this page
The profit on selling your main home can be tax-free. If you owned and lived in the home for at least 24 months of the 5 years before the sale, you can exclude up to $250,000 of gain from income, or $500,000 if you are married and file jointly. Only gain above that is taxed, at the long-term capital gain rates.
Who qualifies for the exclusion?
You need to pass two tests during the 5 years ending on the date of sale:
- Ownership: you owned the home for at least 24 months.
- Use: you lived in it as your main home for at least 24 months. The months do not have to be in a row, and the two tests can be met in different periods.
For the $500,000 exclusion on a joint return, either spouse can meet the ownership test, but both spouses must meet the use test. You also cannot have excluded gain on another home sold in the 2 years before this sale. Members of the Uniformed Services, the Foreign Service and the intelligence community on qualified extended duty can suspend the 5-year period for up to 10 years.
If you fall short because you moved for work, for health reasons or because of certain unforeseen events, you may still get a partial exclusion. IRS Publication 523 explains how it is figured.
How to figure the gain
The gain is not the sale price. Publication 523 builds it in three steps:
| Selling price | $700,000 |
|---|---|
| Minus selling expenses (agent commission, legal and advertising fees) | −$40,000 |
| Minus purchase price, with closing costs you can add to basis | −$300,000 |
| Minus improvements (an addition, a new roof, central air) | −$50,000 |
| Gain | $310,000 |
Illustration. Repairs that only keep the home in good condition are not improvements. Source: IRS Publication 523, Worksheet 2.
Each improvement raises your basis and lowers the gain, so keep the receipts. The IRS suggests keeping basis records until 3 years after the due date of the return for the year you sell.
How much tax is due on the example
- Single filer, $90,000 of other income: $250,000 is excluded and $60,000 is taxable, for $9,000 of federal tax.
- Married couple filing jointly, $150,000 of other income: the whole $310,000 fits in the $500,000 exclusion, so the tax is $0.
- The same single filer without the exclusion (for example, a home they never lived in): $46,500 of income tax plus $7,600 of net investment income tax, $54,100 in all.
All three are in Texas, which has no income tax. Most states tax the taxable part of the gain as ordinary income.
Tax on larger gains
Gain above the exclusion is taxed at 0%, 15%, 20% depending on your income, the long-term capital gain rates. The 3.8% net investment income tax applies to the taxable part once modified AGI passes $200,000 ($250,000 married filing jointly). For a married couple with $150,000 of other income:
| Gain | Taxable after exclusion | Income tax | NIIT | Federal total |
|---|---|---|---|---|
| $300,000 | $0 | $0 | $0 | $0 |
| $500,000 | $0 | $0 | $0 | $0 |
| $600,000 | $100,000 | $15,000 | $0 | $15,000 |
| $800,000 | $300,000 | $45,000 | $7,600 | $52,600 |
| $1,000,000 | $500,000 | $75,205 | $15,200 | $90,405 |
Standard deduction, no other gains or losses. Computed with the capital gains tax calculator.
The same couple in California with an $800,000 gain would also pay about $27,811 of California tax on the $300,000 that is not excluded.
Reporting the sale
If the closing agent gives you Form 1099-S, Proceeds From Real Estate Transactions, you must report the sale on Form 8949 and Schedule D, even when all of the gain is excluded. You also report it whenever part of the gain is taxable. If you received no 1099-S and the whole gain is excluded, you generally have nothing to report.
Sources
- IRS: Topic no. 701, Sale of your home (official)
- IRS: Publication 523, Selling Your Home (official)
- IRS: Topic no. 559, Net investment income tax (official)
Figures come from the data files behind our calculators and update with them. See our methodology and editorial policy. This article is general information, not tax advice.
Frequently asked questions
Do I pay capital gains tax when I sell my house?
Only on gain above the exclusion: $250,000 for single filers and $500,000 for married couples filing jointly, if you owned and lived in the home 2 of the last 5 years. A gain below the exclusion owes no federal income tax.
How do I calculate the gain on my home?
Start with the selling price, subtract selling expenses such as agent commissions, then subtract your adjusted basis: what you paid for the home, certain closing costs from the purchase, and the cost of improvements like a new roof, an addition or central air. IRS Publication 523 has the worksheet.
Do both spouses have to own the home for the $500,000 exclusion?
No. On a joint return either spouse can meet the ownership test, but both must meet the use test: each must have lived in the home for 24 months of the 5 years before the sale.
Do I have to report a home sale with no taxable gain?
Yes if you received Form 1099-S, Proceeds From Real Estate Transactions; you report it on Form 8949 and Schedule D even though the gain is excluded. Without a 1099-S and with all of the gain excluded, you generally do not report it.
What if I lived in the home less than 2 years?
You may still get a partial exclusion if you moved because of work, health or certain unforeseen events. Publication 523 explains who qualifies and how the smaller exclusion is figured.
Run your own numbers
- Capital gains tax calculator
Tax on selling stocks, crypto, property or a home, and on dividends: 0/15/20% long-term and qualified dividend rates, short-term rates, 3.8% NIIT, state tax and the main home exclusion.
- Income tax calculator
Federal and state income tax owed for 2026.
- Property tax calculator
Yearly and monthly property tax on a home in any state from its value and the state's effective rate (US Census Bureau data), with every state ranked from the lowest to the highest rate.