2025 & 2026 Federal Rules

Home Sale Capital Gains Tax Calculator

Estimate the federal tax on selling your home — with the $250,000 / $500,000 primary-residence exclusion, cost basis, improvements, depreciation recapture, and the 3.8% NIIT. You get the full step-by-step math, not just a number.

Your numbers

What the buyer paid.

Agent commission, closing costs, legal fees you paid.

What you paid when you bought it.

Additions, new roof/HVAC, remodels. Not repairs.

Approx. taxable income (roughly AGI minus deductions). This decides your 0% / 15% / 20% rate.

Full = up to $250k single / $500k joint. You can't have used the exclusion in the prior 2 years.

Advanced (buying closing costs & depreciation)

Added to your cost basis.

If you rented it or used a home office. Usually $0. Taxed at up to 25%, not excludable.

Estimated federal tax

$0

Filing this yourself? A home sale with the exclusion, basis adjustments, or depreciation recapture is exactly where desktop tax software pays for itself (Schedule D / Form 8949 / Form 8960).
TurboTax Premier (handles home sale & investments)
H&R Block Premium tax software

Disclosure: As an Amazon Associate we earn from qualifying purchases (tag: theboringthin-20). This costs you nothing extra and does not affect your calculation.

How the calculation works

  1. Amount realized = sale price − selling costs.
  2. Adjusted basis = purchase price + buying costs + capital improvements − depreciation.
  3. Total gain = amount realized − adjusted basis. (A loss on a personal home is not deductible.)
  4. Depreciation recapture is peeled off first — it can't be excluded and is taxed at up to 25%.
  5. Section 121 exclusion (up to $250k / $500k, or a prorated partial amount) is applied to the remaining gain.
  6. Long-term capital gains tax on what's left, stacked on top of your other income across the 0% / 15% / 20% brackets.
  7. Net Investment Income Tax (3.8%) is added if your income exceeds the NIIT threshold.

Rates & rules this tool uses

Long-term capital gains brackets (2025 & 2026 inflation-adjusted) — IRS Topic 409. Primary-residence exclusion, cost basis, partial exclusion, depreciation — IRS Topic 701 and IRS Publication 523. Net Investment Income Tax (3.8%) — IRS NIIT / Form 8960. Figures are for the U.S. federal tax only and change annually — verify against the current-year IRS guidance. State capital gains tax (if any) is not included.

Frequently asked questions

How much is capital gains tax when you sell your home?

If the home was your main residence for at least 2 of the last 5 years, you can exclude up to $250,000 of gain (single) or $500,000 (married filing jointly) under IRC Section 121. Gain above the exclusion is taxed at 0%, 15%, or 20% depending on your taxable income, plus a possible 3.8% Net Investment Income Tax.

What is the $250,000 / $500,000 home sale exclusion?

IRC Section 121 lets you exclude gain from the sale of a home you owned and used as your main home for at least two of the five years before the sale. You generally can't use the exclusion more than once every two years.

How do I calculate my home's cost basis?

Start with your purchase price, add buying closing costs and capital improvements (new roof, addition, HVAC, remodels — not routine repairs), then subtract any depreciation claimed for rental or home-office use. That adjusted basis is subtracted from your amount realized (sale price minus selling costs). See IRS Publication 523.

Can I get a partial exclusion if I lived there under 2 years?

Yes, if you sold early because of a qualifying job relocation (new workplace 50+ miles farther), a health reason, or an unforeseen circumstance. The cap is prorated over 730 days — meeting the tests for 365 of 730 days gives you half the normal exclusion.

Do I owe tax on depreciation I claimed while renting?

Yes. Depreciation you took is unrecaptured Section 1250 gain — it can't be excluded under Section 121 and is taxed at a maximum federal rate of 25%.

What is the 3.8% Net Investment Income Tax?

An extra 3.8% on the lesser of your net investment income (including taxable home-sale gain) or the amount your MAGI exceeds $200,000 (single/HoH), $250,000 (MFJ), or $125,000 (MFS). These thresholds are fixed and not indexed to inflation.

Get the annual rate updates

Capital gains brackets and NIIT rules change every year. Drop your email and we'll send a short note when the figures update — no spam.

Educational estimate — not tax, legal, or financial advice. This calculator provides a simplified federal estimate and cannot cover every situation (nonqualified-use periods, installment sales, prior-exclusion recapture, state tax, AMT interactions, married-filing-separately spousal splits, etc.). No result is a guarantee. Rates and thresholds change annually and are current-year estimates only. Verify your specific numbers with the IRS or a qualified tax professional before acting.