Skip to main content
🧮 Free Calculator

Home Sale Tax Calculator

Estimate the federal tax on selling your home -- including the Section 121 exclusion of up to $250,000 ($500,000 married) of gain from tax.

Last updated July 14, 2026

🧮

Home Sale Tax Calculator

Loading calculator...

Selling your home is one of the few times the tax code works heavily in your favor: under IRC Section 121, you can exclude up to $250,000 of gain ($500,000 if married filing jointly) from federal tax entirely, as long as you owned and lived in the home as your primary residence for at least two of the five years before the sale. Most home sellers owe nothing.

This calculator walks through the actual eligibility tests -- ownership, use, and how recently you last used the exclusion -- rather than assuming you qualify, shows exactly how much of your gain the exclusion covers, and estimates federal tax on anything left over using the same long-term capital gains and NIIT mechanics as a stock or fund sale. It also flags one thing many sellers don't expect: a loss on a personal residence is never tax-deductible, unlike an investment loss.

How It Works

The math follows the same shape as Schedule D and the Section 121 exclusion rules on Publication 523, at a level appropriate for a planning estimate:

  1. Net proceeds = sale price minus selling costs (agent commission, closing costs, etc.).
  2. Adjusted basis = original purchase price, plus buying costs and capital improvements (a new roof, an addition -- not routine repairs or maintenance), minus any basis reductions (depreciation claimed for business/rental use, casualty-insurance reimbursements).
  3. Total gain = net proceeds minus adjusted basis. If this is zero or negative, the sale is a loss -- which is never deductible for a personal residence, so the calculator stops there.
  4. Eligibility tests: you generally need to have owned the home as your primary residence for at least 2 of the 5 years before the sale, lived in it as your primary residence for at least 2 of the 5 years, and not have used the Section 121 exclusion on a different home sale within the last 2 years. All three must be met for the full exclusion.
  5. Exclusion cap: $250,000 for single, head of household, or married filing separately filers. $500,000 for married filing jointly, but only if both spouses meet the 2-year use test (if only one spouse qualifies, the cap is still $250,000).
  6. Partial exclusion: if you sell early for a qualifying reason -- a job change of 50+ miles, a health reason, or another IRS-recognized unforeseen circumstance -- you may still get a prorated exclusion, based on the shortest of your ownership period, use period, or time since a prior exclusion, as a fraction of the 2-year requirement.
  7. Taxable gain = total gain minus whatever exclusion applies, floored at zero.
  8. Any remaining taxable gain is taxed as a short-term (ordinary income rates) or long-term (0/15/20% preferential rates) capital gain depending on your holding period, plus NIIT (3.8%) if your income is high enough -- using the same incremental-tax and bracket-stacking mechanics as our Capital Gains Tax Calculator.

Understanding Your Results

If your total gain is fully covered by the Section 121 exclusion, your estimated federal tax will show as $0 -- that's the exclusion working as intended, not an error. The eligibility section shows exactly which of the three tests you met and, if the exclusion is only partial or denied, why.

If part of your gain exceeds the exclusion, how this tax is built breaks the estimated tax on that excess into its short-term, long-term, and NIIT components, the same way our Capital Gains Tax Calculator does. If you also sold stocks, funds, or crypto in the same year, this tool does not net those together automatically -- use the Capital Gains Tax Calculator and add this sale's taxable gain as an "other long-term gain" to see the combined picture.

How the Section 121 exclusion works

The exclusion isn't automatic just because you sold your home -- it depends on three tests, all measured against the 5-year period ending on the date you sell:

  • Ownership test: you owned the home for at least 2 of those 5 years.
  • Use test: you lived in the home as your primary residence for at least 2 of those 5 years (the 2 years don't need to be continuous, and don't need to be the same 2 years as the ownership test, though in practice they usually overlap).
  • Frequency test: you haven't excluded gain from a different home sale within the 2 years before this one.

Worked example: gain fully covered by the exclusion

You bought a home for $300,000, spent $25,000 on buying costs and a kitchen remodel, and sold it for $600,000 after $30,000 in selling costs. Net proceeds are $570,000; adjusted basis is $325,000; total gain is $245,000. As a single filer who owned and lived there for the full 5 years, your exclusion cap is $250,000 -- which fully covers the $245,000 gain. Estimated federal tax: $0.

Worked example: gain exceeding the exclusion

Same numbers, but you sell for $900,000 instead. Total gain is now $545,000. The $250,000 exclusion still applies, leaving $295,000 taxable -- taxed at long-term capital gains rates (and NIIT, if your income is high enough), the same way a stock sale would be.

Worked example: selling early for a qualifying reason

You bought a home and, after 1 year, had to relocate more than 50 miles for a new job. You don't meet the full 2-year tests, but a job-related move is a recognized qualifying reason for a partial exclusion: with 1 of the required 2 years met, you'd get roughly 50% of the $250,000 cap (about $125,000) rather than the full amount -- still meaningfully reducing your taxable gain, just not eliminating it.

A loss isn't deductible

If your home sells for less than your adjusted basis, that loss can't be deducted against your other income or other capital gains -- the IRS treats a personal residence as personal-use property, and losses on personal-use property generally aren't deductible (unlike a loss on stock or a rental property). This is different from how capital losses on investments work, and it surprises a lot of sellers.

