← Back to Calculators

Capital Gains on Home Sale Calculator

You owe tax only on gain above the home sale exclusion: $250,000 if you file single, $500,000 on a joint return. Enter your purchase, improvements, and sale below to estimate your gain, your exclusion, and the tax for 2026.

1. You

2. The sale

3. Your basis

4. The exclusion

Your estimate

Estimated tax on the sale
$1,200
Taxable gain: $6,000
Amount realized$850,000
Adjusted basis−$344,000
Gain on sale$506,000
Home sale exclusion−$500,000
Taxable gain$6,000
Federal tax on gain$900
State tax$300
Total estimated tax$1,200
What your improvement records are worth

Counting $60,000 of documented improvements lowers this tax bill by $12,000. Without records, you could not support that number if the IRS asked.

Uses 2026 federal thresholds. An estimate for planning, not tax advice; it does not model periods of nonqualified use, the alternative minimum tax, or state-specific rules. Nothing you enter leaves your browser.

The short answer

Most people who sell the home they live in owe no federal income tax on the sale. Section 121 of the tax code lets you exclude up to $250,000 of gain, or $500,000 if you are married and file jointly, as long as you owned the home and lived in it for at least two of the five years before the sale.

Those limits were set in 1997 and have never been adjusted for inflation, while home prices have risen several times over. A couple who bought decades ago in a market that has appreciated steadily can now exceed $500,000 of gain, and a single owner or a surviving spouse can exceed $250,000 much sooner. For those sellers, the size of the tax bill depends on one number they control: the adjusted basis, which rises with every improvement they can document.

How the calculator works

The calculator follows the same steps as the worksheets in IRS Publication 523, Selling Your Home.

  1. Amount realized = sale price − selling expenses.
  2. Adjusted basis = purchase price + purchase closing costs + capital improvements − depreciation claimed.
  3. Gain = amount realized − adjusted basis.
  4. Exclusion. Up to $250,000 or $500,000 of the gain is removed, or a prorated share if you qualify for a partial exclusion. Gain equal to depreciation you claimed cannot be excluded.
  5. Tax. The remaining gain is stacked on top of your other taxable income and taxed at the 2026 long-term rates of 0%, 15%, and 20%. The calculator then adds depreciation recapture at a maximum of 25%, the 3.8% net investment income tax where it applies, and state tax at the rate you enter.

The teal box under the result reruns the whole calculation with your improvements set to zero. The difference is what your improvement records are worth in tax.

A worked example

A married couple bought their home for $280,000 and sells it for $900,000. Over the years they added a new roof, replaced the heating and cooling system, and remodeled the kitchen for a total of $60,000. Their other taxable income is $120,000 and their state taxes the gain at 5%.

StepWith recordsWithout records
Sale price$900,000$900,000
Selling expenses−$50,000−$50,000
Purchase price and closing costs−$284,000−$284,000
Capital improvements−$60,000$0
Gain$506,000$566,000
Exclusion−$500,000−$500,000
Taxable gain$6,000$66,000
Federal tax at 15%$900$9,900
State tax at 5%$300$3,300
Total tax$1,200$13,200

The improvements were real in both columns. The only difference is whether the couple can show what they spent. A folder of invoices is worth $12,000 here.

Who qualifies for the exclusion

You qualify for the full exclusion if you pass three tests on the date of sale.

  • Ownership. You owned the home for at least 24 months of the previous five years.
  • Use. You lived in it as your main home for at least 24 months of the previous five years. The months do not have to be consecutive, and the ownership and use periods can be different.
  • Look-back. You did not exclude gain on the sale of another home during the two years before this sale.

For the $500,000 limit on a joint return, either spouse can meet the ownership test, both spouses must meet the use test, and neither can have used the exclusion in the previous two years. A surviving spouse who has not remarried can still use the $500,000 limit for a sale within two years of the date of death, provided the couple would have qualified immediately before it.

Members of the uniformed services, the Foreign Service, and the intelligence community on qualified extended duty can suspend the five-year period for up to ten years.

