Free — No Account Required We Never Share Your Data Sources & method · Updated Nov 2026

Home Sale Capital Gains Tax Calculator: $250,000 / $500,000 Exclusion for 2026

Quick Answer

If you owned and lived in your home for at least 2 of the last 5 years, you can exclude up to $250,000 of gain, or $500,000 on a joint return. Gain above that is taxed at 0%, 15% or 20%, with a possible 3.8% surtax at higher incomes. Your gain is the selling price minus selling costs minus your basis (what you paid plus improvements). Many retirees who sell and downsize owe nothing.

Source: IRS Topic 701, Sale of Your Home

Agent commissions, advertising, legal fees and seller-paid closing costs. They reduce your gain.

The purchase price plus the closing costs you paid when you bought it. If you inherited the home, use its value at the date of death, or see the inherited property tool.

A new roof, an addition, a kitchen remodel, new windows. Routine repairs and painting do not count.

A home held a year or less is taxed as short-term gain.

Up to 60. You need 24 for the full exclusion.

As your main home. Up to 60. You need 24.

Pensions, IRA withdrawals, wages, interest and dividends, before the standard deduction. Used to see which rate the gain falls in.

Total benefits received. A gain can make more of them taxable.

Used for the extra standard deduction and the $6,000 senior deduction, which a large gain can shrink.

Special situations (optional): rental or office use, care facility, earlier sale, job change, death of a spouse

From renting a room or using part of the home for business. That part of the gain cannot be excluded and is taxed at up to 25%.

Counts as living in the home if you could not care for yourself and had lived there at least 12 months.

For example, time it was a rental before you moved in.

These reasons can earn a partial exclusion.

Figures are for a sale in 2026 and cover federal tax only. State tax is not included. The calculator is for your main home. It is not for a second home, a rental property, or an inherited house, which follow different rules.

How Capital Gains Tax on a Home Sale Is Calculated

The tax on a home sale comes down to five steps. The calculator above does all of them, and it helps to know what each one is so you can check the result against your own records.

  1. Find the amount realized. This is the selling price minus your selling expenses. Selling expenses include agent commissions, advertising, legal fees and any loan charges you paid for the buyer.
  2. Find your basis. Your basis is what you paid for the home plus the closing costs you paid when you bought it, plus the cost of improvements that add value or last more than a year. Repairs and routine maintenance are not added.
  3. Subtract to get your gain. Amount realized minus basis is your gain. If the answer is negative, you have a loss, and a loss on your main home cannot be deducted.
  4. Apply the exclusion. If you pass the ownership and use tests, the first $250,000 of gain ($500,000 if you file jointly and both qualify) is excluded from income.
  5. Tax what is left. Any gain above the exclusion is taxed. Gain on a home you owned for more than a year is taxed at the long-term rates of 0%, 15% or 20%, which depend on your total taxable income for the year, not just the gain.

One thing most basic calculators skip is the fifth step. The tax rate on the gain depends on the rest of your income, and for a retiree who collects Social Security, the gain can also change how much of that Social Security is taxed and how big a deduction you get. The calculator includes those effects.

Home Sale Exclusion Rules: The $250,000 and $500,000 Limits

The IRS calls this the home sale exclusion. It lets you leave a large part of your profit out of your income entirely, so no tax is figured on it. The rules come from IRS Topic 701 and Publication 523.

Home sale exclusion limits and requirements
SituationMaximum exclusionWhat you need
Single, head of household, or qualifying surviving spouse$250,000Own and use the home 24 months each in the last 5 years
Married filing jointly, both spouses qualify$500,000Either spouse meets the ownership test, and both spouses meet the use test
Married filing jointly, only one spouse meets the use test$250,000One spouse meets both tests
Surviving spouse, sold within 2 years of the death, not remarried$500,000The tests were met at the date of death
Sold earlier than 24 months for a job, health or unforeseen reasonA fraction of $250,000 or $500,000Prorated by months out of 24

Two more rules apply to every sale. First, the exclusion is for your main home, the place where you actually live. It does not cover a vacation home or a rental. Second, you generally cannot use the exclusion if you excluded gain from another home sale in the 2 years before this sale. That means a couple who sells one home and another within 2 years can use the full exclusion only once, unless a special reason gives a partial amount.

The exclusion also stays available if you are paid over several years. If part of the price is paid in a later year, the IRS treats the sale as an installment sale, and the exclusion remains available even when the installment method defers some of the gain.

The 2 Out of 5 Year Rule, Explained With Examples

