/* Legacy content CSS (original compiled Tailwind v4) - static, loads first */
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
Your income from other sources (excluding this gain)
Required for Section 121 exclusion ($250K/$500K)
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
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 that — up to $500,000 of profit completely tax-free. For a lot of families, especially those who have lived in the same house for a decade or more, this exclusion wipes out the entire gain. Think about it: if you bought a home for $300,000 and sold it years later for $750,000, the $450,000 profit could be entirely excluded if you are married and qualify. That 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 (what you paid plus improvements minus depreciation). This distinction matters because a $700,000 sale price does not automatically trigger a big tax bill — it is the gain that gets taxed, and the exclusion takes a big chunk off the top before anything else happens.
To qualify for the full exclusion, you need to clear two hurdles. First, the ownership test: you must have owned the home for at least two years out of the five years right before the sale. Second, the use test: you must have actually lived in it as your main home for at least two years during that same five-year stretch. These two-year periods do not have to overlap — you could have owned the place for five straight years but only lived in it during years one and four, and that still works.
For married couples going for the full $500,000, at least one spouse needs to meet the ownership test, but both spouses 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 regardless of filing status. This catches some people off guard, especially in second-marriage situations where one spouse moved into the other's existing home.
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.
This exclusion is strictly for your principal residence. Investment properties, vacation homes, and second homes do not qualify — period. If you own a beach condo that you rent out most of the year and visit for two weeks every summer, that condo cannot use Section 121 when you sell it. The IRS is very clear about this distinction. For those properties, you will want to look into a 1031 exchange or plan for the full tax hit.
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.
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
You need 730 days of residency during the 60-month window ending on the sale date. A lot of folks think those 730 days have to be back-to-back, but they do not. You can live in the house for a year, move somewhere else for two years, come back for another year, and still hit the mark. The IRS lets you add up all the days you lived there, regardless of whether they were consecutive or scattered across the five-year period.
Short temporary absences count toward your residency total too. Going on a two-week vacation, spending a month visiting relatives, or taking a short business trip does not reset your clock. The IRS treats these brief absences as if you were still living in the home, which is a helpful detail for people who travel frequently but still consider their house their primary home base.
One common misunderstanding is that the ownership period and use period have to be the exact same two years. They do not. You could own a home for the entire five-year stretch but only live in it during two of those years. As long as you satisfy both the 24-month ownership test and the 24-month use test within the same 60-month window, you are good. The periods can overlap partially, completely, or not at all.
For married couples, the rules split differently. Either spouse can satisfy the ownership test — so if your name was not on the deed but your spouse owned the home, you still get credit. But both of you must meet the use test individually. If your spouse never actually lived in the house (say, you got married after moving in), 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.
What happens if you have to sell before hitting the two-year mark? The IRS does not just slam the door. A partial exclusion is available if the sale was triggered by unforeseen circumstances: a job transfer that moves you at least 50 miles farther from the home, a health condition that requires relocation, a divorce or legal separation, the death of a spouse, or even multiple births from the same pregnancy. The IRS has also recognized certain natural disasters and terrorist attacks as qualifying events.
The math is straightforward: you take the fraction of the two-year requirement that you actually met, and multiply it by the full exclusion amount. So if you lived in the home for 12 months (half the requirement) and had to move because of a job relocation, you could exclude up to $125,000 as a single filer or $250,000 if married filing jointly. Use our main capital gains calculator to run the numbers on your specific situation.
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.
Take the gross amount you sold the house for. This is the number on your closing statement before any deductions.
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.
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.
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.
If you qualify, subtract $250,000 (single) or $500,000 (married filing jointly) from your gain. Any remaining amount is your taxable capital gain.
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.
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.
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.
You must have owned the home for at least 24 months during the 5-year period ending on the date of sale. Ownership is established by having your name on the deed, title, or contract of sale. If you inherited the home, your ownership period includes the time the previous owner held the property — a detail that helps a lot of heirs qualify immediately. If you received the home in a divorce settlement, you can count the time your ex-spouse owned it as your own. Joint tenants and community property owners each get credit for the full period of ownership, not just their share.
One thing to watch out for: if you added your name to the deed recently (say, when a parent transferred the home to you), your ownership clock starts from the date your name was added, not from when the original owner bought it. The exception is inheritance, where the clock includes the deceased owner's time.
You must have lived in the home as your principal residence for at least 24 months during the same 5-year period. The IRS defines "principal residence" as the place you live most of the time — not a property you visit occasionally or rent out year-round. They look at where you work, where your family lives, the address on your tax returns, your voter registration, and your driver's license. If you own multiple properties, only one can be your principal residence at any given time, so choose wisely.
Short absences for vacation, medical treatment, or education count as periods of use. So if you spend summers at a lake cabin but return to your main house for the rest of the year, those summer absences do not break your residency streak. This is a big relief for snowbirds and people who travel for work.
Married couples filing jointly can exclude up to $500,000 in gains if both spouses meet the use test and at least one meets the ownership test. If only one spouse lived in the home (say, you got married after your spouse had already been living there for years), the exclusion caps at $250,000. If either spouse used the exclusion on a different home within the past two years, the available exclusion amount is also reduced.
Filing separately does not give you double the exclusion. Each spouse can exclude up to $250,000, but both must independently meet the ownership and use tests. This is rarely advantageous compared to filing jointly, so most couples stick with the joint return for the full $500,000 benefit.
The two-year waiting period between exclusions is measured from the date of the previous sale. If you sold a home and claimed the exclusion on March 15, 2024, you cannot use it again until after March 15, 2026. This is a separate requirement from the ownership and use tests — you must satisfy all three. Even being a few days short of any requirement can disqualify you, so verify your dates before listing your home. A premature sale could cost you tens of thousands in taxes that you could have avoided by waiting just a bit longer.
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.
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.
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.
When you sell a vacation home or second home at a profit, the whole gain is taxable. If you held the property for more than one year, the long-term capital gains rates (0%, 15%, or 20%) apply, plus the 3.8% NIIT for high earners. If you held it for one year or less, the gain gets taxed at your ordinary income rate, which can climb to 37%. For a property with a $200,000 gain, that could mean the difference between paying $30,000 in tax (at 15% long-term) or $74,000 (at 37% short-term).
If your vacation home was also a rental property — even partially — things get complicated fast. Any depreciation you claimed during the rental period must be recaptured at a flat 25% rate when you sell. This is separate from and in addition to the regular capital gains tax on the profit. For example, if you claimed $30,000 in depreciation over the years you rented the property, you will owe $7,500 in depreciation recapture tax regardless of your income 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.
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: you have 45 days to identify a replacement property and 180 days to close on it. You must use a qualified intermediary — you cannot touch the money yourself. The replacement property must be like-kind, which for real estate basically means any other real estate held for investment or business use. 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.
Even experienced homeowners trip up on these. Knowing what went wrong for others can help you avoid the same expensive errors.
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.
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.
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.
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.
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.
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.
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.
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, so there is no state-level capital gains bill. This is one reason why retirees and high-net-worth individuals often relocate to these states before selling appreciated properties — the savings can be substantial, especially in states like California where the top state tax rate on capital gains exceeds 13%.
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.
$250,000
Maximum capital gains exclusion for single filers and married filing separately
$500,000
Maximum capital gains exclusion for married couples filing jointly
2 of 5 Years
Must own and use as principal residence for 24 of 60 months before sale
Add to Basis
Capital improvements reduce your taxable gain dollar for dollar
25% Flat
Depreciation recapture applies regardless of your income bracket
Every 2 Years
You can claim the exclusion again two years after your last qualified sale
Explore our other free tax tools and guides to get the full picture of your capital gains tax obligations across different asset types.