House keys resting on a stack of closing documents on a wooden table
Free · 2026 brackets · primary home or rental

Home Sale Capital Gains Calculator

Your purchase, sale and situation
$
$
$
$
$
% of price
yrs
$
%
Estimated tax on the sale
$13,900
4.4% of a $319,500 gain · long-term, single
The gain
Adjusted basis$285,000
Amount realized (price − selling costs)$604,500
Gain$319,500
§121 exclusion used (of $250,000)$250,000
Taxable gain$69,500
The tax
Federal capital gains tax$10,425
gain taxed at 0% / 15% / 20%$0 / $69,500 / $0
Depreciation recapture (≤ 25%)none
Net investment income tax (3.8%)$0 (under the threshold)
State tax$3,475 at 5%
You keep after costs and tax$590,600 before any payoff
Estimated tax of $13,900 (4.4% of the $319,500 gain, after a $250,000 exclusion). You keep $590,600 after selling costs and tax, before any mortgage payoff.

Federal long-term rates are the 2026 brackets from Rev. Proc. 2025-32 (0% / 15% / 20% by taxable income, with the gain stacked on top of your other income); the §121 exclusion is $250,000 ($500,000 married filing jointly) for a main home owned and used 2 of the last 5 years; gain from depreciation is never excluded and is taxed at your ordinary rate up to 25%; NIIT applies above $200,000 / $250,000 of modified AGI; a home held one year or less is taxed at your ordinary rate. State rates vary from 0% to 13.3% — enter yours. This is an estimate for planning and not tax advice; a preparer should confirm any sale near the exclusion or involving rental use.

Enter what you paid, what you improved, what you are selling for and how you used the home, and get the taxable gain after the §121 exclusion, the federal tax at the 2026 long-term rates, net investment income tax, depreciation recapture on a rental, state tax and what you keep.

The calculator follows IRS Publication 523 step by step: adjusted basis (price plus purchase costs plus improvements, minus any depreciation), the amount realized (sale price minus selling costs), the gain, the §121 exclusion you qualify for, and then the tax. Federal tax uses the 2026 long-term capital-gains bands with the gain stacked on top of your other taxable income, so part of a gain can fall in the 0% band and the rest at 15% or 20%; depreciation you claimed on a rental is taxed separately at up to 25%; the 3.8% net investment income tax applies once your income with the gain crosses the threshold; and a home held a year or less is taxed as ordinary income. Enter your state’s rate for the full picture.

How much is capital gains tax on a home sale?

Most owner-occupiers pay nothing: up to $250,000 of gain is excluded from federal tax ($500,000 for a married couple filing jointly) when the house was your main home for at least two of the five years before the sale. Above that, the gain is taxed at the 2026 long-term rates of 0%, 15% or 20% depending on your taxable income, plus 3.8% net investment income tax for higher earners and whatever your state charges. A single seller with $90,000 of other income and a $319,500 gain owes about $10,425 federal on the $69,500 above the exclusion (15%), plus $3,475 at a 5% state rate.

Gain is not sale price minus purchase price. It is the amount realized (price minus commissions, transfer tax and other selling costs) minus the adjusted basis (what you paid, plus closing costs when you bought, plus capital improvements, minus depreciation). A couple who bought for $250,000, spent $30,000 on a kitchen and roof and sold for $550,000 with 7% of costs has a gain of $226,500 — well under their $500,000 exclusion, so $0 tax. The sale proceeds calculator gives you the selling-cost figure; the home appreciation calculator shows how the gain built up.

House keys lying on closing documents on a wooden table
Keep the closing statements from both the purchase and the sale, and receipts for every improvement — they are the evidence for your basis. Photo: Jakub Zerdzicki / Pexels

The §121 exclusion: who qualifies for $250,000 or $500,000

Section 121 of the tax code lets you exclude gain on the sale of your main home if, during the five years ending on the sale date, you owned it for at least two years and lived in it as your main home for at least two years (730 days, not necessarily continuous or the same two years). You can use it once every two years. The amount is $250,000 per taxpayer; a married couple filing jointly gets $500,000 if either spouse meets the ownership test and both meet the use test, and a surviving spouse keeps the $500,000 for a sale within two years of the death.

Partial exclusion when you sell early

If you sell before two years because of a job move (new workplace at least 50 miles farther from the home), health (a doctor-recommended move for you or a family member) or an unforeseeable event (death, divorce, multiple births, job loss qualifying for unemployment, a change that leaves you unable to pay the basic living costs), the exclusion is prorated by the time you qualified: months ÷ 24 × the full amount. Twelve months of ownership and use for a job move gives a single seller $125,000 — enough for almost any one-year gain.