Pros and Considerations

Benefits

  • Walks through the actual eligibility tests instead of assuming you qualify for the exclusion
  • Handles partial exclusions for early sales due to a job change, health reason, or unforeseen event
  • Uses the same incremental-tax and bracket-stacking mechanics as our Capital Gains Tax Calculator for anything above the exclusion
  • Flags upfront that a loss on a personal residence is never deductible, which surprises many sellers
  • Free, no account required

Considerations

  • Federal estimate only -- state tax on home sale gains is not included
  • Does not handle a home partly used for business or as a rental unit (depreciation recapture)
  • Does not net this sale against other capital gains or losses realized the same year
  • Cannot know your actual eligibility with certainty -- verify the ownership/use/frequency tests against your own records before relying on any number here

Important Notes

  • This calculator covers a single primary-residence sale only.
  • It does not calculate depreciation recapture for a home partly used for business or rental purposes, divorced-couple special ownership/use allocation rules, or surviving-spouse extensions to the exclusion window -- each has special rules a general calculator would misrepresent if it guessed.
  • State tax on home sale gains is not included in this version.
  • This calculator is publicly available as a planning estimate and is undergoing final professional tax review.

Warnings

  • This tool provides an estimate for planning purposes only. It is not tax advice and does not replace Form 8949, Schedule D, or a qualified tax professional.
  • Results depend entirely on the accuracy of what you enter, including your own assessment of the ownership/use/frequency tests. Verify your eligibility against IRS Publication 523 or with a tax professional before relying on any number here.
  • Tax law can change. Figures are specific to the 2026 tax year as understood at the time this calculator was published.

Frequently Asked Questions

Do I have to pay tax when I sell my house?
Often no. If you owned and lived in the home as your primary residence for at least 2 of the last 5 years, up to $250,000 of gain ($500,000 married filing jointly) is excluded from federal tax under Section 121. Most home sellers with a typical amount of appreciation owe nothing.
How much of my home sale profit is tax-free?
Up to $250,000 for single filers, heads of household, or married filing separately -- up to $500,000 for married filing jointly, but only if both spouses meet the 2-year use test. Any gain above that amount is generally taxable.
What is the 2-out-of-5-year rule?
To qualify for the full Section 121 exclusion, you must have owned the home for at least 2 of the 5 years before the sale, and lived in it as your primary residence for at least 2 of those 5 years. The 2 years don't need to be consecutive.
Can I use the exclusion more than once?
Yes, but generally not more than once every 2 years. If you used the exclusion on a different home sale within the last 2 years, you typically don't qualify for the full exclusion again until that 2-year window passes -- though a qualifying reason (job change, health, unforeseen event) can allow a prorated partial exclusion sooner.
What counts toward my home's cost basis?
Your original purchase price, plus buying costs (closing costs, title fees) and capital improvements -- a new roof, an addition, a major renovation. Routine repairs and maintenance (painting, fixing a leak) don't count. Basis is reduced by any depreciation claimed for business or rental use and by insurance reimbursements for casualty losses.
Is a loss on selling my home tax-deductible?
No. A loss on the sale of a personal residence is not deductible, unlike a loss on an investment property or on stocks. The IRS treats your home as personal-use property, and losses on personal-use property generally can't offset other income or gains.
What if I sell before living in the home for 2 years?
You may still qualify for a partial exclusion if you're selling due to a job change (generally 50+ miles), a health reason, or another IRS-recognized unforeseen circumstance. The partial exclusion is prorated based on how much of the 2-year requirement you met.
How is the taxable portion of my home sale gain taxed?
The same way any other capital gain is: at ordinary income rates if you owned the home a year or less (short-term), or at the preferential 0/15/20% long-term capital gains rates if you owned it more than a year -- plus the 3.8% Net Investment Income Tax if your income is high enough.
Does this calculator include state tax?
No, this is a federal estimate only. Nine states have no general income tax -- Alaska, Florida, Nevada, New Hampshire, South Dakota, Tennessee, Texas, Washington, and Wyoming -- so residents of those states typically owe no state tax on a home sale gain (Washington's separate state capital gains excise tax explicitly exempts direct real estate sales). Many other states tax home sale gains in some form, often as part of ordinary state income tax, but rules vary widely -- check with your state's tax authority or a tax professional for your specific situation.
What if I also sold stocks or crypto the same year I sold my home?
This calculator estimates tax on the home sale by itself. To see it combined with other capital gains or losses, use the Capital Gains Tax Calculator and enter this sale's taxable gain (after the Section 121 exclusion) as an "other long-term gain."
Does this calculator handle a home used partly for business or a rental unit?
No. If part of your home was used for business (a home office you depreciated) or as a separate rental unit, that portion involves depreciation recapture rules this calculator doesn't model. A dedicated rental-property calculator is planned for a future update.
Can married couples filing separately use the $500,000 exclusion?
No. The $500,000 exclusion is only available to married couples filing jointly where both spouses meet the use test. Married filing separately is capped at $250,000, same as a single filer.

Related Calculators

References

  1. IRS Publication 523, Selling Your Home
  2. IRS Topic No. 701, Sale of Your Home
  3. IRS Schedule D (Form 1040), Capital Gains and Losses
  4. IRS Form 8960, Net Investment Income Tax
← All Calculators