Skip to main content
All Articles
Financial Guide
6 min read June 2, 2026
Verified June 2026

How to Calculate the Home Sale Tax Exclusion and Whether You Qualify

Most homeowners assume they owe nothing on a home sale. That assumption costs thousands. The IRS exclusion has hard eligibility rules, a two-year clock, and a depreciation trap that almost nobody accounts for.

How to Calculate the Home Sale Tax Exclusion and Whether You Qualify

Key Takeaways

  • The IRS exclusion covers up to $250,000 in gains for single filers and $500,000 for married couples filing jointly, but only if you meet the ownership and use tests.
  • Sellers who forget to subtract depreciation recapture from their exclusion often miscalculate taxable gain by $10,000 to $40,000 or more.
  • Run the four-step calculation below before closing, not after, so you can time the sale and structure the transaction correctly.
  • Tool: Calculate your home sale tax liability now →

File Smarter This YearSPONSORED

Stop leaving money on the table. TurboTax finds every deductions automatically.

INTERACTIVE // Calculator
FULL SCREEN
LOADING Calculator...

What the Exclusion Actually Does

Section 121 of the Internal Revenue Code lets qualifying homeowners exclude a portion of capital gain from a home sale. The gain excluded never appears on Schedule D. It does not offset other income. It simply disappears from taxable income, subject to limits.

The ceiling is $250,000 for single filers. Married couples filing jointly get $500,000. Those numbers have not changed since 1997. With the median U.S. home price now exceeding $420,000, and many metropolitan markets seeing decade-long appreciation well above those thresholds, more sellers now have taxable gain than in any prior generation of this law.

Understanding the ceiling is the easy part. Qualifying for it is where most sellers make mistakes.

The Two Tests You Must Pass

The IRS imposes two separate tests. Both must be satisfied during the five-year period ending on the sale date.

Ownership Test

You must have owned the home for at least 24 months of the five years preceding the sale. The 24 months do not need to be consecutive. Periods of ownership separated by a gap still count, as long as the combined total reaches two years within the five-year window.

Use Test

You must have used the home as your primary residence for at least 24 months of the same five-year period. A primary residence means the place where you actually lived, not a vacation property, not a rental, and not a second home you visited occasionally.

Both tests use the same 24-month threshold, but they operate independently. You can own a property for four years while renting it for the first two years. In that case, you pass the ownership test but fail the use test. No exclusion.

When Only One Spouse Qualifies

Married couples get the $500,000 exclusion only if both spouses individually meet the use test. The ownership test requires only one spouse to qualify. If your spouse has never lived in the home but you have, you each pass your respective tests at different thresholds. The exclusion drops to $250,000 in that scenario.

How to Calculate Your Actual Gain

Capital gain on a home sale is not simply the sale price minus what you paid. Four components feed into the calculation.

Step 1: Determine the adjusted basis.

Start with your original purchase price. Add the cost of permanent improvements. A new roof, an addition, a kitchen renovation, a finished basement. Routine maintenance does not count. Painting, landscaping upkeep, and HVAC servicing do not raise your basis. Capital improvements do.

If you converted the property from a rental at any point, subtract the depreciation you claimed or should have claimed during the rental period. This is the depreciation recapture issue, and it is addressed separately below.

Step 2: Calculate net sale proceeds.

Take the agreed sale price. Subtract the seller's closing costs. These include real estate agent commissions, transfer taxes, title insurance premiums paid by the seller, attorney fees, and any seller-paid buyer concessions. The result is your amount realized.

Step 3: Calculate gross gain.

Gross gain equals amount realized minus adjusted basis.

Step 4: Apply the exclusion.

Subtract the applicable exclusion from gross gain. If the result is zero or negative, you owe nothing. If it is positive, that number is your taxable capital gain. It is taxed at long-term capital gains rates if you held the property for more than 12 months.

Worked Example 1: Clean Qualifying Sale

Maria and David purchased a home in Chicago in April 2017 for $380,000. They lived there continuously until selling in September 2025 for $895,000. They paid $53,700 in seller's closing costs.

Adjusted basis: $380,000 purchase price, plus $42,000 in documented kitchen and bathroom renovations. Adjusted basis equals $422,000.

Amount realized: $895,000 minus $53,700 equals $841,300.

Gross gain: $841,300 minus $422,000 equals $419,300.

Exclusion: They qualify as a married couple filing jointly. The exclusion is $500,000.

Taxable gain: $419,300 minus $500,000 equals zero. They owe no federal capital gains tax on this sale.

