Selling Your Home: Capital Gains Tax
When you sell your main home for more than you paid, the profit can be taxable, but the IRS lets many sellers exclude a large part or all of it. The exclusion has ownership and use tests, and your gain is calculated after subtracting your purchase price, improvements and selling costs. This guide explains how to compute the gain, who qualifies and what to report.
- You can exclude up to $250,000 of gain on the sale of your main home ($500,000 if married filing jointly) if you owned and lived in it for at least two of the five years before the sale.
- Gain = selling price minus selling costs minus your adjusted basis. Basis starts with the purchase price plus certain closing costs, and increases with capital improvements.
- Gain above the exclusion is generally taxed as a long-term capital gain if you owned the home for more than a year.
- A partial exclusion may be available if you move early for work, health or certain unforeseen events.
In this article
The exclusion
Under Internal Revenue Code Section 121, if you meet the tests, you can exclude gain on the sale of your main home. The amounts are $250,000 for single filers and $500,000 for married couples filing jointly.
The tests:
- Ownership test: you owned the home for at least two years (24 months) out of the five years before the sale.
- Use test: you lived in it as your main home for at least two years out of the same five years. The two years need not be consecutive.
- Look-back: you haven't excluded gain on another home sale in the two years before this sale.
For a joint exclusion of $500,000, either spouse must meet the ownership test, and both must meet the use test. Special rules exist for military and other government service, for people who become unable to care for themselves, and for surviving spouses.
How to compute the gain
| Step | Item |
|---|---|
| 1 | Selling price |
| 2 | Minus selling expenses (agent commissions, title, transfer taxes, legal fees) |
| 3 | = Amount realized |
| 4 | Minus adjusted basis |
| 5 | = Gain or loss |
Adjusted basis = purchase price + certain buying costs (for example title fees and recording fees, but not loan costs or insurance) + capital improvements − any depreciation claimed (such as for a home office or rental use).
Capital improvements add value, extend life or adapt the home to new uses: a new roof, an addition, a new kitchen, a deck, central air. Repairs and maintenance, such as painting or fixing a leak, are not improvements. Keep receipts. See IRS Publication 523.
Worked example
You bought a home for $380,000 and paid $8,000 in eligible closing costs. You spent $45,000 on a kitchen remodel and a new roof. You sell for $720,000 and pay $43,200 (6 percent) in selling costs.
| Item | Amount |
|---|---|
| Selling price | $720,000 |
| Selling costs | $43,200 |
| Amount realized | $676,800 |
| Adjusted basis ($380,000 + $8,000 + $45,000) | $433,000 |
| Gain | $243,800 |
| Taxable if single (gain minus $250,000) | $0 |
| Taxable if married filing jointly (gain minus $500,000) | $0 |
If the single seller's taxable amount is above zero, it's taxed as a long-term capital gain at a rate of 0, 15 or 20 percent depending on taxable income, and possibly a 3.8 percent net investment income tax at high incomes. The 2026 0 percent bracket for singles ends at $49,450 of taxable income and the 15 percent bracket at $545,500. Use the capital gains tax calculator and read capital gains tax guide for the rates. Numbers here are illustrative.
Partial exclusion
If you don't meet the two-year tests but sell because of a change in employment, health or certain unforeseen circumstances, you may qualify for a reduced exclusion. The reduced amount is generally based on the share of the two years you met the tests. For example, living in the home for 12 months out of 24 may allow about half of the full exclusion. The IRS lists safe harbors, and other situations are judged on facts. See IRS Publication 523.
Other situations
- Home used partly for business or as a rental: gain attributable to depreciation after May 6, 1997 isn't excludable and is taxed at up to 25 percent. A home office that you used as part of your home may also need an allocation if it was a separate structure.
- Inherited homes: the basis generally steps up to the market value at the date of death, which often eliminates most gain. See IRS rules for inherited property.
- Divorce: transfers between spouses or former spouses incident to divorce are generally not taxable, and rules for the use test can help the spouse who moves out.
- Selling at a loss: a loss on a personal residence isn't deductible.
- Short-term: if you owned the home for one year or less, any taxable gain is taxed at ordinary rates. See long-term vs short-term capital gains.
Reporting the sale
- You receive Form 1099-S from the settlement agent if the sale must be reported. If your gain is fully excludable, you may be able to certify that and avoid the 1099-S.
- If the gain is fully excluded and you did not receive a Form 1099-S, you generally do not report the sale on your return.
- If part of the gain is taxable, or you received a Form 1099-S, report it on Form 8949 and Schedule D.
Planning before you sell
- Check the two-of-five dates. Waiting a few weeks may secure the exclusion.
- Gather records for purchase, improvements and sale costs.
- Estimate gain with the steps above.
- Consider timing if you're close to the thresholds, and how the sale fits with other income.
- Ask a tax professional for large gains or complicated facts.
Common mistakes
- Forgetting improvements that raise basis.
- Counting repairs as improvements.
- Ignoring selling costs.
- Assuming the exclusion applies to a second home or rental.
- Missing the two-year tests by days.
- Not keeping records for years after the sale.
Frequently asked questions
Do I pay tax when I sell my house?
Not on gain up to the exclusion if you meet the tests. Gain above it may be taxed.
Can I use the exclusion more than once?
Yes, as long as you haven't used it in the previous two years and meet the tests each time.
What if I lived in the house for less than two years?
You might qualify for a partial exclusion for work, health or unforeseen circumstances. Otherwise gain is taxable.
Is the sale proceeds tax-free if I buy another home?
No. The old rule allowing deferral was repealed. The exclusion is what protects the gain.
Do I report the sale if the gain is excludable?
Often not, unless you got a Form 1099-S or part of the gain is taxable.
Sources
Disclaimer: This page is for educational purposes only and is not financial, tax or legal advice. Figures are estimates based on the assumptions shown. See our full disclaimer and editorial policy.