Skip to main content
All Articles
Financial Guide
6 min read May 28, 2026
Verified May 2026

How to Calculate Home Sale Capital Gains Tax Before You Close

Most homeowners miscalculate their capital gains exposure by ignoring cost basis adjustments that can reduce taxable gain by tens of thousands of dollars. The IRS exclusion is not automatic. You have to qualify, document, and time it correctly.

How to Calculate Home Sale Capital Gains Tax Before You Close

Key Takeaways

  • The IRS Section 121 exclusion shields up to $500,000 in gain for married filers, but three separate tests must be satisfied first.
  • Sellers who skip cost basis adjustments for capital improvements routinely overpay by $8,000 to $30,000 in federal tax alone.
  • Calculate adjusted cost basis first, subtract the applicable exclusion second, then apply the correct long-term capital gains rate to what remains.
  • Tool: Run your home sale tax estimate now →

Get Pre-Approved TodaySPONSORED

Lock your rate before it moves. Rocket Mortgage pre-approval takes under 10 minutes.

INTERACTIVE // Mortgage Calculator
FULL SCREEN
LOADING Mortgage Calculator...

The Number That Actually Gets Taxed

The sale price of your home is not your taxable gain. That distinction costs sellers real money every year.

Taxable gain equals net proceeds minus adjusted cost basis. Both sides of that equation require deliberate calculation. Most sellers get the proceeds figure right because the closing statement spells it out. Most sellers get the cost basis figure wrong because it requires documentation going back to the original purchase.

Step 1: Calculate Net Proceeds

Net proceeds equals the contract sale price minus selling costs. Deductible selling costs include:

  • Real estate commissions (typically 2.5% to 3% per side)
  • Title insurance paid by the seller
  • Transfer taxes and recording fees
  • Attorney fees at closing
  • Seller-paid closing concessions

On a $900,000 sale with a 5% total commission and $12,000 in additional closing costs, net proceeds land at $843,000.

Step 2: Build Your Adjusted Cost Basis

Original purchase price is the floor, not the ceiling. Every capital improvement made during ownership increases your basis and reduces your eventual taxable gain dollar-for-dollar.

Capital improvements that adjust basis include:

  • Kitchen and bathroom remodels
  • Room additions and finished basements
  • New roof, HVAC systems, or windows
  • Landscaping and hardscaping that adds permanent value
  • Solar panel installation

Routine repairs do not adjust basis. Painting, fixing a leaky faucet, and replacing broken appliances are maintenance. They do not move the number.

If you purchased at $420,000 and spent $95,000 on qualifying improvements over 11 years, your adjusted cost basis is $515,000.

Step 3: Calculate Gross Gain

Gross gain equals net proceeds minus adjusted cost basis.

Using the numbers above: $843,000 minus $515,000 equals $328,000 in gross gain.

The Section 121 Exclusion: What It Actually Requires

The exclusion is not a given. Three tests apply under IRC Section 121.

Ownership test. You must have owned the home for at least 24 of the 60 months before the sale date.

Use test. You must have used the property as your primary residence for at least 24 of the same 60-month window. Ownership and use periods do not have to overlap, but both must be satisfied.

Frequency test. You cannot have claimed the Section 121 exclusion on another home sale within the two years preceding this sale.

Pass all three and the exclusion caps at $250,000 for single filers and $500,000 for married filing jointly. Each spouse must independently satisfy the use test. Only one spouse needs to satisfy the ownership test.

Partial exclusions apply in specific hardship cases, including job relocation, health-related moves, and unforeseen circumstances. The partial exclusion is calculated as a fraction of the full exclusion equal to the proportion of time you satisfied the tests.

Worked Example 1: Married Couple, Full Exclusion Available

Miguel and Dana purchased their primary residence in March 2018 for $485,000. They added a finished basement in 2020 for $42,000 and replaced the roof in 2022 for $18,500. They sold in April 2026 for $1,025,000. Total commission and closing costs came to $58,000.

Net proceeds: $1,025,000 minus $58,000 equals $967,000.

Adjusted cost basis: $485,000 plus $42,000 plus $18,500 equals $545,500.

Gross gain: $967,000 minus $545,500 equals $421,500.

Section 121 exclusion: Married filing jointly. Both spouses owned and used the home as primary residence for more than 24 months. Full $500,000 exclusion applies.

