Home Sale Capital Gains Calculator 2026
Estimate 2026 federal tax on your primary-residence sale after the $250,000/$500,000 Section 121 exclusion, the 2-of-5-year test, and 25% recapture.
Home Sale Capital Gains Calculator 2026
Filing Status
Sets the Section 121 cap, the 2026 long-term capital gains breakpoints and the net investment income tax threshold.
Sale Price
The gross contract price on the closing statement, before commissions and before any mortgage payoff.
Selling Costs
Agent commission, legal and title fees, advertising, escrow charges and any points you paid for the buyer. These reduce your amount realized (Pub. 523).
Original Purchase Price
What you paid for the home, including the settlement fees you capitalized at purchase. This is the starting point for basis (Pub. 551).
Capital Improvements
Additions, a new roof, a kitchen remodel, new HVAC, a finished basement. Routine repairs and maintenance do not count (Pub. 523, Table 3).
Depreciation Taken
Depreciation allowed or allowable for a home office or a rental period after May 6, 1997. Depreciation you were entitled to but never claimed still reduces your basis, and it still comes back as recapture.
The 2-of-5-Year Tests
Count the months inside the 5 years ending on your closing date. They do not have to be consecutive, and the ownership months do not have to be the same months as the use months.
Both are capped at 60, the length of the Section 121(a) look-back window. 24 months in each column is the bar for the full exclusion.
Prior Sale and Early-Sale Reason
Section 121(b)(3) allows the exclusion once every two years. A second claim inside that window is barred unless a qualifying reason applies.
Treas. Reg. Section 1.121-3 recognizes three categories. A change in place of employment qualifies under a safe harbor when the new job site is at least 50 miles further from the old home than the old job site was. Health qualifies when a physician recommends the move. The enumerated unforeseen circumstances are death, divorce or legal separation, becoming eligible for unemployment compensation, multiple births from a single pregnancy, involuntary conversion, and natural or man-made disaster. This box does nothing if you already pass both tests.
Other Taxable Income
Your taxable income for 2026 before this sale, meaning the figure after your standard or itemized deduction (Form 1040 line 15). The gain stacks on top of it, so this sets which capital gains bracket you land in.
Federal estimates only, not tax or legal advice. State income tax is not modeled, and neither is the Section 121(b)(5) allocation for periods of nonqualified use, a Section 1031 or 1033 deferral, a home office in a separate structure, the alternative minimum tax, or your mortgage payoff. Check the figures against IRS Publication 523 and a tax professional before you file.
Tax47
Tax Calculator USA
Build the rest of your return in Tax47
This page looks at the sale on its own. Tax47 builds your 2026 return from W-2, 1099 and Schedule C data, and the refund estimate moves as you add each piece.
Free · No sign-up needed
How the Section 121 home sale exclusion works in 2026
Most home sale calculators tell you what lands in your bank account. This one tells you what lands on your tax return: the Section 121 exclusion you actually qualify for, the depreciation the exclusion cannot touch, and the bracket your remaining gain falls into.
IRC Section 121 lets you leave up to $250,000 of gain out of income when you sell your main home, or up to $500,000 on a joint return. Two tests gate it, both measured over the 5 years ending on your closing date. The ownership test asks for 24 months of ownership. The use test asks for 24 months of living in the home as your principal residence. The months do not have to run back to back, and the months you owned it do not have to be the same months you lived in it, which is what lets a landlord who moved in for two years still qualify.
On a joint return the split matters. Section 121(b)(2)(A) needs only one spouse to meet the ownership test, but it needs both to meet the use test before the cap reaches $500,000. If only one spouse lived there, Section 121(b)(2)(B) falls back to the sum of the individual limits, which is $250,000 plus $0. Section 121(b)(3) then adds a frequency limit: you can only claim the exclusion once in any two-year period.
Those dollar caps are statutory and have never been indexed for inflation. They have been $250,000 and $500,000 since the Taxpayer Relief Act of 1997, while the median US home price has more than tripled, which is why a rule written to exempt almost everybody now catches a growing share of long-time owners in expensive markets. The One Big Beautiful Bill Act (P.L. 119-21) reshaped brackets and deductions for 2026 but left Section 121, Section 1250 and Section 1411 alone.
Working out your gain: amount realized minus adjusted basis
Gain is not sale price minus purchase price. Start with the amount realized, which is the contract price less your selling costs: agent commission, legal and title fees, escrow charges, advertising and any points you paid on the buyer's behalf. Then build the adjusted basis: purchase price, plus the settlement costs you capitalized at purchase, plus every capital improvement, minus depreciation, casualty losses and certain credits.
An improvement adds value, extends the life of the property or adapts it to a new use: an addition, a new roof, a kitchen remodel, replacement windows, a new HVAC system, a finished basement. A repair keeps it in ordinary working order: patching, painting, fixing a leak. Pub. 523 Table 3 draws the line, and only improvements make it into basis. Keep the receipts. Every improvement receipt you lost is a dollar of gain you will be taxed on.
Take the defaults on this page. A $750,000 sale with $45,000 of selling costs gives a $705,000 amount realized. A $400,000 purchase plus $60,000 of improvements gives a $460,000 basis. The realized gain is $245,000, which sits under the $250,000 single-filer cap, so the whole thing is excluded and the federal tax is $0. Drop the improvements to $0 and the gain becomes $305,000, of which $55,000 is taxable. That is the difference a shoebox of receipts makes.
When you sold early: the reduced (partial) exclusion
Failing a test does not automatically cost you the whole exclusion. Treas. Reg. Section 1.121-3 grants a reduced maximum exclusion when the primary reason you sold was a change in place of employment, a health reason, or an unforeseen circumstance. Each has safe harbors. Work qualifies when the new job site is at least 50 miles further from the old home than the old job site was. Health qualifies when a physician recommends the move for the care or treatment of you, your spouse or certain family members. The enumerated unforeseen circumstances cover death, divorce or legal separation, becoming eligible for unemployment compensation, multiple births from a single pregnancy, involuntary conversion, and natural or man-made disaster.
Here is the part that trips people up: the fraction reduces the cap, not the gain. Take a single filer who owned the home 18 months, lived in it 14, and sold for a qualifying reason. The shortest qualifying period is 14 months, so the fraction is 14 divided by 24, and the cap becomes $145,833. That cap is then applied to the entire eligible gain. Prorating the gain instead and applying the full $250,000 gives a different, lower answer for every gain above $145,833.
Pub. 523 Worksheet 1 uses the shortest of three periods, not two: months owned, months used, and months since the most recent sale for which you claimed the exclusion. This tool checks all three, which is how the once-every-two-years rule gets modeled correctly. Without a qualifying reason, a failed test means a $0 exclusion, and the whole gain is taxable. As an accepted simplification, the fraction here uses whole months over 24 rather than days over 730, a difference of at most one month of proration.
Depreciation recapture, the 25% rate, and the 3.8% NIIT
If you ever claimed a home office or rented the place out, Section 121(d)(6) carves that depreciation out of the exclusion. Depreciation allowed or allowable after May 6, 1997 becomes unrecaptured Section 1250 gain, it comes off the top of your gain first, and the exclusion never reaches it. Subtract the exclusion first and you understate the bill for every seller who ever worked from a spare bedroom.
The 25% figure attached to that slice is a ceiling, not a flat rate. Section 1(h)(1)(E) taxes unrecaptured Section 1250 gain at your ordinary rates but never above 25%, so a modest-income seller pays 10% or 12% on it. This page computes both and charges the lower one, then shows you the rate that actually applied.
Whatever survives the exclusion is long-term gain, taxed at 0%, 15% or 20% depending on where it lands once stacked on top of your other taxable income. The Schedule D Tax Worksheet puts the 25% slice below the 0/15/20% gain in that stack, so the starting point for the bracket walk is your other income plus the recapture. Getting that order wrong changes the answer for anyone straddling the 0% breakpoint. The 2026 breakpoints come from Rev. Proc. 2025-32: the 0% band runs to $49,450 of taxable income for a single filer and $98,900 on a joint return.
Last comes the 3.8% net investment income tax under Section 1411, charged on the lesser of your net investment income and the amount your modified AGI exceeds $200,000 (single or head of household), $250,000 (married filing jointly) or $125,000 (married filing separately). Excluded gain is out of gross income, so Treas. Reg. Section 1.1411-4(d)(4)(i)(A) keeps it off both sides of that test. A fully excluded sale creates no surtax at any income level. Selling a second home, a rental or investment property instead? None of the Section 121 rules on this page apply, and the Capital Gains Tax Calculator is the tool for that job.
Everything here is an estimate and not tax or legal advice. Check it against IRS Publication 523 and your own closing statements, and talk to a tax professional before you file.
Frequently Asked Questions
Common questions about home sale capital gains calculator 2026
Do I have to pay capital gains tax when I sell my house?
Usually not. IRC Section 121 lets you exclude up to $250,000 of gain, or $500,000 on a joint return, when the home was your main residence. You have to have owned it for at least 24 months and lived in it for at least 24 months during the 5 years ending on the closing date. Tax only reaches the gain above that cap, plus any depreciation you claimed on a home office or rental period, which is never excludable. Most sellers owe nothing. If the property was a second home, a rental or an investment, the exclusion does not apply at all and the Capital Gains Tax Calculator is the right tool.
What is the 2-out-of-5-year rule?
Section 121(a) sets two separate tests measured over the 5 years ending on the date of sale: you must have owned the home for at least 24 months (the ownership test) and used it as your principal residence for at least 24 months (the use test). The months do not have to be consecutive, and the ownership months do not have to be the same months as the use months. Short absences such as vacations still count as periods of use under IRS Publication 523. On a joint return, only one spouse has to meet the ownership test, but both have to meet the use test to get the full $500,000.
Can I get a partial exclusion if I lived there less than two years?
Yes, if the primary reason you sold was a change in place of employment, a health reason, or an unforeseen circumstance under Treas. Reg. Section 1.121-3. The work-related safe harbor applies when the new job site is at least 50 miles further from the old home than the old job site was. The health safe harbor applies when a physician recommends the move. The enumerated unforeseen circumstances include death, divorce or legal separation, becoming eligible for unemployment compensation, multiple births from a single pregnancy, involuntary conversion and natural or man-made disaster. The reduction prorates the exclusion cap, not the gain: a single filer who lived there 14 of 24 months gets a $145,833 cap applied to the whole eligible gain.
How often can I use the home sale exclusion?
Once every two years. Section 121(b)(3) bars the exclusion on any sale made within 2 years of an earlier sale for which you already claimed it. A qualifying reason (job change, health, unforeseen circumstance) can still buy you a reduced exclusion inside that window, and in that case the months since the prior excluded sale become one of the candidates for the numerator in the proration fraction, alongside your ownership and use months.
How does a home office or a rental period affect the exclusion?
Depreciation you took, or were allowed to take and skipped, for periods after May 6, 1997 is unrecaptured Section 1250 gain. It is taxed at your ordinary rate capped at 25% under Section 1(h)(1)(E), and Section 121(d)(6) blocks the exclusion from covering any of it. That slice comes off the top of your gain first, and only what is left is eligible for the $250,000 or $500,000 exclusion. Reversing the order understates the bill for every seller who ever claimed a home office. See the Home Office Deduction Calculator for where that depreciation comes from.
What counts toward my home's cost basis?
Your purchase price plus the settlement costs you paid at closing, plus capital improvements: an addition, a new roof, a kitchen remodel, new HVAC, landscaping that adds value. Then subtract depreciation, casualty losses and certain energy credits. Routine repairs and maintenance (painting, fixing a leak, replacing a broken window) do not count under Pub. 523 Table 3. Keeping receipts matters, because a low recorded basis is what turns a modest-looking sale into a taxable one.
Can I deduct a loss if I sell my home for less than I paid?
No. A loss on property held for personal use is not deductible. IRC Section 165(c) limits an individual's loss deductions to trade or business losses, losses on transactions entered into for profit, and casualty losses, and Pub. 523 states plainly that you cannot deduct a loss on the sale of your main home. There is no carryforward and no $3,000 capital loss offset for it. Losses on investment property are treated very differently, and those belong in the Capital Gains Tax Calculator.
Will I owe the 3.8% net investment income tax on my home sale?
Only on the part of the gain that is not excluded, and only if your modified AGI exceeds $200,000 (single or head of household), $250,000 (married filing jointly) or $125,000 (married filing separately). Gain excluded under Section 121 is left out of gross income entirely, so Treas. Reg. Section 1.1411-4(d)(4)(i)(A) keeps it off both sides of the lesser-of test: it is neither net investment income nor part of MAGI. A fully excluded sale creates no NIIT no matter how high your income. Run the full Form 8960 picture in the NIIT Calculator, and check your threshold figure in the MAGI Calculator.