The rule has two tests, and they are separate. You must pass both during the 5-year period that ends on the day you sell.

  • Ownership test: you (or your spouse, on a joint return) owned the home for at least 24 months.
  • Use test: you lived in the home as your main residence for at least 24 months. On a joint return, each spouse must pass this test.

The 24 months do not have to be in a row, and the owning months and living months do not have to be the same months. You could, for example, live in a home for 18 months, rent it out for 2 years, move back in for 6 months, and sell. You have 24 months of use inside the 5-year window.

ExampleSomeone who moved out 3 years ago

Hypothetical.

A retiree lived in her house for 20 years, moved in with her daughter 3 years ago, and sells today. Looking back 5 years from the sale, she lived in the house for the first 2 years and has been away for the last 3. She has 24 months of use in the window, so she passes. If she waits one more year to sell, she would only have 12 months of use in the window, and she would lose the full exclusion.

That example is why timing matters. If you have already moved out, check the date: the 5-year look-back keeps moving, and every month you wait can reduce your months of use inside it.

Members of the military and certain others on qualified official extended duty can choose to suspend the 5-year period for up to 10 years. Topic 701 describes duty of more than 90 days or indefinite length at a station at least 50 miles from the home, or in government housing under government orders.

Selling a Home to Move Into Assisted Living or a Nursing Home

This is one of the most common reasons a senior sells, and the rules help you here. Publication 523 relaxes the use test for people who become physically or mentally unable to care for themselves. If that is you, time spent in a facility counts as time living at home, with these conditions:

  • You owned the home and lived in it as your main home for at least 1 year during the 5 years before the sale.
  • You owned the home for at least 24 months in that 5-year period.
  • The facility is licensed by a state or local government to care for people in your condition, such as a nursing home or an assisted living community.

A year of living in the home, plus time in a care facility, can add up to the 24 months of use. The calculator has a box for this under "Special situations."

ExampleSingle, 14 months at home and 30 months in a facility

Hypothetical.

A single homeowner paid $190,000 for the home and sells it for $520,000 with $31,200 of selling costs. She lived in it for 14 months of the last 5 years and then moved into a licensed memory care facility for 30 months, having owned the home the whole time. Because she lived there at least 12 months, the 30 facility months count as use. That gives 44 months, enough for the exclusion. Her gain is $298,800, her exclusion is $250,000, and her taxable gain is $48,800. Without the care facility rule she would have had only 14 months of use and no exclusion at all, unless another reason applied.

If you are weighing a move to a care community, the care facility cost comparison shows what each type of care costs, and the long-term care savings runway calculator shows how long your savings, including the proceeds of the sale, could last.

Selling After a Spouse Dies: The Surviving Spouse Rule

If your spouse has died, you may be able to keep the larger $500,000 exclusion even though you now file as a single person. Publication 523 sets these conditions:

  • The sale is no more than 2 years after your spouse's death.
  • You have not remarried.
  • You and your spouse met the use test at the time of the death, and one of you met the ownership test.
  • Neither of you had excluded gain on another home sale in the 2 years before the death.

You are treated as having owned and lived in the home for any period your spouse did. After the 2-year window the exclusion drops back to $250,000. The 2 years run from the date of death, not the end of the tax year, so counting the date carefully matters when the home has risen in value.

ExampleA widow who sells within the 2-year window

Hypothetical.

She and her husband paid $250,000 for the home and added $40,000 of improvements. She sells for $1,000,000 with $60,000 of costs. Her gain is $650,000. With the surviving spouse rule, her exclusion is $500,000, so her taxable gain is $150,000 and the sale adds $21,747 of federal tax. If she had waited past the 2 years, only $250,000 could have been excluded.

If you inherited a home from a spouse who died, or you are settling an estate, see the inherited property capital gains calculator. The basis of a home you inherit can change at death, and that can matter more than the exclusion.

Partial Exclusion: Job Change, Health, or Unforeseen Circumstances

If you sold before you reached 24 months of ownership and use, or you used the exclusion within the last 2 years, you may still get part of it. Publication 523 allows a reduced maximum exclusion when the main reason for the sale was one of these:

  • A change in place of employment. The new workplace is at least 50 miles farther from the home you sold than your old workplace was.
  • Health. The sale was to obtain, provide or facilitate diagnosis, cure, mitigation or treatment of a disease, illness or injury, for you or a close family member.
  • Unforeseen circumstances. An event you could not reasonably have predicted when you bought and moved in, such as a death, a divorce, or a job loss that qualified you for unemployment.

The reduced maximum is the full $250,000 (or $500,000) multiplied by the shortest of three periods divided by 24 months: how long you owned the home, how long you lived in it, or the time since your last exclusion. If you owned and lived in the home for 12 months and sold because of a job change, your maximum is half: $125,000 on a single return.

