Capital Gains Tax Calculator for House Sale
Estimate your federal capital gains tax, home-sale exclusion, depreciation recapture, NIIT, and optional state tax impact.
Results
Enter your details and click calculate to see your estimate.
Educational estimate only. Tax law is complex and changes over time. Verify with IRS publications and a licensed CPA or tax attorney.
How to Calculate Capital Gains Tax on House Sale: Expert Guide
When people ask how to calculate capital gains tax on house sale proceeds, they often expect one simple percentage. In reality, the tax result depends on a sequence of calculations: adjusted cost basis, selling expenses, eligibility for the home sale exclusion, depreciation recapture, long-term or short-term treatment, filing status, and your other income. If you skip any one of these, your estimate can be off by thousands of dollars. This guide walks you through a professional-level method in plain language so you can model your numbers before listing or closing.
Step 1: Start with Your Amount Realized
Your amount realized is not just the contract price. It is usually your sale price minus allowed selling costs. Typical selling costs include real estate commissions, legal fees, title charges, transfer taxes, staging, and certain closing charges directly tied to the sale.
- Sale price: What the buyer paid for the property.
- Minus selling costs: Commissions and other eligible transaction costs.
- Result: Amount realized.
If your contract is $700,000 and selling costs are $42,000, your amount realized is $658,000.
Step 2: Compute Adjusted Basis Correctly
Adjusted basis is your tax basis after permitted increases and decreases. Most owners begin with purchase price, then add settlement costs and capital improvements, and subtract depreciation claimed for rental or business use.
- Original purchase price
- + Purchase closing costs that can be added to basis
- + Capital improvements (roof replacement, additions, major remodels)
- – Depreciation claimed (if applicable)
This step is where recordkeeping matters most. Repairs are generally not basis-increasing improvements, but permanent value-adding projects usually are. Keep invoices, contracts, and payment records.
Step 3: Find Your Preliminary Gain
Preliminary gain equals amount realized minus adjusted basis. If this number is negative, you generally have no taxable capital gain on a personal residence (and typically no deductible personal loss). If positive, continue to exclusion and rate analysis.
Step 4: Apply the Home Sale Exclusion Rules
The primary residence exclusion under Internal Revenue Code Section 121 can exclude up to $250,000 of gain for eligible single filers and up to $500,000 for eligible married couples filing jointly. Core tests include ownership and use for at least 2 years out of the 5-year period ending on the sale date, plus limits if you used the exclusion recently.
For plain-language IRS guidance, see IRS Topic No. 701: Sale of Your Home. For deeper rule detail, refer to IRS Publication 523.
| Rule | Single | Married Filing Jointly | Why It Matters |
|---|---|---|---|
| Maximum Section 121 exclusion | $250,000 | $500,000 | Can reduce taxable gain significantly |
| Ownership test | 2 of last 5 years | At least one spouse meets test | Determines eligibility |
| Use test | 2 of last 5 years | Both spouses generally must meet use test for full exclusion | Determines full vs limited exclusion |
| Prior exclusion timing | No exclusion claimed in prior 2 years | Same 2-year lookback rule | Can block current exclusion |
Step 5: Account for Depreciation Recapture
If you ever depreciated part of the home for rental or business use, some gain may be taxed as unrecaptured Section 1250 gain, generally up to a 25% federal rate cap. This portion is usually not sheltered by the normal home sale exclusion. Sellers who converted a prior rental into a primary residence often miss this and under-estimate tax.
Step 6: Determine Long-Term vs Short-Term Treatment
Property held for more than one year generally gets long-term capital gains treatment. Property held one year or less is usually taxed at ordinary income tax rates. For most homeowners, long-term rates are lower than ordinary rates, so holding period timing can materially affect net proceeds.
Step 7: Layer in Federal Capital Gains Brackets and NIIT
Federal long-term capital gains rates are commonly 0%, 15%, or 20%, depending on taxable income and filing status. High earners may also owe the 3.8% Net Investment Income Tax (NIIT) on applicable amounts. Current brackets can change annually, so always confirm with official sources before filing.
| 2024 Filing Status | 0% LTCG up to | 15% LTCG up to | 20% above | NIIT Threshold (MAGI) |
|---|---|---|---|---|
| Single | $47,025 | $518,900 | Over $518,900 | $200,000 |
| Married Filing Jointly | $94,050 | $583,750 | Over $583,750 | $250,000 |
| Married Filing Separately | $47,025 | $291,850 | Over $291,850 | $125,000 |
| Head of Household | $63,000 | $551,350 | Over $551,350 | $200,000 |
Step 8: Add State Taxes
State treatment varies widely. Some states tax capital gains as ordinary income; others offer lower rates or no state income tax at all. This is why two homeowners with identical federal numbers can have very different final tax bills. For relocation-based planning, model state impact early, especially if you are deciding whether to sell before or after a move.
Realistic Example
Assume a married couple bought at $350,000, added $8,000 in basis-eligible closing costs, spent $45,000 on improvements, and sold for $700,000 with $42,000 selling costs. They owned and lived in the home long enough to qualify for full exclusion, and they did not claim exclusion in the previous 2 years.
- Amount realized: $700,000 – $42,000 = $658,000
- Adjusted basis: $350,000 + $8,000 + $45,000 = $403,000
- Preliminary gain: $658,000 – $403,000 = $255,000
- Section 121 exclusion available: up to $500,000
- Taxable gain: likely $0 (assuming no depreciation recapture and no disqualifying factors)
This common scenario explains why many primary-home sellers owe no federal capital gains tax, even after strong appreciation. But large gains, mixed-use property, partial rental history, recent exclusion claims, or very high income can change that quickly.
Common Mistakes Sellers Make
- Using sale price alone instead of subtracting selling costs.
- Forgetting to include basis-increasing improvements.
- Treating all remodeling as improvements without documentation.
- Ignoring depreciation recapture from prior rental years.
- Assuming the full exclusion applies without checking ownership and use tests.
- Forgetting NIIT for higher-income households.
- Ignoring state tax effects.
Documents to Gather Before You Calculate
- Closing disclosure from purchase and sale
- Receipts and invoices for major improvements
- Depreciation schedules from prior tax returns (if any)
- Records of occupancy dates
- Prior-year return showing any recent exclusion claim
Planning Moves That Can Reduce Taxes
Good planning is mostly about timing and documentation. If you are near the two-year ownership/use thresholds, waiting to close until you fully qualify can create substantial savings. If you are considering a conversion from rental to primary residence, run a multi-year scenario to account for nonqualified use and depreciation recapture effects. When gain is large, consider installment timing, charitable strategies, and broader portfolio tax planning with your advisor.
Official Sources You Should Trust
Use primary government sources whenever possible. Good starting points include:
- IRS Topic No. 701 (Sale of Your Home)
- IRS Publication 523 (Selling Your Home)
- Cornell Law School Legal Information Institute: 26 U.S. Code Section 121
Final Takeaway
To calculate capital gains tax on house sale proceeds accurately, treat it as a structured tax workflow, not a single formula. First compute amount realized and adjusted basis, then apply exclusion eligibility, then separate depreciation recapture, then apply long-term or short-term rates plus NIIT and state taxes. The calculator above gives a strong estimate, but for filing-grade numbers, confirm assumptions with a CPA or enrolled agent before your closing date.