Home Sale

Capital Gains Tax on Home Sale Calculator 2026

Free home sale capital gains tax calculator for 2026. Calculate your tax after Section 121 exclusion ($250K/$500K). Understand the 2-of-5 year rule, primary residence exclusion, capital improvements, and capital gains on vacation homes.

Section 121 exclusion — $250K single, $500K married filing jointly

Home Sale Capital Gains Calculator
Section 121 exclusion — $250K single / $500K married

Home Details

Your Situation

Your income from other sources (excluding this gain)

Required for Section 121 exclusion ($250K/$500K)

Couple reviewing home sale documents with a realtor at a kitchen table

Section 121 Exclusion: The $250,000 / $500,000 Rule

Section 121 of the Internal Revenue Code is one of the biggest tax breaks available to regular homeowners in the United States. It lets you walk away from a profitable home sale without owing a dime in capital gains tax — as long as you stay within the limits.

$500,000

Married Filing Jointly exclusion

Advertisement

Both spouses must meet the use test

$250,000

Single filers and Married Filing Separately

Must meet both ownership and use tests

One of the Most Generous Tax Breaks for Homeowners

If you are a single taxpayer and your profit from selling your primary residence is $250,000 or less, you owe zero capital gains tax on that amount. Married couples filing jointly get double — up to $500,000 of profit completely tax-free. For families who have lived in the same house for a decade or more, this exclusion often wipes out the entire gain, which is real money staying in your pocket.

The exclusion only applies to your capital gain, not to the sale price itself. Your gain is the difference between what you sold the house for (minus selling costs) and your adjusted cost basis. A $700,000 sale price does not automatically trigger a big tax bill — the exclusion takes a big chunk off the top before anything else happens.

Ownership and Use Tests You Must Pass

To qualify for the full exclusion, you need to clear two hurdles. The ownership test: you must have owned the home for at least two years out of the five years right before the sale. The use test: you must have lived in it as your main home for at least two years during that same five-year stretch. The periods do not have to overlap — owning for five straight years while living there during years one and four still works.

Advertisement

For married couples going for the full $500,000, at least one spouse must meet the ownership test, but both must satisfy the use test. If only one spouse lived in the home for the required two years, the exclusion tops out at $250,000 — a detail that catches second-marriage situations off guard.

You Can Use This Exclusion Over and Over

The old rule that let you exclude gain only once after age 55 is long gone. The current Section 121 exclusion can be claimed every two years. That means you could buy a house, live in it for two years, sell it at a profit, take the exclusion, and repeat the cycle. In markets where home values climb steadily, this has become a legitimate tax planning strategy for homeowners who do not mind moving every few years.

Depreciation Recapture Does Not Get Excluded

If you rented out part of your home or used a home office and claimed depreciation deductions, that depreciation does not disappear when you sell. You must "recapture" it at a flat 25% rate, even if the rest of your gain qualifies for the Section 121 exclusion. This catches a lot of former landlords off guard. For investment properties, a 1031 exchange might be a better path to defer the entire gain.

Only Your Principal Residence Counts

This exclusion is strictly for your principal residence. Investment properties, vacation homes, and second homes do not qualify — a beach condo you rent out most of the year cannot use Section 121 when you sell. For those properties, look into a 1031 exchange or plan for the full tax hit.

The 2-Out-of-5 Year Rule Explained

Homeowner carrying a moving box in front of a suburban house

The 2-of-5 year rule is the gatekeeper for the Section 121 exclusion. Miss it, and your entire gain could be taxable. Here is how it really works, including the nuances most people overlook.

The Two Tests You Must Satisfy

Ownership Test

Own the home for at least 24 months during the 5-year period before the sale

Use Test

Live in the home as your principal residence for at least 24 months in that same period

730 Days — Not Necessarily Consecutive

You need 730 days of residency during the 60-month window ending on the sale date, but those days do not have to be back-to-back. Live in the house for a year, move away for two years, come back for another year — the IRS lets you add up all the days, consecutive or scattered.