Partial §121 exclusion by months of ownership and use (qualifying reason required)
Qualifying periodSingle / HoH / MFSMarried filing jointly
6 months$62,500$125,000
12 months$125,000$250,000
18 months$187,500$375,000
24 months$250,000$500,000

Prorated exclusion = months ÷ 24 × full amount (IRS Pub 523). Without a qualifying reason, a sale inside two years gets no exclusion at all, and inside one year it is taxed as ordinary income.

What reduces or removes it

  • Non-qualified use: years after 2008 when the home was a rental or second home before it became your main home are carved out of the exclusion in proportion to the ownership period (periods of rental after you move out, within the five-year window, do not count against you).
  • Depreciation claimed after May 6, 1997 for a rental period or a home office is never excluded; it is taxed as unrecaptured §1250 gain at up to 25%.
  • Second homes, investment property and flips get no exclusion, which is where the brackets below do the work.

2026 capital gains tax brackets on real estate

Long-term capital gains (property held more than one year) are taxed at 0%, 15% or 20%, but not in the way people assume. The gain is stacked on top of your other taxable income: the part of the gain that falls below the 0% threshold is untaxed, the part between the thresholds is taxed at 15%, and only the part above the 15% ceiling is taxed at 20%. The thresholds are taxable income (after the standard or itemised deduction), inflation-adjusted each year; these are the 2026 figures from Rev. Proc. 2025-32.

2026 long-term capital-gains bands by taxable income, with the §121 exclusion and NIIT threshold
Filing status0% band15% band20% band§121 exclusionNIIT above (MAGI)
Single$0 – $49,450$49,451 – $545,500over $545,500$250,000$200,000
Married filing jointly$0 – $98,900$98,901 – $613,700over $613,700$500,000$250,000
Head of household$0 – $66,200$66,201 – $579,600over $579,600$250,000$200,000
Married filing separately$0 – $49,450$49,451 – $306,850over $306,850$250,000$125,000

Rev. Proc. 2025-32 (tax year 2026). NIIT = 3.8% on the lesser of net investment income (the taxable gain) and MAGI above the threshold; the thresholds are not inflation-adjusted. Short-term gains (held one year or less) are taxed at ordinary rates of 10–37%.

Three consequences. A retired couple with $40,000 of taxable income can realise about $58,900 of gain above the exclusion at 0%. A high earner pays 20% plus 3.8% NIIT — 23.8% federal — on a large taxable gain; a single filer with $300,000 of income selling with a $816,000 gain owes about $122,433 federal on the $566,000 above the exclusion. And timing matters: a sale in a low-income year (between jobs, the first year of retirement) can move a six-figure slice of gain from 15% to 0%. Depreciation recapture on a rental is taxed at your ordinary rate capped at 25% and sits below the capital-gains portion in the stack, which is why the calculator asks for your ordinary marginal rate.

Worked examples: primary home, rental, inherited house, flip

Five sales at 7% selling costs and a 5% state rate, run through the calculator. The first two use the $250k/$500k exclusion; the rental shows depreciation recapture; the inherited house shows how a stepped-up basis wipes out most of the gain; the flip shows short-term treatment.

Sold sign in front of a house with a porch
The exclusion covers the ordinary family sale; the tax bites on rentals, second homes, flips and long-held homes in expensive markets. Photo: Thirdman / Pexels
Capital gains tax on five typical home sales (2026 rules, 5% state tax)
SalePrice − selling costsAdjusted basisGainExclusionTaxableFederal taxTotal with state
Primary home, gain under the exclusion$550,000 − $38,500$285,000$226,500$226,500$0$0$0
Primary home, gain above the exclusion (single)$650,000 − $45,500$285,000$319,500$250,000$69,500$10,425$13,900
Rental for 8 years, depreciation recaptured$400,000 − $28,000$197,000$175,000$0$175,000$30,310 + $1,710 NIIT$40,770
Inherited home sold a year later (stepped-up basis)$530,000 − $37,100$480,000$12,900$0$12,900$1,935$2,580
Flip sold after 9 months (short-term, no exclusion)$420,000 − $29,400$346,000$44,600$0$44,600$10,704$12,934

Primary-home cases: $250,000 purchase + $5,000 closing costs + $30,000 improvements. Rental: $58,000 of depreciation claimed, taxed at 22% (ordinary rate under the 25% cap); the rest of the gain at 15%, NIIT on the slice of MAGI above $250,000. Inherited: basis = value at the date of death ($480,000). Flip: 9 months, 24% ordinary rate.

Sanity-check your own case against the row that resembles it, then change one input at a time in the calculator: adding $20,000 of documented improvements cuts a 15%-band tax by $3,000 plus state; selling a rental in a year with $50,000 less income can pull part of the gain into the 0% band; waiting a few months to pass the one-year mark turns a flip’s ordinary-rate bill into a long-term one.

