Selling your home: how much of the gain is tax-free?
Most people who sell the home they live in owe no tax on the profit. The tax code excludes up to $250,000 of gain for a single owner and $500,000 for a married couple filing jointly. The questions are whether you qualify, how big your gain really is, and what happens if you rented the place out first, which is where many people get caught.
1. Who qualifies
In the five years before the sale, you must have:
- owned the home for at least two years, and
- lived in it as your main home for at least two years. The two years don't have to be in a row or the same two years as ownership.
You can use the exclusion once every two years. For the $500,000 married amount, either spouse can meet the ownership test, but both must meet the two-year use test and neither can have used the exclusion in the past two years. Otherwise the limit is $250,000 each for the spouses who qualify.
A partial exclusion applies if you sell early because of a job move of more than 50 miles, health, or certain unforeseen events.
2. Working out the gain
Gain = sale price − selling costs − adjusted basis. The basis is what you paid, plus purchase closing costs, plus improvements (a new roof, an addition, a remodeled kitchen, but not repairs and upkeep). Keep the receipts: they're the evidence if you're ever asked.
A couple who paid $300,000, spent $20,000 on improvements, and sells for $450,000 with 7% in commission and closing costs ($31,500) has a gain of $98,500. It's all excluded; no tax.
3. When the gain is more than the exclusion
In places where prices have risen a lot, gains can pass the limit. The excess is a long-term capital gain:
| Single, $900,000 sale | Married, $1.2 million sale | |
|---|---|---|
| Basis | $400,000 | $450,000 |
| Gain after 7% selling costs | $437,000 | $666,000 |
| Excluded | $250,000 | $500,000 |
| Taxable | $187,000 | $166,000 |
| Federal capital gains tax | $28,050 | $24,900 |
| 3.8% net investment income tax | $4,826 | $2,128 |
| State tax at 5% | $9,350 | $8,300 |
| Total | $42,226 | $35,328 |
Both earn $140,000 a year. The excluded part of the gain never counts toward the 3.8% tax; only the taxable part above the income threshold does. The $250,000 and $500,000 limits were set in 1997 and aren't indexed for inflation.
4. If you rent it out before selling
Moving out and renting the home doesn't end the exclusion at once. Because you need two of the last five years, you have three years after moving out to sell and still qualify. Two catches:
- Depreciation is taxed anyway. As a landlord you deduct depreciation each year, and that part of the gain can't be excluded. It's taxed at your ordinary rate, at most 25%.
- Miss the window and the whole gain is taxable.
For the couple above, renting the home at 3% yearly price growth:
| Sell after 2 years of renting | Sell after 4 years | |
|---|---|---|
| Gain | $142,605 | $188,262 |
| Depreciation taken | $18,618 | $37,236 |
| Exclusion | Applies to the rest | Lost: outside the 3-year window |
| Tax | $5,027 | $43,233 |
Depreciation is "allowed or allowable": it's taxed at sale whether or not you claimed it, so claim it. The rule that time rented before you move in can shrink the exclusion ("nonqualified use") doesn't apply to time rented after you move out.
5. What doesn't help
- A loss on selling your own home isn't deductible.
- Buying another home no longer defers tax on the gain; that rule ended in 1997. (A 1031 exchange applies only to investment property.)
What this leaves out
Special rules cover military and foreign service moves (the five years can be extended up to ten), a home received in a divorce, a surviving spouse (the $500,000 limit for two years after a death), and inherited homes, whose basis usually steps up to their value at death. IRS Publication 523 has the details.
Try it with your numbers
The Sell or Rent Calculator opens with the couple's $450,000 home. Enter your home's value, your basis, the mortgage balance, when you'll move out and how long you lived there. It works out the tax if you sell now, the date your exclusion window closes, and what renting it out and selling later would leave you after tax. Our guide to selling or renting out your old home covers the decision. It runs in your browser and we don't store your numbers.
More guides for this tool
Run your own numbers
Sell or Rent Out Your Old Home
Sell now or rent it out? The 3-year tax clock, recapture and cash flow, after tax.
Open the tool →