Partial exclusion

If you fall short of 24 months, you may still exclude part of the gain when the main reason for selling was a change in workplace, a health issue, or an unforeseen circumstance. Publication 523 lists the qualifying situations, which include a new job at least 50 miles farther from the home, a move to obtain or provide medical care, death, divorce, and becoming eligible for unemployment.

The partial limit is the full limit multiplied by the months you qualified, divided by 24. A single owner who lived in the home for 15 months before a job transfer can exclude up to $250,000 × 15 ÷ 24 = $156,250. Choose the second option under the exclusion heading in the calculator and enter your months.

What counts toward your basis

Basis starts with the purchase price and grows from there. The table sorts common costs by how the IRS treats them.

Adds to basisDoes not add to basis
Additions: bedroom, bathroom, deck, garage, porchPainting, inside or out
New roof, siding, windows, insulationFixing leaks, patching, replacing broken hardware
New heating, central air, water heater, wiring, plumbingServicing and cleaning equipment
Kitchen and bathroom remodels, built-in appliances, flooringImprovements later removed, such as carpet you replaced again
Landscaping, driveway, fence, retaining wall, poolThe value of your own labor
Title insurance, recording fees, survey, and transfer tax from the purchaseLoan costs: points, appraisal, mortgage insurance
Special assessments for local improvements such as sidewalksProperty tax, insurance premiums, utilities

Two details are easy to miss. First, a repair done as part of a larger remodel counts with the remodel, so the paint in a renovated kitchen is part of the kitchen. Second, some things reduce basis: depreciation, insurance reimbursements for casualty losses, and certain energy tax credits and subsidies you received for improvements.

If you inherited the home, your basis is generally its fair market value on the date of the previous owner's death rather than what they paid, which usually wipes out the gain that built up during their lifetime. If you received it as a gift, you generally take over the giver's basis.

Selling expenses

Costs of the sale reduce the amount realized, which reduces the gain. They include agent commissions, advertising, legal fees, title and escrow fees you paid as the seller, transfer tax, and credits paid toward the buyer's closing costs. Moving costs and pre-sale repairs are not selling expenses. The home sale proceeds calculator totals these costs line by line; carry the commission, closing fee, and transfer tax figures over to this page.

2026 tax rates on the taxable gain

If you owned the home for more than one year, gain above the exclusion is a long-term capital gain. It sits on top of your other taxable income, and the rate depends on where that total falls.

Filing status0% up to15% up to20% above
Single$49,450$545,500$545,500
Married filing jointly$98,900$613,700$613,700
Head of household$66,200$579,600$579,600

The thresholds are taxable income for tax year 2026, as published by the IRS in Revenue Procedure 2025-32. Three other taxes can apply.

  • Short-term gain. If you owned the home for one year or less, the gain is taxed as ordinary income at your regular bracket.
  • Net investment income tax. An extra 3.8% applies to taxable gain to the extent your modified adjusted gross income exceeds $200,000, or $250,000 on a joint return. Excluded gain is not counted. These thresholds are not indexed for inflation.
  • State income tax. Most states with an income tax follow the federal exclusion and tax the rest as ordinary income. Several states have no income tax on wages or capital gains.

Home offices, rentals, and depreciation

If you claimed depreciation on part of the home after May 6, 1997, for a home office or for a period when you rented it out, that amount of gain cannot be excluded. It is taxed as unrecaptured Section 1250 gain at your ordinary rate, capped at 25%. The calculator applies the 25% maximum. The simplified home office deduction does not involve depreciation, so it does not trigger recapture.

A separate rule covers homes that were a rental or a second home before you moved in. Time after 2008 when the property was not your main home, before you made it one, is called nonqualified use, and the share of gain allocated to that time cannot be excluded. The calculator does not model nonqualified use. If it applies to you, work through the business and rental section of Publication 523 or ask a tax professional.

Reporting the sale