What counts as basis, improvements and selling costs

Basis is where most people leave money on the table, because they never add up what they spent. Pull the settlement statement from when you bought, then list every improvement that is still part of the house. The IRS test is whether the work adds value, prolongs useful life or adapts the home to a new use; repairs that merely keep it in working order do not count, but a repair done as part of a larger improvement (new drywall during a remodel) does.

Adjusted basis and selling costs: what goes where (IRS Publication 523)
CategoryExamples
Adds to basisPurchase price; closing costs you paid when buying (title, legal, recording, survey, transfer tax — not loan costs or prepaid interest/escrow); capital improvements that add value or extend life: additions, new roof, HVAC, kitchen or bath remodel, windows, deck, fence, driveway, landscaping that stays, solar, a new water heater, finished basement, septic/sewer hookup; special assessments for local improvements.
Does not add to basisRepairs and maintenance (painting, patching, fixing leaks), replacing items with equivalents when part of a repair, mortgage interest, insurance, property tax, HOA dues, improvements later removed or replaced (a roof replaced twice counts once), the value of your own labour, and any energy-credit amount you already claimed (the credit reduces basis).
Reduces basisDepreciation allowed or allowable for rental or home-office use after May 6, 1997 (recaptured at up to 25%); casualty-loss deductions; the deferred gain from a pre-1997 rollover; residential energy credits taken on the improvement.
Selling costs (reduce the amount realized)Agent commissions, transfer tax paid by you, title and escrow or attorney fees, advertising, legal fees, and repairs made within 90 days of sale solely to help it sell (fix-up costs are not deductible for a personal residence since 1997 — but true improvements still add to basis).

Decision: if you are within a few years of selling a home that has gained more than the exclusion, start a basis file now — receipts, contracts, permits, before-and-after photos. Without records the IRS can disallow the improvement, and reconstructing a 2009 kitchen remodel from bank statements is slow. For a rental, the depreciation you were allowed to claim reduces basis whether or not you claimed it, so an owner who skipped depreciation still pays recapture on it — another reason to have a preparer look at the return.

Selling a rental property: depreciation recapture, 1031 exchanges and converting it first

A rental sale has three layers of federal tax. Unrecaptured §1250 gain — the gain attributable to depreciation you claimed (or could have) — is taxed at your ordinary rate but capped at 25%. The rest of the long-term gain is taxed at 0/15/20%. And the whole taxable gain counts as net investment income for the 3.8% NIIT. On the example rental above, $58,000 of depreciation produces $12,760 of recapture tax, the remaining $117,000 of gain is taxed at 15% ($17,550), NIIT adds $1,710 and state tax $8,750, for $40,770 in all — 23% of the gain.

Ways to reduce it

  • 1031 exchange: sell the rental and buy another investment property through a qualified intermediary — identify replacements within 45 days and close within 180 days — and the entire gain, recapture included, is deferred. It does not work for a home you live in.
  • Move in first: live in the rental as your main home for two years and the §121 exclusion applies to the gain, except the depreciation (always recaptured) and the share of gain allocated to non-qualified rental years after 2008. Two years of use after eight years of renting excludes roughly a fifth of the non-depreciation gain, not all of it.
  • Instalment sale: taking payments over several years spreads the capital-gains portion across tax years (recapture is still taxed in the year of sale).
  • Harvest losses in the same year: capital losses on stocks offset the gain dollar for dollar.
  • Time the sale for a year with lower other income, which can move part of the gain down a band.

Track the equity you are sitting on with the home equity calculator; if the property is an investment, compare holding versus selling with the buy vs. invest tool.

Tax forms and a calculator on a desk with a pen
Depreciation recapture is reported on Form 4797; the capital gain on Schedule D and Form 8949. The closing agent files Form 1099-S with the IRS. Photo: Polina Tankilevitch / Pexels

Inherited and gifted homes, state tax, and how the sale is reported

Inherited property gets a stepped-up basis: your basis is the fair market value on the date of death, not what the deceased paid, and the gain is automatically long-term. Sell within a year or so and the gain is usually small — the $12,900 in the example above is what was left of a $50,000 price rise after selling costs — and a sale below the appraised value produces a deductible loss on an inherited house you never lived in. Gifted property is the opposite: you take the giver’s basis (carryover), so a parent gifting a house bought for $80,000 hands over a large built-in gain; inheriting the same house would have wiped it out.

State tax: most states tax capital gains as ordinary income at rates from about 2.5% to 13.3% (California); nine states have no tax on this gain — Alaska, Florida, Nevada, New Hampshire, South Dakota, Tennessee, Texas, Washington (its 7% capital-gains tax exempts real estate) and Wyoming. Most states follow the federal §121 exclusion. Enter your state’s rate in the calculator; a non-resident selling property still owes tax to the state where it sits, and several states withhold at closing (California 3⅓% of the price, Maryland, New Jersey and others) and let you claim it back on the return.