Short temporary absences count toward your residency total too. A two-week vacation, a month visiting relatives, or a short business trip does not reset your clock — the IRS treats brief absences as if you were still living in the home.

Ownership and Use Are Separate Requirements

Another common misunderstanding: the ownership period and use period do not have to be the same two years. As long as you satisfy both 24-month tests within the same 60-month window — overlapping partially, completely, or not at all — you qualify.

For married couples, the rules split differently. Either spouse can satisfy the ownership test, but both must meet the use test individually. If your spouse never actually lived in the house, the exclusion drops to $250,000.

Special Exceptions for Military and Intelligence

If you are a member of the uniformed services, Foreign Service, or intelligence community on qualified official extended duty, the 5-year testing period can be suspended for up to 10 years. That means a service member who was deployed overseas for several years does not lose their eligibility just because they could not physically live in the home. People who are physically or mentally incapable of self-care and reside in a licensed care facility also get special treatment — their time in the facility counts as time using the home.

Partial Exclusion When Life Gets in the Way

What happens if you have to sell before hitting the two-year mark? A partial exclusion is available when the sale is triggered by unforeseen circumstances: a job move at least 50 miles farther away, a health condition, divorce or legal separation, the death of a spouse, or multiple births. The IRS has also recognized certain natural disasters as qualifying events.

The math is straightforward: take the fraction of the two-year requirement you actually met and multiply it by the full exclusion. Twelve months of residency means up to $125,000 excluded as a single filer, or $250,000 married filing jointly. Use our main capital gains calculator to run your specific numbers.

How to Calculate Your Home Sale Capital Gains

Figuring out your capital gain on a home sale is not just about subtracting what you paid from what you sold it for. There are several adjustments that can significantly change your tax bill — and knowing them can save you thousands.

1

Start With the Sale Price

Take the gross amount you sold the house for. This is the number on your closing statement before any deductions.

2

Subtract Selling Expenses

Real estate agent commissions (typically 5-6%), closing costs, advertising fees, legal fees, and transfer taxes all reduce your realized amount. On a $500,000 sale with a 6% commission, that is $30,000 right off the top.

3

Determine Your Adjusted Cost Basis

Your basis starts with the original purchase price plus certain closing costs (title insurance, survey fees, transfer taxes you paid when buying). Then add the cost of all capital improvements and subtract any depreciation you claimed.

4

Calculate the Gain

Subtract your adjusted cost basis from the net sale price (sale price minus selling expenses). The result is your total capital gain before the Section 121 exclusion.

5

Apply the Section 121 Exclusion

If you qualify, subtract $250,000 (single) or $500,000 (married filing jointly) from your gain. Any remaining amount is your taxable capital gain.

6

Determine Your Tax Rate

If you held the home longer than one year, the remaining gain is taxed at long-term capital gains rates (0%, 15%, or 20%). High earners may also owe the 3.8% Net Investment Income Tax. Check our <Link href="/niit" className="text-emerald-600 hover:underline font-medium">NIIT calculator</Link> to see if it applies to you.

Example: Married Couple Selling Their Home

Purchase price (2015)$320,000
Capital improvements+ $60,000
Adjusted cost basis$380,000
Sale price (2026)$750,000
Selling expenses (6% commission)- $45,000
Net sale price$705,000
Capital gain$325,000
After $500K exclusion (MFJ)$0 taxable

The entire $325,000 gain falls well within the $500,000 married exclusion. This couple owes zero capital gains tax on the sale of their home.

How to Qualify for the Home Sale Tax Exclusion

Qualifying is not automatic — you have to actively meet the requirements and keep the right records. Here is a breakdown of each qualification factor and what you need to document.

Meet the Ownership Test

You must have owned the home for at least 24 months during the 5-year period ending on the sale date, established by having your name on the deed, title, or contract. If you inherited the home, your ownership period includes the previous owner's time — heirs often qualify immediately. In a divorce settlement, you can count your ex-spouse's ownership time, and joint tenants each get credit for the full period.

