Do you owe tax when you sell a home you've lived in for years?
Updated October 15, 2026. General information, not financial, tax or legal advice.
General information, not tax advice. Tax rules change, and your situation is your own, so check with a tax professional before you sell. The IRS explains all of this in Publication 523, Selling Your Home.
The home sale exclusion
When you sell your main home, federal tax law lets you keep a large part of the profit tax-free. To qualify, you generally need to have:
- Owned the home for at least two of the five years before the sale,
- Lived in it as your main home for at least two of those five years, and
- Not used the exclusion on another home sale in the two years before.
If you qualify, you can exclude up to $250,000 of gain, or up to $500,000 if you're married and file a joint return. There are partial exclusions for some people who have to move sooner for health, work or other unforeseen reasons.
How the gain is figured
Your gain isn't the sale price minus what you paid. It's closer to this:
- Start with the sale price.
- Subtract your selling costs: agent commissions, title and closing costs you pay.
- Subtract your cost basis: what you paid for the home, plus certain purchase costs, plus the lasting improvements you made over the years.
Here's a made-up example. You bought in 1994 for $140,000. Over the years you added a kitchen, a new roof and a sunroom, which together cost $60,000, so your basis is about $200,000. You sell today for $620,000 and pay $40,000 in selling costs. Your gain is $380,000. If you file single, $250,000 of it is excluded and $130,000 may be taxable. If you're married filing jointly, all of it may be excluded.
Why old receipts matter
Every dollar of lasting improvements you can document raises your basis and lowers your gain. That means a new roof, windows, an addition, a remodeled kitchen or bath, a new furnace or central air, a fence, a driveway. Repairs and upkeep, like painting or fixing a leak, usually don't count. Dig out the receipts, contracts and permits now, while you're going through the files anyway.
A few situations to ask about
- If your spouse has passed away. A surviving spouse can often still use the larger exclusion if the home is sold within two years of the death and other conditions are met. Ask a tax pro.
- If you rented the home out or used part of it for business, the rules get more detailed.
- If you're thinking about keeping the home for your heirs instead, inherited homes are generally valued for tax purposes as of the date of death. That can change the math a lot. Talk it through with a tax pro and an estate attorney.
- State income tax. Many states follow the federal rules, but not all. Check yours.
Common questions
How much profit can I make on my home without paying taxes?
If you qualify, up to $250,000 of gain can be excluded from federal income tax, or up to $500,000 if you're married and file jointly. IRS Publication 523 has the full rules.
Do home improvements reduce capital gains tax when I sell?
Lasting improvements add to your cost basis, which lowers your taxable gain. Regular repairs and upkeep usually don't. Keep the receipts.
Do I have to buy another home to avoid the tax?
No. That was an older rule. Today the exclusion doesn't depend on buying a new home.
Put it on your list
The 12-month countdown reminds you to talk with a tax pro before you list, not after you sell.
Open my countdownNot sure where to start? Take the stay-or-go check. A few taps, results right away.