Home Sale Capital Gains Calculator
Work out the taxable gain on selling your home after the Section 121 exclusion, including selling costs, improvements and depreciation recapture from any rental period.
How to use this calculator
- 1Enter the sale price and your selling costs — agent commission alone is usually 5–6%.
- 2Enter what you paid and every capital improvement made over the years; these raise your basis and cut the gain.
- 3Confirm whether you owned and lived in the home for at least two of the five years before selling.
- 4If the home was ever rented or you claimed a home office, enter the depreciation — it is taxed separately and cannot be excluded.
How the calculation works
Gain = (sale price − selling costs) − (purchase price + improvements − depreciation). Taxable = gain − depreciation recaptured − Section 121 exclusion- adjusted basis
- What you paid plus capital improvements, reduced by any depreciation claimed
- Section 121 exclusion
- $250,000 single or $500,000 married filing jointly, if the ownership and use tests are met
- recapture
- Depreciation previously claimed, taxed at up to 25% and never eligible for exclusion
The exclusion amounts were set by the Taxpayer Relief Act of 1997 and have never been indexed for inflation. A $500,000 exclusion covered virtually every sale in 1997; after decades of house price growth it increasingly does not.
Depreciation is recaptured before the exclusion is applied. Someone who rented their home out or claimed a home office can therefore owe tax even when the whole appreciation is otherwise covered.
Selling costs reduce the amount realised, and capital improvements raise the basis. Both cut the gain directly, and both are routinely understated because the records were not kept.
Worked example
An $800,000 sale on a $400,000 purchase
- 1.Amount realised: $800,000 − $48,000 = $752,000.
- 2.Adjusted basis: $400,000 + $60,000 of improvements = $460,000.
- 3.Gain: $752,000 − $460,000 = $292,000.
- 4.A married couple meeting the tests excludes up to $500,000, which covers the whole gain — no tax due.
Result: No tax — the gain sits inside the $500,000 exclusion
The same sale after renting it out
- 1.Depreciation of $70,000 reduces the basis to $390,000, so the gain rises to $362,000.
- 2.The $70,000 of depreciation is recaptured first, taxed at up to 25% — about $17,500.
- 3.The remaining $292,000 is covered by the $500,000 exclusion.
- 4.So tax is owed despite the appreciation being fully excluded — purely because of the depreciation.
Result: About $17,500 of recapture, even with the gain excluded
The exclusion, and the tests behind it
Section 121 lets most people sell their main home without paying capital gains tax at all. A single filer can exclude up to $250,000 of gain and a married couple filing jointly up to $500,000. It is the single most valuable tax break available to ordinary homeowners.
Two tests must both be met. The ownership test requires you to have owned the home for at least two of the five years before the sale. The use test requires it to have been your main home for at least two of those same five years. The periods need not be continuous, and for a married couple only one spouse needs to satisfy ownership while both must satisfy use to claim the full $500,000.
There is also a frequency limit: the exclusion can only be claimed once every two years. And where the tests are failed because of a genuine change in employment, health, or an unforeseeable circumstance, a reduced exclusion proportional to the time actually spent is often available.
Depreciation recapture, the trap for former landlords
The rule that surprises people most is that depreciation claimed while the property was a rental — or while a home office deduction was taken — cannot be excluded under Section 121, no matter how large the exclusion is.
Depreciation works twice against you. It reduced your basis when claimed, which increases the gain on sale, and the amount is then recaptured as unrecaptured section 1250 gain taxed at up to 25% rather than the usual long-term rate. This applies to depreciation that was "allowed or allowable", meaning it applies even if you never actually claimed it but were entitled to.
The practical consequence is that someone who rented out their home for a few years can owe a meaningful tax bill on sale even when the entire appreciation falls comfortably inside the exclusion. It is worth knowing before the sale rather than after.
Basis is where the money is
For anyone whose gain exceeds the exclusion, the adjusted basis is the number that decides the tax bill, and it is the one most often understated.
Capital improvements add to basis: a new roof, an addition, a kitchen remodel, new windows, landscaping that adds value, a replaced HVAC system. Repairs and maintenance do not — fixing a leak or repainting is not an improvement. Over twenty years of ownership the improvements can easily total six figures, and every dollar of documented improvement is a dollar less of taxable gain.
Selling costs also come off: agent commission, transfer taxes, title fees, legal costs, and even certain repairs made to prepare the property for sale. Between improvements and selling costs, careful record-keeping frequently makes the difference between a taxable sale and a tax-free one — which is why receipts are worth keeping for the entire period of ownership, not just a few years.
What this assumes, and where it stops
Assumptions
- The property is your main home and the gain qualifies as long-term.
- The 2026 long-term capital gains schedule applies to any taxable portion.
- Depreciation entered is the total allowed or allowable over the period of any rental or business use.
- Federal tax only — no state capital gains tax is included.
Limitations
- State capital gains tax is excluded and can be substantial; California and New York in particular tax gains as ordinary income.
- Periods of non-qualified use after 2008, which restrict the exclusion proportionally for a home converted from a rental, are not modelled.
- The reduced exclusion available on an early sale forced by employment, health or unforeseen circumstances is not calculated.
- This is an estimate. A sale of this size warrants confirmation with a tax professional before you file.
Common questions
How much of my home sale gain is tax free?
Up to $250,000 if you file single, or $500,000 married filing jointly, provided you owned the home and lived in it as your main home for at least two of the five years before selling. You can only use the exclusion once every two years. Anything above the limit is taxed at long-term capital gains rates, and depreciation from any rental period is taxed separately regardless.
Do I owe tax if I rented my home out for a while?
Possibly, even if the whole gain would otherwise be excluded. Depreciation claimed during the rental period cannot be excluded under Section 121 — it is recaptured and taxed at up to 25%. It also reduced your basis when claimed, which increases the gain. This applies to depreciation that was allowable even if you never claimed it, so a former rental almost always carries some tax on sale.
What counts as a capital improvement?
Anything that adds value, prolongs the property's life, or adapts it to a new use — an addition, a new roof, a kitchen or bathroom remodel, new windows, a replaced heating system, or landscaping that improves the property. Ordinary repairs and maintenance do not count: fixing a leak, repainting, or replacing a broken pane are not improvements. Keep receipts for the whole period you own the home, since improvements directly reduce the taxable gain.
What if I have to sell before living there two years?
You may still get a reduced exclusion if the sale was caused by a change in place of employment, a health reason, or certain unforeseeable circumstances defined in the regulations. The reduction is proportional — living there one year of the required two gives roughly half the exclusion. Selling early for other reasons means no exclusion at all and the full gain is taxable.
Sources
- Topic no. 701, Sale of your home — US Internal Revenue Service
- Publication 523, Selling Your Home — US Internal Revenue Service
Formula and content last reviewed on .
Results are estimates for information only, not professional advice.
Related calculators
Tools people commonly use alongside the home sale capital gains calculator.