← Back to calculator
Home Sale Tax

Capital Gains Tax on Home Sale: The Complete 2026 Guide

Selling your home is likely the largest financial transaction of your life — and understanding the capital gains tax implications can save you tens of thousands of dollars. The good news: most homeowners owe zero federal tax on their home sale profits thanks to the generous Section 121 exclusion. But if your gain exceeds $250,000 (single) or $500,000 (married filing jointly), or if you don't meet the qualification rules, you could face a substantial tax bill. This comprehensive guide explains exactly how capital gains tax on home sales works in 2026, who qualifies for the exclusion, and how to calculate what you owe.

Whether you're selling a primary residence you've lived in for decades, converting a rental property, or navigating a home sale after divorce, this guide covers every scenario with clear examples and IRS-accurate rules. Use our free capital gains calculator to instantly estimate your tax, or read on for the complete picture.

How Home Sales Are Taxed in 2026

When you sell your home for more than you paid (including improvements), the profit is a capital gain. The IRS treats this gain the same as any other investment gain — but with one critical difference: Section 121 of the Internal Revenue Code provides a massive exclusion that shelters most homeowners from any tax at all.

Here's the basic framework for how home sale taxation works in 2026:

For most homeowners — especially those with gains under the exclusion threshold — the federal tax bill is $0. According to the National Association of Realtors, the median existing home sale price in 2026 is approximately $410,000, with median gains well below the exclusion limits. However, homeowners in high-appreciation markets (coastal California, the Northeast, major metros) frequently exceed the exclusion, making proper tax planning essential.

Key distinction: Unlike a 1031 exchange used for investment real estate, the Section 121 exclusion permanently eliminates tax on the excluded amount — you don't have to reinvest the proceeds in another home. You can use the money however you wish.

If you sell your home at a loss, unfortunately you cannot deduct that loss on your tax return. Losses on personal-use property (your primary residence) are not deductible. This is different from investment property, where losses can offset gains.

The Section 121 Exclusion — $250k / $500k Explained

The Section 121 exclusion is the single most valuable tax benefit available to American homeowners. It allows you to exclude from income up to $250,000 of gain if you're single, or up to $500,000 if married filing jointly. This isn't a deduction — it's a complete exclusion. The gain simply doesn't exist for tax purposes.

How the exclusion amounts work

Filing StatusMaximum ExclusionRequirements
Single$250,000Ownership + use tests met
Married Filing Jointly$500,000Both spouses meet use test; at least one meets ownership test
Married Filing Separately$250,000 eachEach spouse qualifies independently
Surviving Spouse$500,000Sale within 2 years of spouse's death; other tests met

For married couples to claim the full $500,000 exclusion, both spouses must meet the use test (lived in the home as primary residence for 2 of the past 5 years), but only one spouse needs to meet the ownership test. Neither spouse can have used the exclusion on another home sale within the past 2 years.

There is no limit to how many times you can use the Section 121 exclusion over your lifetime — you just have to wait at least 2 years between uses. Some homeowners strategically move every few years to capture tax-free gains in appreciating markets, though practical moving costs often limit this strategy.

Important: The $250,000/$500,000 exclusion amounts have not been adjusted for inflation since Section 121 was enacted in 1997. Given 27 years of housing price appreciation, more homeowners than ever are bumping up against these limits, particularly in high-cost markets.

Qualification Requirements: The Ownership and Use Tests

To claim the full Section 121 exclusion, you must pass three tests:

1. The Ownership Test

You must have owned the home for at least 2 years (730 days) during the 5-year period ending on the date of sale. The 2 years do not need to be consecutive — they can be any 24 months of ownership within the 5-year window.

2. The Use Test

You must have used the home as your principal residence for at least 2 years (730 days) during the same 5-year period. Again, the 2 years need not be consecutive. Temporary absences for vacation or seasonal travel count as periods of use, but extended absences (such as renting the home out for 3 years) do not.

3. The Look-Back Test

You must not have excluded gain from another home sale within the 2 years preceding this sale. If you claimed a Section 121 exclusion on a different property within the past 2 years, you cannot claim it again.

The 2-out-of-5-years rule in practice

The "2-out-of-5-years" rule provides significant flexibility. Consider these scenarios:

The IRS determines your principal residence based on facts and circumstances, including where you spend most of your time, your mailing address, the address on your tax returns, your state voter registration, and where your bank accounts and employer are located.