Without the renovations added to basis, their gross gain would have been $461,300. Still below the exclusion. But sellers with larger gains or fewer improvements are not always this fortunate.

Worked Example 2: Partial Rental Period and Depreciation Recapture

James bought a single-family home in Denver in January 2016 for $310,000. He rented it out from 2016 through 2019, claiming $11,200 in total depreciation. He moved in as his primary residence in January 2020 and sold in June 2025 for $720,000, paying $43,200 in closing costs.

Adjusted basis calculation:

Purchase price: $310,000. He made no capital improvements. He must subtract the depreciation claimed during the rental period.

Adjusted basis: $310,000 minus $11,200 equals $298,800.

Amount realized: $720,000 minus $43,200 equals $676,800.

Gross gain: $676,800 minus $298,800 equals $378,000.

Use test check: James lived in the home as his primary residence from January 2020 through June 2025. That covers 66 months of the 60-month lookback period ending at the sale date. He satisfies both the ownership and use tests.

Exclusion: $250,000 as a single filer.

Taxable gain before depreciation recapture: $378,000 minus $250,000 equals $128,000.

Depreciation recapture: The $11,200 in prior depreciation is not shielded by the Section 121 exclusion. It is taxed at a maximum rate of 25%, regardless of his regular capital gains rate. That creates a $2,800 recapture tax before any state liability.

Total federal tax exposure: Long-term capital gains tax on $128,000, plus $2,800 in depreciation recapture. At a 15% capital gains rate, the tax on the $128,000 equals $19,200. Total federal liability: approximately $22,000.

Had James not tracked his depreciation history, he might have reported only $116,800 in taxable gain, understating his liability by more than $5,000.

Partial Exclusions for Hardship Situations

Sellers who do not meet the full two-year tests may still claim a reduced exclusion in three qualifying circumstances. A job relocation to a location at least 50 miles farther from the home. A health event requiring a move, with physician documentation. An unforeseen circumstance, which the IRS defines narrowly.

The partial exclusion scales proportionally. A single filer who meets 12 of the required 24 months of use qualifies for 50% of the $250,000 ceiling. That equals $125,000 in excluded gain. The fraction is the number of qualifying months divided by 24.

The Frequency Limit

The exclusion applies once every 24 months. If you sold another primary residence within the two years before this sale and claimed an exclusion on that transaction, you cannot claim it again. Serial sellers who flip primary residences more frequently than every two years will owe tax on at least one of those transactions.

State Tax Treatment

The federal exclusion does not bind state tax authorities. Most states conform to the federal exclusion, but not all. California does not conform to the $250,000/$500,000 exclusion for state income tax purposes. California taxes the full gain at ordinary income rates, which reach 13.3% at the top bracket. On a $300,000 gain, that state-only exposure exceeds $39,000.

Verify your state's conformity before assuming the federal exclusion resolves your entire tax obligation.

What to Do Before You Close

Calculate your adjusted basis before listing the property. Gather purchase records, closing disclosures from the original purchase, receipts for capital improvements, and depreciation schedules from any prior rental use. These documents determine your gain. Missing records default to a lower basis, which means higher taxable gain.

Confirm both tests well before the sale date. If you are one month short of the 24-month use requirement, waiting to close may save you the full exclusion amount. On a $300,000 gain above the threshold, a one-month delay avoids up to $45,000 in federal tax at the top long-term rate.

If your gain exceeds the exclusion ceiling, consider whether installment sale treatment makes sense. Spreading recognized gain across multiple tax years may reduce the effective rate.

Run Your Numbers Before the Transaction Closes

The exclusion is one of the most favorable provisions in the tax code. It is also one of the most frequently miscalculated. Sellers undercount basis, ignore depreciation recapture, or assume qualification without checking the five-year window.

The CalcMoney income tax calculator lets you model the full gain calculation with your actual numbers. Enter your purchase price, improvements, depreciation history, and projected sale price. The calculator applies current federal capital gains rates and shows your net liability after the exclusion.

Run the calculation with your figures now →

You Might Also Like

Know the number before you sign the closing documents. The tax code does not offer refunds for assumptions made in good faith.

FEATURED PARTNERFIDELITY

Put These Numbers to Work

Open a Fidelity brokerage account. $0 commissions, no account minimums, fractional shares available.

Get Started
or

One money insight per week.

Calculator deep-dives, rate alerts, and financial analysis written for real decisions. Unsubscribe anytime.

1 email/week. No spam. Unsubscribe in one click.

Free Tools

Run the actual numbers

Stop estimating. Plug in your numbers and get a precise answer in seconds. Free, no signup required.

Open Free Calculators