One caution: if your name was recently added to the deed (say, a parent transferred the home to you), your ownership clock starts from that date, not from when the original owner bought it. Inheritance is the exception.

Meet the Use Test

You must have lived in the home as your principal residence for at least 24 months of the same five years. The IRS defines "principal residence" as the place you live most of the time, judged by where you work, where your family lives, and the address on your tax returns, voter registration, and driver's license. Only one property can be your principal residence at a time.

Short absences for vacation, medical treatment, or education count as periods of use — summers at a lake cabin do not break your residency streak, a big relief for snowbirds and frequent travelers.

Special Rules for Married Couples

Married couples filing jointly can exclude up to $500,000 if both spouses meet the use test and at least one meets the ownership test. If either spouse used the exclusion on a different home within the past two years, the available amount is reduced.

Filing separately does not double the exclusion — each spouse can exclude up to $250,000, and both must independently meet the tests. Most couples stick with the joint return for the full $500,000 benefit.

Timing Your Sale Properly

The two-year waiting period between exclusions runs from the date of the previous sale. If you claimed the exclusion on March 15, 2024, you cannot use it again until after March 15, 2026. This is a third requirement on top of the ownership and use tests, and being a few days short can disqualify you — so verify your dates before listing.

Capital Improvements That Reduce Your Tax Bill

Contractor installing new kitchen cabinets during a renovation

Every dollar you spend on a qualifying capital improvement increases your cost basis, which directly shrinks your taxable gain. The difference between a capital improvement and a simple repair can mean thousands in saved taxes.

Capital Improvements (Add to Basis)

  • Room additions and extensions
  • New roof or complete roof replacement
  • Kitchen or bathroom renovation
  • Central HVAC installation
  • New deck, patio, or porch
  • Swimming pool installation
  • New fencing or retaining walls
  • Landscaping that adds value
  • Water heater or plumbing upgrades
  • Electrical system rewiring

Repairs (Do NOT Add to Basis)

  • Interior or exterior painting
  • Fixing leaks or patching drywall
  • Replacing broken window panes
  • Minor plumbing or electrical fixes
  • Cleaning or pest control
  • Replacing carpet (usually considered a repair)
  • Appliance replacement (same quality)
  • Gutter cleaning or repair
  • Weather-stripping or caulking
  • Lawn mowing and basic yard work

Keep Every Receipt — Even From Years Ago

The IRS expects you to substantiate every capital improvement you claim. That means keeping receipts, contractor invoices, permits, and before-and-after photos. If you built a $40,000 addition in 2018 but cannot find the paperwork, you could end up paying tax on $40,000 more gain than necessary. Set up a folder (physical or digital) for each property and toss every home improvement receipt in there. Future you will be grateful at tax time.

Capital Gains on Vacation Homes and Second Homes

Vacation homes, second homes, and rental properties play by different rules. If you are selling a property that was never your primary residence, the Section 121 exclusion will not help you.

No Section 121 Exclusion for Vacation or Second Homes

The entire capital gain from the sale of a vacation home or second home is subject to capital gains tax. The $250,000/$500,000 exclusion does not apply because these properties are not your principal residence.

Full Tax on the Entire Gain

When you sell a vacation home or second home at a profit, the whole gain is taxable. Held over one year, long-term rates (0%, 15%, or 20%) apply plus the 3.8% NIIT for high earners; held one year or less, ordinary income rates up to 37% apply. On a $200,000 gain, that is the difference between roughly $30,000 and $74,000 in tax.

Depreciation Recapture on Rental Properties

If your vacation home was also a rental property, depreciation you claimed during the rental period is recaptured at a flat 25% when you sell — separate from and in addition to the regular capital gains tax. $30,000 of depreciation means $7,500 in recapture tax regardless of your bracket.

If the property was used for both personal and rental purposes, you need to allocate the gain between the personal portion and the rental portion. The personal portion is taxed at regular capital gains rates, while the rental portion may trigger depreciation recapture. This allocation is based on the ratio of rental days to total days of use.

Deferring Tax With a 1031 Exchange

