# My home sale capital gains tax?

Estimates the 2026 federal capital gains tax on selling your home: the gain after selling costs and improvements, the $250,000 or $500,000 exclusion (or a partial one), and the tax on the rest.

- Page: https://www.acalculator.org/finance/home-sale-capital-gains-tax-calculator
- JSON spec: https://www.acalculator.org/finance/home-sale-capital-gains-tax-calculator.json
- Version: 3c1339745c25

## Default answer

Example with the default inputs (Sale price $900,000.00, Selling costs (optional) $54,000.00, Purchase price and buying costs $400,000.00, Improvements (optional) $60,000.00, Filing status Single, Owned and lived in it 2 of the last 5 years? Yes, Other income $85,000.00): Selling for $900,000.00 with a $386,000.00 gain, you exclude $250,000.00 and owe $21,198.00 of 2026 federal tax.

## Inputs

| Key | Label | Description |
| --- | --- | --- |
| price | Sale price | What the buyer paid for the home. |
| costs | Selling costs (optional) | Real estate commissions, title, legal and other closing costs you paid to sell. |
| basis | Purchase price and buying costs | What you paid for the home plus closing costs you paid to buy it (your basis). |
| improve | Improvements (optional) | Additions and improvements that add value or life, such as a new roof or kitchen; not repairs. |
| status | Filing status | Your 2026 filing status; married filing jointly can exclude up to $500,000. |
| test | Owned and lived in it 2 of the last 5 years? | Yes: the full exclusion. Moved early for a job, health or an unforeseen event: a partial exclusion. No: none. |
| months | Months that count | The shortest of: months you owned it, months you lived in it in the last 5 years, months since you last used the exclusion. |
| held | Owned it for | More than 1 year makes the gain long-term (0%, 15% or 20%); 1 year or less is taxed as ordinary income. |
| income | Other income | Your other 2026 income before deductions, such as wages; the gain stacks on top of it. |

## Outputs

| Key | Label | Description |
| --- | --- | --- |
| tax | Federal tax on the sale | Federal tax with the taxable gain minus the tax without it. |
| gain | Gain on the sale | (Sale price − selling costs) − (purchase price and buying costs + improvements); below $0 is a loss. |
| exclusion | Gain you exclude | The smaller of the gain and your maximum exclusion. |
| maxExclusion | Maximum exclusion | $250,000 ($500,000 married filing jointly), × months ÷ 24 for a partial exclusion, $0 with none. |
| taxable | Taxable gain | Gain − the excluded gain, not below $0. |
| niit | Net investment income tax part | The 3.8% net investment income tax the taxable gain adds. |
| rate | Rate on the taxable gain | Tax on the sale ÷ taxable gain × 100. |
| afterTax | Gain after tax | Gain − the tax on the sale. |

## Method

Gain = (sale price − selling costs) − (purchase price and buying costs + improvements). Maximum exclusion = $250,000 ($500,000 married filing jointly); × months ÷ 24 for a partial exclusion; $0 with none. Taxable gain = gain − the smaller of the gain and the maximum exclusion. Tax = 2026 Form 1040 tax with the taxable gain (long-term, or short-term when owned 1 year or less) − tax without it, both with the standard deduction.

## Assumptions

- Tax year 2026, federal tax only, your main home. Married filing jointly assumes both spouses lived in the home 2 of the last 5 years and neither excluded gain on another home in the last 2 years; other statuses use $250,000.
- Other income is ordinary income such as wages, with the standard deduction and no credits. Every amount is at most $1 trillion.
- Not included: depreciation claimed for a home office or rental use after May 6, 1997 (taxed up to 25% and never excluded), time the home was not your main home after 2008, the surviving spouse and military rules, and state tax. An estimate, not tax advice.

## Worked examples

