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 Details
Your Situation
Your income from other sources (excluding this gain)
Required for Section 121 exclusion ($250K/$500K)

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
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.
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

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.
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.
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.
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.
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.
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.
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
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

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

Related Tax Calculators and Guides
Explore our other free tax tools and guides to get the full picture of your capital gains tax obligations across different asset types.