For investment properties and rental homes, a 1031 exchange can be a game-changer. This provision lets you defer all capital gains tax by rolling the proceeds from the sale into another investment property of equal or greater value. There is no limit on how many times you can do this, which means some investors defer taxes indefinitely through a series of exchanges.

The rules are strict: 45 days to identify a replacement property, 180 days to close, and a qualified intermediary must hold the money — you cannot touch it. Visit our real estate capital gains calculator to crunch the numbers on your investment property sale.

Converting a Rental to Your Primary Residence

Some people try to convert a rental property into their primary residence to qualify for the Section 121 exclusion. While this can work, the IRS added rules in 2009 that require you to allocate the gain between the rental period and the personal-use period. The depreciation recapture portion is still taxed at 25%, and only the personal-use portion of the gain can be excluded under Section 121. It is not the simple loophole it used to be, but it can still reduce your tax bill significantly if done correctly.

Common Mistakes Home Sellers Make With Capital Gains Tax

Even experienced homeowners trip up on these. Knowing what went wrong for others can help you avoid the same expensive errors.

Forgetting to Track Capital Improvements

Every dollar of improvement you cannot document is a dollar added to your taxable gain. That $25,000 kitchen renovation from 2019? Without a receipt, the IRS will not let you add it to your basis. Set up a simple filing system and keep every invoice.

Selling Just Before the 2-Year Mark

Being one month short of the 2-year residency requirement can cost you the entire exclusion. On a $300,000 gain, that could mean paying $45,000 in tax that you could have avoided by waiting a few more weeks.

Ignoring Depreciation Recapture

If you claimed home office depreciation or rented out part of your home, that depreciation must be recaptured at 25% when you sell. Many sellers are blindsided by this tax because they assumed the Section 121 exclusion covered everything.

Assuming Both Spouses Automatically Get $500K

Both spouses must meet the use test for the full $500,000 exclusion. If one spouse never lived in the home, the exclusion drops to $250,000. This happens often in second marriages or when one spouse inherits property.

Not Counting Selling Costs Against the Gain

Real estate commissions, title fees, legal costs, and transfer taxes all reduce your capital gain. On a $600,000 sale with 6% commission, that is $36,000 less in taxable gain. Do not leave this money on the table.

Using the Exclusion Too Frequently

You can only use the Section 121 exclusion once every two years. If you sold a home and claimed the exclusion 18 months ago, you cannot claim it again on a new sale — even if you meet the ownership and use tests.

State Capital Gains Tax on Home Sales

The Section 121 exclusion is a federal provision, but most states also honor it on your state return. However, a handful of states have their own capital gains rules that can add a layer of tax on top of what you owe the IRS.

States With No Income Tax

If you live in Florida, Texas, Nevada, Wyoming, Washington, South Dakota, Alaska, Tennessee, or New Hampshire, you only owe federal capital gains tax on your home sale — these states have no personal income tax. It is one reason retirees often relocate before selling appreciated properties, especially from states like California where the top rate exceeds 13%.

High-Tax States to Watch Out For

California treats capital gains as ordinary income, with a top rate of 13.3%. New York, New Jersey, Connecticut, and Minnesota also impose significant state-level capital gains taxes. In California, a $200,000 taxable capital gain on a home sale could trigger roughly $26,600 in state tax alone, on top of the federal bill. Check our state capital gains tax rates page for the full breakdown by state.

Most States Conform to the Federal Exclusion

The good news is that most states that have income tax also follow the federal Section 121 exclusion. This means your $250,000 or $500,000 exclusion applies at the state level too. But a few states have their own adjustments or additions, so it is worth checking your specific state rules or consulting a local tax professional before filing.

Home Sale Capital Gains Quick Reference

Single Exclusion

$250,000

Maximum capital gains exclusion for single filers and married filing separately

Married Exclusion

$500,000

Maximum capital gains exclusion for married couples filing jointly

Residency Requirement

2 of 5 Years

Must own and use as principal residence for 24 of 60 months before sale

Improvements

Add to Basis

Capital improvements reduce your taxable gain dollar for dollar