How to Calculate Your Home's Cost Basis

The most common error in a home sale calculation is using only the purchase price as the basis. Your basis is usually higher, and a higher basis means a smaller gain. Use the list below as a record-hunting guide.

What goes into your basis

  • The purchase price, including the mortgage you took on.
  • Settlement costs you paid at purchase that are not deductible, such as title insurance, recording fees and legal fees.
  • Improvements that add value, extend the home's life, or adapt it to a new use: a room addition, a new roof, a new furnace, a deck, new windows, a remodeled kitchen or bathroom, a new septic system.
  • Special assessments for local improvements, such as sidewalks or sewers.

What does not go into your basis

  • Repairs and routine maintenance that keep the home in good condition, such as repainting or fixing a leak.
  • Improvements you removed or replaced. If you replaced a roof, the cost of the old one comes out.
  • Costs of selling, which reduce the amount you receive instead.

Keep the closing statement from your purchase and receipts for large projects. If you cannot find them, ask your title company or county recorder for copies of the purchase documents, and check old bank statements and contractor invoices for improvements. A homeowner who has lived in a house for 30 years and cannot show $60,000 of improvements may pay tax on gain that was never really there.

Capital Gains Tax Rates for 2026 and Where Your Gain Lands

Gain from a home you owned for more than a year is a long-term capital gain. The rate depends on your taxable income, including the gain itself. Taxable income means income after the standard deduction and other deductions. Rev. Proc. 2025-32 sets these 2026 limits:

2026 long-term capital gains rates by taxable income
Filing status0% up to15% up to20% above
Single$49,450$545,500$545,500
Married filing jointly or surviving spouse$98,900$613,700$613,700
Head of household$66,200$579,600$579,600

Because the 0% band is based on taxable income, a retiree with modest other income can have part of the taxable gain taxed at 0%. The table below shows what a single filer with $40,000 of other income and no Social Security would owe on different gains, before any state tax. The first $250,000 is excluded in every row.

Single filer, $40,000 of other income, qualifies for the $250,000 exclusion
Total gainTaxable gainAdded income tax3.8% NIITTotal
$275,000$25,000$0$0$0
$300,000$50,000$3,668$0$3,668
$350,000$100,000$11,168$0$11,168
$400,000$150,000$18,668$0$18,668
$500,000$250,000$33,668$3,420$37,088
$650,000$400,000$56,168$9,120$65,288

Look at the first row. A $275,000 gain leaves a $25,000 taxable gain, and because other income is low, the whole amount sits inside the 0% band, so the tax is $0. In the second row the taxable gain reaches into the 15% band, and each larger gain costs more. The last two rows also pay the 3.8% net investment income tax, because total income passes $200,000.

If you owned the home for a year or less, the gain is short-term and is taxed at your ordinary rates instead. That only affects people who sell quickly, and the exclusion usually does not apply either unless a special reason does.

The 3.8% net investment income tax

The taxable part of a home sale gain counts as net investment income. When your modified adjusted gross income is above $200,000 (single or head of household) or $250,000 (joint), a 3.8% tax applies to the smaller of the investment income or the amount over the threshold. These thresholds are fixed by law and are not adjusted for inflation. The excluded gain is not counted, so the tax only applies to the gain above the exclusion. See the IRS page on the net investment income tax ↗.

The Hidden Costs for Retirees: Social Security, Senior Deduction and Medicare

A taxable home sale gain does not just add the tax on the gain. It raises your income for the whole year, and that can set off three other costs that a basic capital gains calculator never shows.

1. More of your Social Security becomes taxable

How much of your Social Security is taxed depends on your combined income, and the gain is part of it. A gain can move you from paying tax on part of your benefit to paying tax on up to 85% of it. The Social Security tax calculator shows the effect for your numbers.

2. The $6,000 senior deduction shrinks

The senior deduction of up to $6,000 per person aged 65 or older (tax years 2025 through 2028) is reduced by 6% of your income above $75,000 ($150,000 if you file jointly). A large gain pushes your income into that range, which removes part of the deduction and raises your tax. The senior deduction calculator shows where your deduction ends.

3. Medicare surcharges two years later

Medicare sets your IRMAA surcharge using your income from two years earlier. A taxable gain in 2026 can raise your Part B and Part D premiums in 2028. Even a modest taxable gain can cross a threshold. Check where your income lands in the IRMAA calculator and the MAGI for Medicare calculator, and if a surcharge is already set because of a one-time sale, the IRMAA appeal tool explains the option to ask for a reduction after certain life-changing events.