Taxable gain: $421,500 minus $500,000 equals zero. No federal capital gains tax owed.

If they had ignored the improvements and used only the $485,000 purchase price as their basis, their gross gain would have appeared to be $482,000. Still zero after the exclusion in this case, but the margin narrows meaningfully for higher-value properties.

Worked Example 2: Single Filer, Partial Gain Remains Taxable

Priya purchased a condo in Chicago in January 2021 for $310,000. She sold it in February 2026 for $525,000 with $28,000 in total closing costs. She made no capital improvements.

Net proceeds: $525,000 minus $28,000 equals $497,000.

Adjusted cost basis: $310,000.

Gross gain: $497,000 minus $310,000 equals $187,000.

Section 121 exclusion: Single filer. Owned and used as primary residence for over 24 months. Exclusion applies up to $250,000.

Taxable gain: $187,000 minus $250,000 equals zero. No federal capital gains tax owed.

Now assume Priya's condo sold for $680,000 instead, with the same $28,000 in costs. Net proceeds become $652,000. Gross gain becomes $342,000. After the $250,000 exclusion, taxable gain is $92,000.

At the 15% long-term capital gains rate, she owes $13,800 in federal tax. At the 20% rate, which applies to single filers with taxable income above $518,900 in 2025, she owes $18,400. She should also account for the 3.8% Net Investment Income Tax if her modified adjusted gross income exceeds $200,000, adding up to $3,496 to the bill.

Federal Capital Gains Rates for 2025

Long-term capital gains rates apply when you held the home for more than 12 months. They are:

  • 0% for single filers with taxable income up to $48,350, or married filing jointly up to $96,700.
  • 15% for single filers between $48,351 and $518,900, or married filing jointly between $96,701 and $583,750.
  • 20% for income above those thresholds.

The gain stacks on top of your ordinary income for rate determination purposes. A household earning $200,000 in wage income with $120,000 in remaining taxable home sale gain will hit the 20% threshold on a portion of that gain.

State Capital Gains Tax: The Layer Most Sellers Miss

Federal tax is not the full picture. Most states tax capital gains as ordinary income. California taxes it at rates up to 13.3%. New York's rate reaches 10.9% at higher income levels. States like Texas, Florida, and Nevada impose no income tax, which means no additional capital gains tax at the state level.

A $150,000 taxable gain in California triggers up to $19,950 in state tax alone, on top of federal liability. That changes the calculus on whether to accelerate or defer a sale.

What Disqualifies You From the Exclusion

Several situations eliminate or reduce the exclusion that sellers frequently overlook.

Home office deductions. If you claimed depreciation deductions for a home office, that depreciation must be recaptured at a 25% federal rate regardless of the exclusion. A home office representing 12% of your home's square footage over eight years produces meaningful recapture liability.

Prior 1031 exchanges. If you acquired the home through a like-kind exchange and have not held it for five years with two years of personal use, the exclusion does not apply.

Rental history. Periods of non-qualified use, such as renting the property out after moving out, reduce the available exclusion proportionally.

Short holds. Selling within 12 months of purchase means any gain is taxed as ordinary income at rates up to 37% federally, not as long-term capital gain.

The Documentation You Need Before You Close

Gather these records before the sale settles:

  • Original purchase contract and HUD-1 or closing disclosure
  • Receipts and invoices for all capital improvements
  • Prior tax returns showing any depreciation claimed
  • Documentation of home office use if applicable
  • Proof of residency for each year claimed under the use test

Missing records force you to use a lower, undocumented basis. That means higher taxable gain and higher taxes. A $40,000 kitchen remodel with no receipts adds $6,000 in tax at the 15% rate. Document everything.

Run Your Own Numbers Before the Closing Date

The tax due on a home sale is deterministic. You can calculate it precisely before you close, not after. That calculation determines whether to time the sale in a particular tax year, whether to accelerate or defer other income, and whether a partial exclusion is worth claiming.

Use the CalcMoney home sale calculator to input your purchase price, improvement history, expected sale price, filing status, and income. The tool returns estimated federal and state capital gains exposure, net proceeds after tax, and the impact of the Section 121 exclusion on your specific situation.

You Might Also Like

The difference between a rough estimate and a precise calculation can exceed $20,000 on a typical transaction. Run the numbers with accurate inputs before you sign anything.

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