Recapture Rate

25% Flat

Depreciation recapture applies regardless of your income bracket

Reuse Period

Every 2 Years

You can claim the exclusion again two years after your last qualified sale

Advertisement

Frequently Asked Questions

How much can I exclude from capital gains when selling my home?
Under Section 121, single filers can exclude up to $250,000 and married couples filing jointly can exclude up to $500,000 of capital gains from the sale of their primary residence. You must have owned and lived in the home for at least 2 of the 5 years before the sale. This exclusion can be used every two years, so you do not need to wait until you are over 55 or buy a replacement home to qualify.
What is the 2-out-of-5 year rule for home sales?
The 2-out-of-5 year rule means you must have both owned and used the home as your principal residence for at least 24 months (730 days) during the 5-year period ending on the date of sale. The 24 months do not need to be consecutive. You can add up shorter periods of living in the home to reach 730 days, as long as all those days fall within the 5-year window. Short temporary absences for vacation or medical care also count toward your residency days.
Can I use the Section 121 exclusion more than once in my lifetime?
Yes, you can claim the Section 121 exclusion multiple times, but only once every two years. If you sold a home and used the exclusion, you generally cannot use it again until two years have passed since that sale date. Members of the uniformed services, Foreign Service, and intelligence community may get an extended suspension of the 5-year period for up to 10 years while on qualified official extended duty.
Do I have to pay capital gains tax on a vacation home or second home?
Yes. Vacation homes and second homes do not qualify for the Section 121 exclusion because they are not your principal residence. When you sell, the entire capital gain is subject to tax. If you held the property longer than one year, long-term capital gains rates (0%, 15%, or 20%) apply. If the property was rented, you may also owe depreciation recapture at 25%. A 1031 exchange might let you defer the gain by reinvesting in another investment property.
What counts as a capital improvement for reducing my home sale gain?
Capital improvements are additions or changes that add value to your home, prolong its useful life, or adapt it to a new use. Examples include adding a room, installing a new roof, renovating a kitchen, building a deck, or installing central air conditioning. Routine repairs like painting or fixing leaks do not count. Capital improvement costs get added to your cost basis, which directly reduces your taxable capital gain when you sell.
What happens if I sell my home before living there 2 years?
If you sell before meeting the 2-year ownership and use test, you generally cannot claim the full Section 121 exclusion. However, a partial exclusion may be available if the sale is due to a change in employment location (at least 50 miles farther), health issues, divorce, death of a spouse, or other unforeseen circumstances. The partial exclusion is prorated based on how much of the 2-year requirement you actually met.
Does the Section 121 exclusion cover depreciation recapture?
No. The Section 121 exclusion does not apply to depreciation recapture. If you used part of your home for business or rental purposes and claimed depreciation, that depreciation must be recaptured at a maximum rate of 25%, regardless of whether the rest of your gain qualifies for the exclusion. This unrecaptured Section 1250 gain is reported separately on your tax return.
How do I calculate the cost basis of my home for capital gains?
Your cost basis starts with what you paid for the home (the purchase price), plus certain closing costs like title insurance, legal fees, and transfer taxes. Then add the cost of all capital improvements you made over the years, and subtract any depreciation claimed for business or rental use. The result is your adjusted cost basis. Your capital gain equals the sale price minus selling expenses minus your adjusted basis.
Are closing costs deductible when selling a home?
Closing costs are not directly deductible, but they reduce your capital gain instead. When you sell a home, you can subtract selling expenses like real estate agent commissions, title fees, legal fees, advertising costs, and transfer taxes from the sale price. This lowers your realized gain, which means less capital gains tax. These selling expenses are reported on Schedule D along with the sale.
Can a married couple exclude $500,000 if only one spouse owns the home?
Yes, as long as both spouses meet the use test (lived in the home for 2 of the last 5 years) and at least one spouse meets the ownership test. If only one spouse meets the use test, the exclusion is limited to $250,000. If either spouse used the exclusion within the past two years on a different home, the maximum exclusion is also reduced to $250,000 for that spouse's portion.