What you'll need
- Sale price, and roughly what selling costs will run
- What you paid, and the settlement costs you paid at purchase
- Capital improvements since — dig out the receipts, this one is worth money
- Months you owned it and months you lived in it, out of the last 60
- Any depreciation claimed if it was ever rented or used for business
- Your filing status and roughly your other taxable income this year
What you'll get
- Your gain — Amount realized against a properly built adjusted basis
- Exclusion status — Full, reduced and prorated, or none — and exactly why
- Recapture — The depreciation slice that can never be excluded
- Rate band by band — How much of the gain falls at 0%, 15% and 20%
- Total federal tax — Including net investment income tax, as a share of the gain
Two worked examples, same statute
The gap between these two is the whole argument for doing this properly. Both are real §121 sales. One pays 2.8% of the gain; the other pays 18.9%.
1. A long-held family home, gain above the cap
Sold for $1,200,000 with 7% selling costs. Bought for $400,000 with $8,000 of settlement costs and $120,000 of improvements since. Never rented. Joint return, both spouses lived there the whole time, $250,000 of other taxable income.
- Amount realized $1,116,000 less adjusted basis $528,000 = a gain of $588,000.
- Both tests met, so the full $500,000 exclusion applies, leaving $88,000 taxable.
- Stacked on $250,000 of income the whole remainder falls in the 15% band: $13,200. The 3.8% net investment income tax adds $3,344.
- Total $16,544 — 2.81% of the gain.
2. Edge case — a converted rental, sold early, by a high earner
Same statute, every gate against the seller. Sold for $900,000 after only 18 months of ownership and 12 months of residence, on a qualifying work relocation. $60,000 of depreciation was claimed while it was rented. Single filer with $520,000 of other taxable income.
- Depreciation cut basis to $296,000, enlarging the gain to $550,000.
- $60,000 of that is unrecaptured §1250 gain and is carved out before the exclusion is even considered — $15,000 of tax at 25%.
- The tests fail, but the work relocation earns a §121(c) reduced exclusion of 50% of the cap = $125,000, not nothing.
- $365,000 remains, and stacked on $520,000 of income it lands entirely in the 20% band: $73,000, plus $16,150 of net investment income tax.
- Total $104,150 — 18.94% of the gain.
A model that carries a single yes/no exclusion flag and asks you to supply your own rate cannot produce the second number. That is the reason this page exists separately from the cost-to-sell net sheet, which flags the exclusion as one line on the way to your proceeds rather than working the tax out.
What this calculator does not model
Each of these can change your answer, and none of them is applied above. They are listed rather than quietly dropped, because a tax estimate that hides its own gaps is worse than no estimate.
State and local capital gains tax
Federal only. Most states tax capital gains as ordinary income, a handful do not tax them at all, and Washington levies a standalone excise on certain gains — but real property sold in-state is generally exempt from it. There are more than fifty distinct regimes and no defensible national figure, so none is applied. Add your state's treatment to every number this page produces.
The §121(b)(5) non-qualified-use allocation
If the home was used as something other than a principal residence during periods after 31 December 2008 — a rental, a second home — §121(b)(5) allocates part of the gain to that non-qualified use and denies exclusion on it, separately from the depreciation rule. That allocation depends on a full month-by-month use history that a calculator cannot honestly reconstruct from a handful of inputs. If your home was ever rented out after 2008, treat the exclusion shown here as an upper bound and consult Publication 523 or a tax professional.
Ordinary-income recapture under §1250(b)
Only unrecaptured section 1250 gain at the 25% maximum rate is modelled. Depreciation taken in excess of straight-line is recaptured as ordinary income instead. Residential rental property is depreciated straight-line over 27.5 years, so for almost every home sale this figure is zero — but it is not modelled, and if you claimed accelerated depreciation it is not zero.
Suspended passive activity losses
Disposing of a rental property in a fully taxable sale generally frees any suspended passive losses, which offset other income and can materially reduce the bill this page shows. That is a benefit, not a cost, so the figure here is conservative — but it is not calculated.
Inherited homes: alternate valuation and the surviving-spouse rule
An inherited home is priced from the fair market value at the date of death you enter. An estate that elected the alternate valuation date six months later sets a different basis, and an unremarried surviving spouse may count the late spouse's ownership and use toward the two-year tests. Neither is modelled: this page tests the heir's own months only. Community-property rules that step up the surviving spouse's half as well are not modelled either.
Holding periods are counted in whole months
A sale 12 months and a few days after purchase is long-term under the statute, because the holding period is more than one year. This page counts whole months and treats 12 or fewer as short-term, so in that narrow window it shows the higher ordinary-rate tax. Count the days if your sale falls close to the one-year mark.
The special §121 rules for particular circumstances
Suspension of the five-year period for qualified official extended duty in the uniformed services, the Foreign Service or the intelligence community (§121(d)(9)); the surviving-spouse window that preserves the $500,000 amount for a sale within two years of a spouse's death; transfers incident to divorce; sales of vacant land adjacent to the residence; and the five-year ownership requirement that applies when the home was acquired in a §1031 exchange. Each is named because each can change the answer, and none is modelled.
Installment sales and seller financing
Gain reported over several years under the installment method spreads the tax across those years and can hold you in a lower rate band throughout. This page prices the whole gain as recognised in the year of sale.
Modified AGI is approximated by your other taxable income
The rate bands are tested against taxable income and the net investment income tax against modified adjusted gross income. These are different statutory measures — modified AGI sits above taxable income, before deductions. One input stands in for both here, which makes the net investment income tax figure approximate and, for most filers who take a deduction, understated.
The full Schedule D rate ordering
Unrecaptured section 1250 gain is taxed here at a flat 25% and is stacked beneath the remaining long-term gain when the rate bands are applied. The Schedule D Tax Worksheet's ordering is more intricate and the 25% figure is a statutory maximum rather than a flat rate, so a seller in a low ordinary bracket may pay less than shown.
Investment property being sold rather than a residence has its own route — a §1031 like-kind exchange defers the gain into a replacement property instead of excluding it, and is not available on a principal residence. If you cannot find the depreciation figure the recapture line needs, the rental depreciation calculator reconstructs it. Several of the situations above — divorce, a surviving spouse, an inherited home, a former rental, or military orders — have their own governing rule rather than a single yes/no flag; our guide to capital gains tax on a home sale walks through each one, sourced separately.
How it works
Build the gain, not the profit
Sale price less selling costs gives the amount realized. Purchase price plus the settlement costs you paid at purchase plus every capital improvement, less any depreciation claimed, gives adjusted basis. The difference is the gain — and it is usually smaller than the number sellers have in their head, because improvements get forgotten.
Test the exclusion, in three parts
The ownership leg and the use leg each need 24 months out of the last 60, and they fail independently. A third gate bars the exclusion if you excluded gain on another home in the prior 24 months. Fall short for a qualifying work, health or unforeseeable reason and §121(c) gives you a prorated share rather than nothing.
Carve out depreciation before the exclusion applies
Gain equal to depreciation claimed after 1997-05-06 on any rental or business use is never excludable, however well you meet the tests. It is taxed separately at up to 25%. Leaving it inside the exclusion is the most common way a home-sale tax estimate comes out too low.
Derive the rate instead of guessing it
What is left is stacked on top of your other taxable income and split across the 2026 0%, 15% and 20% bands. A gain can straddle two of them. The 3.8% net investment income tax is applied on top where modified AGI passes the threshold.
The federal rules this calculator applies, and where each comes from
| Rule | Figure | Primary source |
|---|---|---|
| §121 maximum exclusion | $250,000 single · $500,000 joint return | IRS — Topic no. 701, Sale of your home (read 2026-08-26) |
| Ownership and use tests | 24 months each, within the last 60 | IRS — Topic no. 701, Sale of your home (read 2026-08-26) |
| Joint-return use test | Either spouse owns; BOTH must use | IRS — Topic no. 701, Sale of your home (read 2026-08-26) |
| Prior-sale look-back | 24 months | IRS — Topic no. 701, Sale of your home (read 2026-08-26) |
| §121(c) reduced exclusion | Shortest qualifying period ÷ 24 months | IRS — Publication 523, Selling Your Home (read 2026-08-26) |
| Depreciation recapture | Post-1997-05-06 depreciation, never excludable, taxed at up to 25% | IRS — Publication 523, Selling Your Home; IRS — Topic no. 409, Capital gains and losses (read 2026-08-26) |
| Long-term rate bands (2026) | Single 0% ≤ $49,450, 15% ≤ $545,500 · Joint 0% ≤ $98,900, 15% ≤ $613,700 | IRS — Rev. Proc. 2025-32, §4.03 (tax year 2026 inflation adjustments) (read 2026-08-26) |
| Net investment income tax | 3.8% above $200,000 single / $250,000 joint modified AGI | IRS — Net Investment Income Tax (read 2026-08-26) |
Every figure above is statutory or IRS-published, read on the date shown. The rate bands are the tax year 2026 inflation-adjusted amounts from Rev. Proc. 2025-32 §4.03. The §121 exclusion amounts and the net investment income tax thresholds are NOT inflation-indexed and have never moved. Rules version 2026-09-28. Federal only — state capital gains tax is not modelled.
Related Calculators
Cost to Sell a House
The full net sheet — commission, closing costs, mortgage payoff and what actually reaches your account. Carries a simplified version of this exclusion; come here for the tax itself.
1031 Exchange Calculator
The other route for investment property: defer the gain into a replacement property instead of excluding it. Does not apply to a principal residence.
Rental Depreciation Calculator
Works out the depreciation you have claimed — the figure this calculator needs for the recapture line, and the one people cannot find.
Closing Costs Calculator
The settlement costs at purchase that add to your basis, itemised — worth rebuilding before you accept a taxable gain.
About this calculator
How much capital gains tax do I pay when I sell my house?
Often none. Under IRC §121 you can exclude up to $250,000 of gain, or $500,000 on a joint return, if you owned the home and used it as your principal residence for at least 24 months out of the 60 ending on the sale date. Only the gain above that is taxed. A couple selling for $1,200,000 a home they bought for $400,000 and improved by $120,000 has a $588,000 gain, excludes $500,000 of it, and owes $16,544 federally — 2.8% of the gain. Note the exclusion amounts are statutory and have not been indexed for inflation since 1997.
What is the 2-out-of-5-year rule for home sale capital gains?
It is two separate tests, not one. You must have owned the home for at least 24 months of the last 60, and separately used it as your principal residence for at least 24 months of the same period. Neither stretch has to be continuous, and they do not have to be the same months. On a joint return either spouse can satisfy the ownership leg, but both must satisfy the use leg individually — one spouse falling short drops the couple's cap from $500,000 to $250,000. A third gate applies too: you cannot use the exclusion if you already excluded gain on another home in the two years before this sale.
Can I get a partial exclusion if I lived there less than two years?
Yes, if a qualifying reason caused the sale. Under §121(c), a work relocation of at least 50 miles, a health matter, or an unforeseeable event such as a death, divorce, job loss or disaster converts "no exclusion" into a prorated one. Publication 523 prorates by the shortest of three periods — time owned, time lived in, and time since your last excluded sale — over 24 months. Twelve qualifying months is therefore half the cap: $125,000 for a single filer rather than nothing. Without a qualifying reason there is no partial exclusion, and the whole gain is taxable.
Do I pay capital gains tax on a rental property I used to live in?
Partly, and the depreciation is the expensive half. Gain equal to depreciation allowed or allowable after 6 May 1997 can never be excluded under §121 no matter how well you meet the tests, and it is taxed as unrecaptured section 1250 gain at up to 25%. It bites twice: the depreciation already reduced your basis, which enlarged the gain, and the same amount is then taxed on the way out. In the worked example on this page — a home sold for $900,000 after $60,000 of depreciation, sold early on a work relocation by a high earner — the total federal bill is $104,150 on a $550,000 gain, 18.9% of it. A separate rule, the §121(b)(5) non-qualified-use allocation, can reduce the exclusion further for rental periods after 2008; it is not modelled here and is flagged on the page.
What rate is long-term capital gain on a home taxed at?
0%, 15% or 20%, decided by your total taxable income rather than by the size of the gain alone. The gain stacks on top of your other taxable income, so it can straddle two bands. For tax year 2026 the 0% band runs to $49,450 of taxable income for a single filer and $98,900 on a joint return; the 15% band runs to $545,500 and $613,700 respectively, and 20% applies above that. A further 3.8% net investment income tax applies once modified adjusted gross income passes $200,000 single or $250,000 joint. Because the gain stacks, selling into a low-income year is a real and legal lever on the bill.
How do I reduce the capital gain on my home sale?
Rebuild your basis before anything else — it is the largest and most commonly missed lever. Basis is what you paid, plus the settlement costs you paid at purchase, plus every capital improvement since: an addition, a roof, a remodelled kitchen, new windows, permanent landscaping. Routine repairs do not count. Selling expenses — commission, legal fees, transfer taxes, advertising — also come off the sale price before the gain is measured. Beyond that, meeting the full ownership and use tests before you sell, and timing the sale into a year with lower other income, both move the number. Investment property has a different route entirely: a §1031 like-kind exchange defers the gain rather than excluding it, and does not apply to a principal residence.
Do I have to report the home sale if the gain is excluded?
If the closing agent issues you a Form 1099-S, yes — the sale goes on your return even when the entire gain is excludable, reported on Form 8949 and Schedule D. If no 1099-S is issued and the whole gain qualifies for exclusion, reporting is generally not required. Any depreciation recapture must be reported regardless, on Form 4797.