Calculating Your Gain on a Home Sale

Your capital gain is the difference between your selling price (amount realized) and your adjusted cost basis. Getting the basis calculation right is critical — every dollar added to your basis is a dollar less in taxable gain.

The formula

Gain = Amount Realized − Adjusted Basis

Worked example: Calculating gain on a home sale

David and Susan (married, filing jointly) bought their home in 2015 for $350,000. They spent $45,000 on a kitchen remodel and $22,000 on a new roof. They sell in 2026 for $780,000 with $47,000 in selling costs.

Don't forget selling costs. Real estate agent commissions (typically 5–6% of the sale price), closing costs, transfer taxes, and home preparation expenses all reduce your amount realized. On a $780,000 sale, commissions alone can be $39,000–$47,000 — reducing your taxable gain significantly. Use our capital gains calculator to factor in all costs.

What increases your cost basis

Your original purchase price is just the starting point. These items increase your adjusted basis:

What decreases your cost basis

What Counts as Home Improvements That Increase Basis

Not every dollar you spend on your home increases your cost basis. The IRS distinguishes between capital improvements (which add to basis) and repairs/maintenance (which do not). Understanding this distinction can save you thousands in taxes when you sell.

Capital improvements (add to basis)

A capital improvement must do one of three things: add value to the home, prolong its useful life, or adapt it to a new use. Common examples include:

Repairs and maintenance (do NOT add to basis)

Routine maintenance that keeps your home in its existing condition does not increase basis:

Record-keeping tip: Keep all receipts and invoices for home improvements for as long as you own the home plus 3 years after you file the return reporting the sale. Digital copies are acceptable. If you can't prove an improvement was made, the IRS may disallow the basis increase.

The gray area: repair vs. improvement

Sometimes a repair becomes an improvement. Patching a few holes in your roof is a repair, but replacing the entire roof is an improvement. Fixing a leaky pipe is a repair, but re-plumbing the entire house is an improvement. The key question: does the work substantially add value or extend the life of the home, or does it merely maintain its current condition?

If you're doing repairs as part of a larger renovation project, the IRS may treat the entire project as a capital improvement under the "plan of improvement" doctrine. A $2,000 paint job done as part of a $50,000 kitchen remodel can be folded into the improvement cost.

Partial Exclusion Rules: When You Don't Meet the Full Requirements

If you sell your home before meeting the full 2-year ownership and use requirements, you may still qualify for a partial exclusion under IRC §121(c). The IRS allows a prorated exclusion when you sell due to:

1. Job relocation

You qualify if your new job is at least 50 miles farther from your old home than your previous job was. This applies whether you changed employers, got transferred, or started a new job. Self-employed individuals also qualify if their new principal place of business meets the distance test.

2. Health reasons

You qualify if you sell to obtain, provide, or facilitate diagnosis, cure, mitigation, or treatment of disease, illness, or injury for yourself, a spouse, co-owner, or certain family members. A doctor's recommendation to move (even for general health improvement) can satisfy this requirement.

3. Unforeseen circumstances

The IRS specifically recognizes these as unforeseen circumstances:

Calculating the partial exclusion

The partial exclusion equals the full exclusion amount multiplied by the fraction of the 2-year requirement you completed:

Partial Exclusion = Full Exclusion × (Days of Qualified Use ÷ 730 days)

Example: Sarah (single) bought a home and lived in it for 15 months (456 days) before being relocated for work. Her partial exclusion is: $250,000 × (456 ÷ 730) = $156,164. If her gain is $140,000, she owes no tax because the partial exclusion covers the full gain.

Home Sale After Divorce — Special Rules

Divorce adds complexity to the home sale exclusion. The IRS provides specific rules for how property transfers and sales are handled in divorce situations.

Transfer between spouses (or incident to divorce)

Under IRC §1041, property transfers between spouses (or former spouses if incident to divorce) are tax-free. The receiving spouse takes over the transferring spouse's cost basis. This means no capital gains tax is triggered at the time of transfer — but the receiving spouse inherits the embedded gain.

Ownership and use test: the ex-spouse rule

If your divorce decree or separation agreement grants your former spouse use of the home, you can count their time living in the property toward your own use test. This is critical when one spouse moves out but retains ownership. Specifically:

Common divorce scenarios