The table shows the same single retiree, with and without Social Security, selling for a gain above the exclusion. The figures come from the same engine as the calculator.

Single, age 65 or older, $35,000 of other income, taxable gain of $246,800
No Social Security$22,000 of Social Security
Federal tax caused by the sale$35,927$39,954
Extra Social Security made taxable$0$4,000
Senior deduction lost$6,000$6,000
Income Medicare will see two years later (approx.)$281,800$300,500

The Medicare income figure is the adjusted gross income with the gain. Medicare's own thresholds change each year, so check them for the year two years after your sale.

Rental Use, a Home Office, and Depreciation on a Home Sale

If you rented out part of your home or used part of it for business after May 6, 1997, you may have claimed depreciation, or you may have been allowed to. The tax law says depreciation allowed or allowable counts, so it applies even if you never claimed it. Two things follow from it:

  • Your basis is reduced by the depreciation, which makes the gain larger.
  • The part of the gain equal to the depreciation cannot be excluded. It is taxed as unrecaptured section 1250 gain, at your ordinary rate but no more than 25%.

A home office inside the house, used as part of your living space, does not need to be split out from the rest of the home in the exclusion. A separate rented or business area is reported on Form 4797.

Nonqualified use is a different issue. If, after 2008, the house was a rental or a second home before you made it your main home, a share of the gain equal to the months of that use divided by your total months of ownership cannot be excluded. The calculator has boxes for both under "Special situations."

ExampleA single retiree who claimed $24,000 of depreciation

Hypothetical.

She sells for $600,000 with $36,000 of costs. She paid $220,000 and added $20,000 of improvements, and she took $24,000 of depreciation on a rented room. Her adjusted basis is $216,000 and her gain is $348,000. Of that, $24,000 is depreciation gain that cannot be excluded. She still excludes $250,000, leaving $98,000 taxable, and the sale adds $14,392 of federal tax.

Worked Examples

ExampleA couple downsizing after 27 years

Hypothetical.

A married couple, both over 65, bought their home for $180,000, added $60,000 of improvements, and sell for $900,000 with $54,000 of selling costs. The amount realized is $846,000 and the basis is $240,000, so the gain is $606,000. Both lived there and the exclusion is $500,000, which leaves $106,000 taxable. Even with $60,000 of other income and $40,000 of Social Security, the sale adds $9,660 of federal tax. Their income with the sale is about $200,000.

ExampleA single retiree with a large gain

Hypothetical.

A single retiree, 70, bought for $150,000, added $30,000 of improvements, and sells for $720,000 with $43,200 of costs. The gain is $496,800. The exclusion is $250,000, so $246,800 is taxable. With $35,000 of other income and $22,000 of Social Security, the federal tax caused by the sale is $39,954. Of that, $36,135 is income tax and $3,819 is net investment income tax. The gain also makes another $4,000 of Social Security taxable and removes $6,000 of the senior deduction, and both of those costs are inside the income tax figure.

How to Report a Home Sale: Form 1099-S, Schedule D and Form 8949

Whether you must report the sale depends on two things. If you receive a Form 1099-S from the settlement agent, you must report the sale on your return, even if all of the gain is excluded. If you do not get one, you report only if some of the gain is taxable.

When reporting is required, the sale goes on Form 8949 and Schedule D (Form 1040). On Form 8949 you show the exclusion as an adjustment, so that only the taxable gain carries to Schedule D. Keep your purchase closing statement, your records of improvements, and the closing statement from the sale for at least as long as the IRS can examine the return.

If you will owe tax on the gain, remember that none is withheld at closing. A large taxable gain can mean an underpayment penalty unless you make an estimated payment or have enough withholding from other income. The retirement tax withholding calculator shows how to adjust withholding from a pension or IRA to cover it.

Legitimate Ways to Lower the Tax on a Home Sale

  • Add up every improvement. A higher basis directly reduces the gain. This is the single biggest change most sellers can make.
  • Count the 5-year window before you list. If you are close to 24 months of use, a few months can be the difference between a full exclusion and none.
  • Use the surviving spouse window. If you are widowed, selling within 2 years keeps the $500,000 exclusion.
  • Check the care facility rule. If you are moving to assisted living or a nursing home, time there can count as time at home.
  • Pick the tax year. Closing in January instead of December can move the gain into a different year, which can change which rate it falls into and which Medicare year it affects.
  • Deduct selling costs. They reduce the amount realized, so make sure every commission and fee is in your total.
  • Plan the other income. If you control when you take IRA withdrawals or Roth conversions, taking less in the sale year can keep more of the gain in the 0% and 15% bands. The retirement tax calculator and the Roth conversion calculator help with that.