Reporting: the closing agent sends Form 1099-S unless you certify that the full gain is excluded. If you receive one, or the gain exceeds the exclusion, report the sale on Form 8949 and Schedule D; depreciation recapture goes on Form 4797; NIIT on Form 8960. If no 1099-S is issued and the whole gain is excluded, nothing goes on the return. Taxes are due with the return (or as an estimated payment in the quarter of the sale to avoid a penalty). This page is not tax advice — the rules have exceptions for military and foreign-service postings, divorces, trusts and mixed-use property that only a preparer with your records can apply.

How this home sale capital gains calculator works and where the numbers come from

Adjusted basis = purchase price + purchase closing costs + capital improvements − depreciation. Amount realized = sale price − selling costs. Gain = amount realized − basis. Unrecaptured §1250 gain = the lesser of depreciation claimed and the gain; it is never excluded and is taxed at the entered ordinary rate capped at 25%. §121 exclusion = $250,000 ($500,000 married filing jointly) for a main home with 2 of 5 years of ownership and use, prorated by months ÷ 24 for a qualifying early sale, zero otherwise, limited to the remaining gain. Taxable long-term gain is stacked above other taxable income plus the §1250 gain and split across the 2026 bands (0% to $49,450 / $98,900 / $66,200 / $49,450; 15% to $545,500 / $613,700 / $579,600 / $306,850 for single / joint / head of household / separate; 20% above — Rev. Proc. 2025-32). NIIT = 3.8% × min(taxable gain, MAGI − $200,000 / $250,000 / $125,000). Property held one year or less is taxed at the entered ordinary rate. State tax = taxable gain × entered rate. Non-qualified-use allocation, the §121 once-every-two-years limit, AMT and the 1250 gain’s interaction with the 0% band are not modelled. Not tax advice.

Last reviewed November 6, 2026. Estimates only — verify local figures before you commit money.

Common questions

Home Sale Capital Gains Calculator: FAQ

How much capital gains tax will I pay when I sell my house? +

Usually none: up to $250,000 of gain ($500,000 married filing jointly) is excluded if the house was your main home for two of the last five years. Gain above that is taxed at 0%, 15% or 20% federally in 2026 depending on your taxable income, plus 3.8% NIIT above $200,000/$250,000 of income and your state’s rate.

Is the $250,000 / $500,000 exclusion still available in 2026? +

Yes. The §121 amounts are fixed in the statute at $250,000 per taxpayer and $500,000 for a married couple filing jointly, and have not changed since 1997. You need two years of ownership and two years of use as your main home within the five years before the sale, and you can use it once every two years.

What are the 2026 capital gains tax rates on property? +

For property held more than a year: 0% on gain that keeps taxable income under $49,450 (single) or $98,900 (married filing jointly); 15% up to $545,500 / $613,700; 20% above that (Rev. Proc. 2025-32). Property held one year or less is taxed at ordinary rates of 10–37%. Depreciation on a rental is recaptured at up to 25%.

How do I calculate capital gains on the sale of a rental property? +

Subtract the adjusted basis (price + purchase costs + improvements − all depreciation allowed) from the sale price net of selling costs. The part equal to depreciation is taxed at your ordinary rate up to 25%; the rest at 0/15/20%; the whole gain may be subject to 3.8% NIIT. There is no exclusion unless you lived in it two of the last five years, and even then the depreciation is still taxed.

Can I avoid capital gains tax on a rental with a 1031 exchange? +

You can defer it: sell the rental and buy replacement investment property through a qualified intermediary, identifying candidates within 45 days and closing within 180, and the gain and recapture roll into the new basis. The deferral ends when you sell without exchanging — or disappears entirely if heirs inherit the property with a stepped-up basis.

Do I pay capital gains if I sell my house after one year? +

If you sell within one year of buying, the gain is short-term and taxed as ordinary income at 10–37%, with no §121 exclusion unless you qualify for a partial one (job move of 50+ miles, health or an unforeseeable event). Between one and two years it is long-term but still unexcluded without a qualifying reason.

Do selling costs and improvements reduce capital gains? +

Yes. Agent commission, transfer tax, title and legal fees come off the sale price, and capital improvements (new roof, kitchen, addition, HVAC, windows) plus your original purchase closing costs are added to your basis. Repairs, mortgage interest and property tax do not count. On a $400,000 sale, 7% of selling costs reduce the gain by $28,000.

Is there capital gains tax on an inherited house? +

Only on the rise in value since the date of death, because your basis is stepped up to the fair market value at that date. Sell soon after and the gain is usually small or a loss; a loss on an inherited house you did not live in is generally deductible as a capital loss.