Scenario 1: Sell immediately during divorce. Both spouses still meet the ownership and use tests. Each spouse can exclude up to $250,000 of their share of the gain (or $500,000 on a joint final return if filing jointly for the year of sale).

Scenario 2: One spouse keeps the home, sells later. The spouse who keeps the home can count the departing spouse's prior use toward the use test (under the decree rule). They get a $250,000 exclusion as a single filer. If they received the home in the divorce, the time the other spouse owned it also counts toward the ownership test (basis carries over under §1041).

Scenario 3: Deferred sale per agreement. Some divorce agreements require the home to be sold when the youngest child turns 18. The spouse living in the home qualifies for the exclusion directly. The spouse who moved out qualifies because the decree grants continued occupancy that counts toward their use test.

Divorce planning tip: If your combined gain is between $250,000 and $500,000, selling before the divorce is finalized (while you can still file jointly and claim the $500,000 exclusion) can save significant tax. Consult a tax attorney to coordinate timing with your divorce proceedings.

Rental to Primary Residence Conversions

Converting a rental property to your primary residence and then selling it is a common strategy to access the Section 121 exclusion. However, Congress closed a major loophole in 2008 with the Housing Assistance Tax Act, introducing the concept of "nonqualified use" that limits the exclusion.

The nonqualified use rule (post-2008)

If you used the home as a rental (or any non-primary-residence purpose) after January 1, 2009, a portion of your gain is allocated to that period and cannot be excluded. The formula:

Non-Excludable Gain = Total Gain × (Period of Nonqualified Use After 2008 ÷ Total Ownership Period)

Example: Marcus bought a condo in 2017 and rented it out for 4 years (2017–2020). He then moved in and lived there as his primary residence for 3 years (2021–2023). He sells in 2024 with a $200,000 gain.

Important exception: nonqualified use AFTER primary residence use

Periods of nonqualified use that occur after you stop using the home as your primary residence are not counted as nonqualified use for this calculation. This means the classic strategy of "live in it for 2 years, then rent it out" still works perfectly — the rental period after your primary-residence use doesn't reduce your exclusion (as long as you sell within the 5-year window).

Depreciation recapture: the unavoidable tax

Even if you qualify for the Section 121 exclusion, you cannot exclude gain attributable to depreciation claimed (or allowable) after May 6, 1997. This depreciation recapture is taxed at a maximum rate of 25% (the unrecaptured Section 1250 rate).

Example: If you claimed $40,000 in depreciation while renting the property, you owe 25% × $40,000 = $10,000 in depreciation recapture tax, regardless of whether the rest of your gain is excluded under Section 121.

Strategy: If you're planning to convert a rental to a primary residence, live in it for at least 2 years before selling, and sell within 5 years of when you last used it as your primary residence. The rental period after your primary-residence period won't count against you. For a deeper dive on investment property rules, see our real estate capital gains guide.

What If Your Gain Exceeds the Exclusion?

In high-appreciation markets, it's increasingly common for home sale gains to exceed the $250,000/$500,000 exclusion. When this happens, you owe capital gains tax on the excess amount only.

How the excess gain is taxed

The amount above the exclusion is taxed as a long-term capital gain (assuming you owned the home for more than one year). It's stacked on top of your ordinary taxable income to determine the applicable rate:

RateSingle Filer Income RangeMarried Filing Jointly
0%Up to $49,450Up to $98,900
15%$49,451 – $545,500$98,901 – $613,700
20%Over $545,500Over $613,700

Additionally, if your modified adjusted gross income (MAGI) exceeds $200,000 (single) or $250,000 (married filing jointly), the 3.8% NIIT applies to the lesser of your net investment income or the excess MAGI. Learn more about long-term capital gains rates and the NIIT.

Worked example: Gain exceeds the exclusion

Robert and Maria (married filing jointly) sell their San Francisco home for $2,200,000. They bought it in 2010 for $850,000 and spent $150,000 on improvements. Selling costs are $132,000 (6% commission).

Assuming their other taxable income is $200,000 (combined wages):

This is why proper basis documentation and improvement tracking is so important — every dollar of additional basis directly reduces this tax bill. See our guide on strategies to reduce capital gains tax for more approaches.

State Taxes on Home Sales

Federal taxes are only part of the equation. Most states impose their own income tax on capital gains from home sales, and unlike the federal system, many states do not offer a preferential rate for long-term gains — they simply tax them as ordinary income.