These are ordinary planning steps and not a substitute for advice. For a large sale, especially one involving rental use, a divorce, or an inherited share, a tax professional who sees the whole return is worth the fee.

Home Sale Capital Gains Tax FAQs

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

It depends on your gain and your other income. If you owned and lived in the home for at least 2 of the last 5 years, the first $250,000 of gain ($500,000 on a joint return) is excluded. Any gain above that is taxed at 0%, 15% or 20% for long-term gains, depending on your total taxable income, and may also be hit by the 3.8% net investment income tax at higher incomes. Many retirees owe nothing.

What is the home sale exclusion for 2026?

Up to $250,000 of gain from the sale of your main home is excluded from income, or up to $500,000 if you file jointly. The amounts are set by law and are not adjusted for inflation. You must meet the ownership and use tests, which each require 24 months in the 5 years before the sale.

What is the 2 out of 5 year rule for selling a home?

To claim the full exclusion you must have owned the home for at least 24 months, and lived in it as your main home for at least 24 months, during the 5 years ending on the date of the sale. The two periods do not have to be the same months and do not have to be consecutive. On a joint return, both spouses must meet the use test.

Can I exclude the gain if I sell my home to move into assisted living or a nursing home?

Often yes. If you become physically or mentally unable to care for yourself, time you spend in a licensed care facility counts as time living in the home, as long as you owned the home and lived in it as your main home for at least a year in the 5-year period. You still need to have owned the home for at least 24 months.

I am a widow or widower. Can I still exclude $500,000?

Yes, if you sell within 2 years after your spouse died, you have not remarried, and the ownership and use tests were met at the time of death. After that 2-year window the limit goes back to $250,000.

Can I get a partial exclusion if I sold before living there 2 years?

Yes, if the main reason for selling was a change in your job (to a workplace at least 50 miles farther away), your health, or unforeseen circumstances. The $250,000 or $500,000 limit is cut in proportion to the months you did qualify out of 24. Six months of qualifying use, for example, gives one quarter of the full amount.

Does a big home sale raise my Medicare premiums?

It can. Medicare uses your modified adjusted gross income from two years earlier to set IRMAA surcharges, and the taxable part of a home sale is included in it. A sale in 2026 shows up in 2028 premiums. If the gain is fully excluded, it does not count, so most people with gains under the exclusion are not affected.

Do I have to report the sale if all the gain is excluded?

Only if you received Form 1099-S or you cannot exclude all of the gain. If you did get a Form 1099-S, report the sale even when none of it is taxable. If you did not receive one and the whole gain is excluded, nothing is reported.

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

No. A loss on the sale of your main home cannot be deducted. If you received a Form 1099-S for a sale at a loss, you still report it on Schedule D and Form 8949.

Does buying another house avoid the tax?

No. Buying a more expensive replacement home does not defer or reduce the tax on the gain. The exclusion is the main tool for seniors who sell and downsize.

Official Sources and How We Calculate

The calculator follows IRS Topic 701 and Publication 523 for the exclusion, and Rev. Proc. 2025-32 for the 2026 rates, brackets and standard deductions. It figures the tax on the sale as the difference between your 2026 tax with the sale and without it, which captures the effect on taxable Social Security and the senior deduction. Unrecaptured section 1250 gain is taxed at your ordinary rates up to 25%, and long-term gain is stacked on top of your other taxable income. The net investment income tax uses the statutory $200,000 and $250,000 thresholds. We treat all other income as ordinary income and do not include state tax, alternative minimum tax, or other net investment income. The Publication 523 rules were read in the IRS's 2010 edition, in which the rules cited here already applied, and the law has not changed on these points.

SourceWhat we used it for
IRS Topic no. 701, Sale of Your HomeThe $250,000 and $500,000 exclusion, ownership and use tests, once-every-2-years rule, reporting
IRS Publication 523, Selling Your HomeBasis, partial exclusion, surviving spouse, care facility rule, depreciation, nonqualified use
IRS Rev. Proc. 2025-322026 capital gains thresholds, tax brackets, standard deduction
IRS: Net Investment Income TaxThe 3.8% tax and its income thresholds
IRS: About Form 8949Reporting a sale on Form 8949 and Schedule D

Estimate only, federal tax only. Your tax return and a tax professional decide the final amount. We do not store what you enter.

Educational Disclosure: This guide is for educational purposes only. Government rules, benefit levels, and tax limits change frequently. While we strive to present accurate information, it should not be taken as legal, tax, or financial advice. We encourage you to review official guidance on government portals (like IRS.gov or SSA.gov) and consult with a qualified professional before making final retirement or benefit elections.