2026 federal numbers this tool uses
- Home sale exclusion
- $250,000 / $500,000
- Single / married filing jointly (IRS Pub 523)
- Ownership and use tests
- 24 of the last 60 months
- Each test, in the 5 years before the sale
- 0% rate up to (taxable income)
- $49,450 / $98,900
- Single / joint, Rev. Proc. 2025-32
- 15% rate up to
- $545,500 / $613,700
- Single / joint; 20% above
- Depreciation recapture
- 25% max rate
- Unrecaptured section 1250 gain (Topic 409)
- Net investment income tax
- 3.8%
- MAGI over $200,000 single / $250,000 joint (Topic 559)
How the calculation works
The tool follows the order of IRS Publication 523:
- Amount realized = sale price minus selling expenses such as commissions, advertising and legal fees.
- Adjusted basis = purchase price plus certain closing costs (legal, recording and survey fees, transfer taxes, owner's title insurance) plus capital improvements, minus any depreciation you claimed. Loan points, mortgage fees and routine repairs do not count.
- Gain = amount realized minus adjusted basis. A loss on your main home is not deductible.
- Set aside what can't be excluded. Depreciation claimed after May 6, 1997 is taxed as unrecaptured section 1250 gain at up to 25%. Gain tied to nonqualified use (periods after 2008 when the home was not your main home) is also taxable. The tool allocates it by months: remaining gain × nonqualified months ÷ months owned.
- Apply the exclusion. Up to $250,000, or $500,000 on a joint return, if you owned and lived in the home at least 24 months of the 5 years before the sale and did not exclude gain on another home in the prior 2 years.
- Tax the rest. The taxable gain is stacked on top of your other taxable income. Depreciation gain uses ordinary rates capped at 25%. The rest uses the 0%, 15% and 20% long-term rates. The 3.8% net investment income tax applies to the lesser of your taxable gain or the amount your MAGI exceeds the threshold. Excluded gain is not subject to it.
Worked example
A single filer bought a house for $420,000, paid $8,000 in qualifying closing costs and spent $65,000 on a new kitchen and roof. Eight years later she sells for $950,000 and pays $57,000 in selling expenses. Her other taxable income is $120,000 and her MAGI is $130,000.
| Step | Amount |
|---|---|
| Amount realized ($950,000 − $57,000) | $893,000 |
| Adjusted basis ($420,000 + $8,000 + $65,000) | $493,000 |
| Gain | $400,000 |
| Exclusion (meets both tests) | −$250,000 |
| Taxable long-term gain | $150,000 |
| 15% capital gains tax (income is above $49,450) | $22,500 |
| NIIT: 3.8% × ($280,000 MAGI − $200,000) | $3,040 |
| Estimated federal tax | $25,540 |
If she were married and filing jointly, and both spouses met the use test, the $500,000 limit would cover the whole $400,000 gain and she would owe no federal tax on the sale. That is the single biggest lever: check whether both spouses meet the use test.
Partial exclusion
If you fail the tests, you may still get a reduced exclusion when the main reason for the sale was a change in workplace location, a health issue or an unforeseeable event. Pub 523 takes the shortest of your time living there, your time owning it, and the time since your last excluded sale, then divides by 24 months. Selling for a new job after 12 months of living there gives 12 ÷ 24 = 50% of the limit, or $125,000 for a single filer.
Edge cases this tool simplifies
- On a joint return the $500,000 limit needs both spouses to meet the use test. If only one does, the limits differ; see Pub 523.
- Homes acquired in a 1031 exchange within the past 5 years do not qualify for the exclusion.
- Uniformed Services, Foreign Service, intelligence community and Peace Corps personnel on qualified official extended duty can suspend the 5-year test for up to 10 years.
- State tax is a flat rate on the taxable gain. Your state may treat the sale differently.
What to do next
See how much cash you keep with the home sale proceeds calculator. Renting it out before selling? Compare options with the rent out or sell calculator and the depreciation recapture calculator. For the rules in plain English, read capital gains tax when you sell your home. Selling in New York City? The NYC home sale tax calculator adds state and city tax.