The closing agent may send you and the IRS a Form 1099-S showing the gross proceeds. If you receive one, or if any of your gain is taxable, report the sale on Form 8949 and Schedule D with your return for the year of sale. If all of the gain is excluded and you did not receive a 1099-S, you generally do not need to report the sale at all. A loss on a personal residence is not deductible.

The records to keep, starting now

Basis is built one project at a time over many years, and it is claimed once, on a single tax return, possibly decades later. Most owners cannot reconstruct it from memory. Contractors go out of business, bank statements age out of online access, and paper receipts fade. Keep these for as long as you own the home, and for at least three years after you file the return for the year you sell:

  • The closing statement from your purchase.
  • For every improvement: the contract, the paid invoice, proof of payment, the permit, and the completion date.
  • Before and after photos, which help show that a project was an improvement and not a repair.
  • Records of any depreciation claimed, energy credits taken, and insurance payouts for damage.
  • The closing statement from the sale.

A running home improvement log is enough to start. Our guide to home documentation covers how to organize the rest.

What the estimate leaves out

This calculator is for planning. It uses 2026 federal figures and does not model nonqualified use, installment sales, like-kind exchanges, the alternative minimum tax, married-filing-separately thresholds, or the way a large gain can affect income-based items such as Medicare premiums. It treats your other taxable income as your modified adjusted gross income when testing the 3.8% tax, and applies your state rate to the whole taxable gain. It is not tax advice. For a sale with taxable gain, confirm the numbers with a tax professional before you file.

Tax figures last reviewed November 2026 for tax year 2026.

Frequently Asked Questions

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

Often none. If you owned and lived in the home for at least two of the five years before the sale, the first $250,000 of gain is excluded from federal tax, or $500,000 on a joint return. Gain above the exclusion is taxed at long-term capital gains rates of 0%, 15%, or 20% depending on your taxable income, plus a 3.8% net investment income tax for higher earners and any state income tax.

How do I calculate the gain on the sale of my home?+

Gain equals the amount realized minus your adjusted basis. The amount realized is the sale price minus selling expenses such as commissions and transfer tax. The adjusted basis is what you paid for the home, plus certain closing costs from the purchase, plus the cost of capital improvements, minus any depreciation you claimed. Your mortgage balance plays no part in the calculation.

What is the 2 out of 5 year rule?+

To claim the full home sale exclusion you must have owned the home for at least 24 months and used it as your main home for at least 24 months during the five years ending on the date of sale. The two periods do not have to be continuous or overlap. You also cannot have excluded gain on another home sale in the two years before this one.

What home improvements can be added to my cost basis?+

Improvements that add value to the home, extend its life, or adapt it to new uses count. Examples include an addition, a new roof, a replacement heating and cooling system, a kitchen or bathroom remodel, new windows, a deck, a fence, a paved driveway, insulation, and a new water heater. Routine repairs and maintenance, such as painting, fixing a leak, or servicing equipment, do not count unless they are part of a larger remodeling project.

Do I have to buy another house to avoid capital gains tax?+

No. That rule ended in 1997. Before then, sellers could defer gain by buying a more expensive home. Today the exclusion depends only on how long you owned and lived in the home you sold, and you can use the money however you like.

What if I lived in the home for less than two years?+

You may qualify for a partial exclusion if the main reason for the sale was a change in workplace, a health issue, or an unforeseen event such as a divorce or job loss. The partial exclusion is the full limit multiplied by the fraction of 24 months that you owned and lived in the home. Twelve months, for example, gives a single filer half of $250,000, or $125,000.

How do I prove home improvements to the IRS?+

Keep the contract, the paid invoice or receipt, proof of payment such as a bank or card statement, and any permit for each project, along with the date it was completed. The IRS expects you to keep records that support your basis for as long as you own the home and for at least three years after you file the return for the year you sell it.

Can I deduct a loss on the sale of my home?+

No. A loss on the sale of a personal residence is not deductible. Losses can be deductible only for the portion of a property used for business or as a rental.

Build your cost basis as you go

MyHomePlatform stores every improvement with its invoice, permit, and date in a digital home record, so the basis you are entitled to is documented on the day you sell.