1. price = $900,000.00, costs = $54,000.00, basis = $400,000.00, improve = $60,000.00, status = single, test = full, income = $85,000.00 gives gain = $386,000.00, exclusion = $250,000.00, taxable = $136,000.00, tax = $21,198.00, niit = $798.00, afterTax = $364,802.00. Source: IRS Publication 523 (2025), Selling Your Home: gain or loss, the $250,000 and $500,000 exclusion, the eligibility test, and the partial exclusion (months ÷ 24), https://www.irs.gov/publications/p523; tax with the gain − tax without it on the 2026 Form 1040 (Qualified Dividends and Capital Gain Tax Worksheet with IRS Rev. Proc. 2025-32 breakpoints; Form 8960).
2. price = $1,200,000.00, costs = $70,000.00, basis = $500,000.00, improve = $100,000.00, status = mfj, test = full, income = $150,000.00 gives gain = $530,000.00, exclusion = $500,000.00, taxable = $30,000.00, tax = $4,500.00, niit = $0.00. Source: IRS Publication 523 (2025), Selling Your Home: gain or loss, the $250,000 and $500,000 exclusion, the eligibility test, and the partial exclusion (months ÷ 24), https://www.irs.gov/publications/p523 ($500,000 joint); tax with the gain − tax without it on the 2026 Form 1040 (Qualified Dividends and Capital Gain Tax Worksheet with IRS Rev. Proc. 2025-32 breakpoints; Form 8960) (15% on $30,000).
3. price = $600,000.00, costs = $36,000.00, basis = $380,000.00, status = single, test = partial, months = 15, held = long, income = $70,000.00 gives gain = $184,000.00, maxExclusion = $156,250.00, exclusion = $156,250.00, taxable = $27,750.00, tax = $4,162.50, rate = 15%. Source: IRS Publication 523 (2025), Selling Your Home: gain or loss, the $250,000 and $500,000 exclusion, the eligibility test, and the partial exclusion (months ÷ 24), https://www.irs.gov/publications/p523 (partial exclusion: months ÷ 24 × $250,000); IRS Topic 701, Sale of your home, https://www.irs.gov/taxtopics/tc701.
4. price = $300,000.00, costs = $18,000.00, basis = $320,000.00, status = single, test = full, income = $60,000.00 gives gain = -$38,000.00, exclusion = $0.00, taxable = $0.00, tax = $0.00. Source: IRS Publication 523 (2025), Selling Your Home: gain or loss, the $250,000 and $500,000 exclusion, the eligibility test, and the partial exclusion (months ÷ 24), https://www.irs.gov/publications/p523 (a loss on the sale of your main home cannot be deducted).

## FAQ

### How much capital gains tax do I pay when I sell my house?

Often none. If you owned and lived in the home for 2 of the 5 years before the sale, you exclude up to $250,000 of gain ($500,000 married filing jointly). Gain above that is taxed at 0%, 15% or 20% if you owned the home more than a year, plus the 3.8% net investment income tax at higher incomes. A single seller with a $386,000 gain and $85,000 of other income pays about $21,198.

### How do I figure the gain on my home?

Gain = (sale price − selling costs) − (purchase price + buying costs + improvements). Selling costs are commissions, title, legal and other closing costs you paid; improvements are things that add value or life, like a new roof or kitchen, not repairs. A loss on your own home is not deductible.

### Who gets the $500,000 exclusion?

Married couples filing jointly, when both spouses lived in the home for 2 of the last 5 years, at least one owned it for 2 of those years, and neither excluded gain on another home in the 2 years before. If only one spouse lived there 2 years, the limit is generally $250,000.

### What if I sell before living there 2 years?

If you moved for a new job at least 50 miles farther away, for health reasons, or because of an unforeseen event such as a divorce, death or job loss, you get part of the exclusion: months ÷ 24 × $250,000 ($500,000 jointly). Months is the shortest of the time you owned it, the time you lived in it in the last 5 years, and the time since you last used the exclusion. Moving after 15 months gives 15/24 × $250,000 = $156,250.

### Is the 2-year rule 2 years in a row?

No. The 24 months of ownership and of living in the home can be at any time in the 5 years before the sale, and they do not have to overlap. Short absences such as vacations still count as living there.

### Do I have to report the sale if the gain is excluded?

Only if you got a Form 1099-S or have taxable gain. Then you report it on Form 8949 and Schedule D, showing the exclusion. Without a 1099-S and with all the gain excluded, you do not report it.

### What about depreciation I took for a home office or rental?

Depreciation claimed after May 6, 1997 cannot be excluded; that part of the gain is taxed at up to 25%. This calculator leaves it out, so if you claimed depreciation your tax will be higher.

## Sources

- IRS, Publication 523 (2025), Selling Your Home: figuring gain or loss (amount realized − adjusted basis), the eligibility test (ownership and residence 24 months in the 5 years, the look-back), the $250,000 and $500,000 maximum exclusion, the partial exclusion (work, health, unforeseeable events; the shortest period ÷ 730 days or 24 months), depreciation after May 6, 1997, and reporting. https://www.irs.gov/publications/p523 (retrieved 2026-10-19)
- IRS, Topic no. 701, Sale of your home (reviewed 12-Oct-2026): up to $250,000 of gain ($500,000 joint), the ownership and use tests, the 2-year rule, and reporting a sale with a Form 1099-S. https://www.irs.gov/taxtopics/tc701 (retrieved 2026-10-19)
- IRS, Rev. Proc. 2025-32 (Internal Revenue Bulletin 2025-45): 2026 rate tables (section 4.01), capital gains breakpoints (section 4.03), standard deduction (section 4.14). https://www.irs.gov/irb/2025-45_IRB (retrieved 2026-10-19)
- IRS, Instructions for Form 8960 (2025): 3.8% net investment income tax on the lesser of net investment income and modified AGI over $200,000 ($250,000 joint and qualifying surviving spouse, $125,000 married filing separately). https://www.irs.gov/instructions/i8960 (retrieved 2026-10-19)
- IRS, 2025 Tax Table (Instructions for Form 1040): taxable income under $100,000 is taxed at the middle of its row (rows of $0 to $5, $5 to $15 and $15 to $25, then $25 rows up to $3,000 and $50 rows from $3,000), in whole dollars. https://www.irs.gov/instructions/i1040tt (retrieved 2026-10-19)
