Home sale capital gains calculator (US federal, 2027)
This page is for United States, federal rules (IRS); state taxes are not covered
Type what you sold the home for and what it cost you. You get the gain, how much of it the home sale exclusion covers, what is left to tax and the federal tax on it, slice by slice.
Gain is the sale price, minus selling costs, minus your adjusted basis (what you paid plus improvements, minus depreciation). If you owned and lived in the home at least 24 of the last 60 months, the first $250,000 of gain ($500,000 on a joint return) is excluded, except gain equal to depreciation. The rest is taxed as a long-term gain.
| Step | Amount |
|---|
How it works: gain is the sale price minus selling costs, minus your adjusted basis (what you paid plus improvements, minus depreciation). If you owned and lived in the home 24 of the last 60 months, up to $250,000 of gain ($500,000 on a joint return) is excluded, except gain equal to depreciation. What is left is taxed as a long-term gain, using the IRS Schedule D Tax Worksheet. Depreciation gain is taxed at a top rate of 25%. Type your own limit in the last box for a reduced exclusion or a surviving spouse.
The formula
- Amount realized = sale price − selling costs
- Adjusted basis = what you paid + improvements − depreciation
- Gain = amount realized − adjusted basis
- Excluded = the smaller of the limit and (gain − depreciation gain)
- Taxable gain = gain − excluded; tax = Schedule D Tax Worksheet on that gain
- Limit
- $250,000, or $500,000 on a joint return, if the ownership, use and look-back tests are met
- Depreciation gain
- gain up to the depreciation allowed or allowable; it cannot be excluded and is taxed at a top rate of 25%
- Schedule D Tax Worksheet
- the IRS worksheet that stacks the gain on top of your other taxable income and taxes it at 0%, 15%, 20% and 25%
Worked example (our numbers, single filer, tax year 2027)
- Sale price $700,000, selling costs $42,000, so the amount realized is $658,000. Paid $300,000, improvements $40,000, no depreciation: adjusted basis $340,000.
- Gain is $658,000 − $340,000 = $318,000. Owned and lived in it 60 months, so the $250,000 single limit applies. Taxable gain: $68,000.
- With $80,000 of other taxable income, the gain sits on top: stack $148,000. The 0% zone ends at $51,050, so none of the gain is at 0%. 15% covers all $68,000, a tax of $10,200.
Federal tax on the sale: $10,200. A hypothetical, not your result.
What this assumes
- Tax year 2027. Ordinary rates and the 0% and 15% thresholds come from IRS Rev. Proc. 2026-35. The ownership, use, exclusion and depreciation rules are quoted from IRS Publication 523 (2025 edition) and Topic 701.
- The tax follows the IRS Schedule D Tax Worksheet, with this sale as your only capital gain: no qualified dividends, no 28% gain, no Form 4952. The IRS prints the 2025 worksheet; the 2027 thresholds here are our reading of how it carries forward.
- Depreciation is treated as straight-line depreciation on the building, so the gain it explains is unrecaptured section 1250 gain, taxed at up to 25%. Gain from periods of nonqualified use (after 2008) is not figured.
- On a joint return the tool assumes both spouses lived in the home the months you type. A reduced exclusion, or a surviving spouse's $500,000, is not figured: type the amount in the last box.
- Owned 12 months or less: the gain is short-term and taxed at ordinary rates, unless you inherited it (the IRS treats inherited property as long-term). The 3.8% net investment income tax and state taxes are not included. Federal only.
Questions
How much of my home sale gain is tax free?
Up to $250,000, or $500,000 on a joint return, if you owned and lived in the home at least 24 of the last 60 months and did not use the exclusion on another home in the last 2 years. See capital gains tax on the sale of a home.
Does depreciation change the tax?
Yes. The IRS says you cannot exclude the part of the gain equal to depreciation allowed or allowable. See capital gains on rental property.
What if I inherited the home?
Your basis is generally the fair market value on the date of death, not what the owner paid. See capital gains on inherited property.
Which thresholds does it use?
The 2027 figures on the capital gains tax brackets page.
Reminder: this page is for United States, federal rules (IRS); state taxes are not covered
Follow along