States with no income tax on home sales

These states impose zero state income tax on home sale gains:

States that conform to the federal Section 121 exclusion

Most states that impose an income tax conform to the federal Section 121 exclusion — meaning they also exclude up to $250,000/$500,000 of home sale gain from state taxation. If your gain is fully covered by the federal exclusion, you typically owe nothing at the state level either.

What happens when gain exceeds the exclusion

If your gain exceeds the federal exclusion, the excess is taxed at your state's ordinary income tax rate. The effective rates on that excess can be substantial:

StateTop Rate on Excess GainNotes
California13.3%No preferential rate for gains; taxes at full ordinary rate
Hawaii11.0%Plus 7.25% capital gains tax rate available
New York10.9%Plus NYC surcharge (3.88%) for city residents
New Jersey10.75%Conforms to federal exclusion
Oregon9.9%No sales tax but high income tax
Colorado4.4%Flat rate
Arizona2.5%Flat rate
Florida / Texas0%No state income tax

For a California homeowner with $538,000 in taxable gain (like our example above), the state tax adds approximately $71,500 (13.3% × $538,000) on top of the $105,459 federal bill — for a combined tax of over $176,000. This is why some homeowners relocate before selling. See our California capital gains tax guide for detailed brackets and strategies.

Compare all state rates on our state capital gains tax comparison page.

Washington State note: Washington enacted a 7% capital gains excise tax on long-term gains exceeding $262,000 (2026 threshold). However, the sale of a primary residence is exempt from this tax if you qualify for the Section 121 exclusion. Only the portion not covered by Section 121 — and exceeding the $262,000 annual threshold — would be subject to the 7% rate.

Frequently Asked Questions

How much capital gains tax do I pay when selling my home?

Most homeowners pay zero federal capital gains tax thanks to the Section 121 exclusion, which shelters up to $250,000 of gain (single) or $500,000 (married filing jointly). You only owe tax on gain that exceeds these amounts, and only if you meet the ownership and use tests. The excess is taxed at long-term capital gains rates: 0%, 15%, or 20% depending on your total taxable income. High earners may also owe the 3.8% NIIT.

Do I have to report my home sale to the IRS if I qualify for the exclusion?

If your gain is fully excluded under Section 121 and you receive a Form 1099-S from the closing agent, you should report the sale on your tax return (Schedule D) to show the IRS why you don't owe tax. If you did not receive a Form 1099-S and your gain is fully excludable, you are not required to report the sale. However, reporting it anyway provides a clean paper trail. If any portion of your gain is taxable, you must report the sale.

Can I use the Section 121 exclusion more than once?

Yes — there is no lifetime limit on how many times you can use the exclusion. The only restriction is that you cannot claim it more than once every 2 years. If you sell a home and claim the exclusion in 2024, you must wait until 2026 or later to claim it again on a different property. This makes it possible to use the exclusion repeatedly over a lifetime of homeownership.

What if I used part of my home as a home office — does that affect the exclusion?

If your home office is within the home (a dedicated room, not a separate structure), it does not disqualify any portion of your gain from the Section 121 exclusion. However, you must recapture any depreciation claimed on the office space — that portion is taxed at up to 25%. If the office is in a separate structure (a detached building), the gain allocated to that structure may not qualify for the exclusion and would be taxed as investment property.

How does the home sale exclusion work for surviving spouses?

A surviving spouse can claim the full $500,000 exclusion if the home is sold within 2 years of the spouse's death, the home was used as the primary residence by both spouses for 2 of the last 5 years, and neither spouse used the exclusion within the prior 2 years. After the 2-year window closes, the surviving spouse reverts to the $250,000 single-filer exclusion. Additionally, the deceased spouse's share receives a stepped-up basis to fair market value at death, which can significantly reduce or eliminate the taxable gain.

Should I do a 1031 exchange instead of claiming the Section 121 exclusion?

The Section 121 exclusion is almost always better for a primary residence because it permanently eliminates tax on the excluded gain — you don't need to reinvest the proceeds. A 1031 exchange only defers tax and requires reinvestment into like-kind property. However, if you're selling a home that was primarily used as rental property and doesn't qualify for Section 121, a 1031 exchange may be your best option to defer the gain. In some cases, you can use both — applying Section 121 to the primary-residence portion and a 1031 exchange to the investment portion. Consult a tax advisor for this complex planning.