Capital Gains Tax on Property Sale Calculator
Estimate federal long-term capital gains tax, depreciation recapture, NIIT, and state tax impact after selling real estate.
How to Calculate Capital Gains Tax on Property Sale: A Practical Expert Guide
If you are preparing to sell real estate, one of the most important financial questions is how much tax you may owe on your gain. The short answer is that capital gains tax on property depends on your adjusted basis, your net sale proceeds, your ownership and occupancy history, depreciation taken, filing status, and your other taxable income for the year. The long answer involves a few tax layers that interact with each other. This guide walks you through the process with a framework used by tax professionals so you can estimate your exposure with confidence before listing or closing.
At a high level, most U.S. property sales are taxed in four potential buckets: long-term capital gains tax, depreciation recapture tax, net investment income tax (NIIT), and state tax. Your actual liability may include all four, some of them, or none if exclusions or losses apply. The calculator above is built as an estimation tool to help you model these moving parts.
Step 1: Calculate Your Adjusted Basis Correctly
Your starting point is not just what you paid for the home. Your basis typically includes the purchase price plus certain acquisition costs and qualifying capital improvements. Then you reduce basis by depreciation claimed if the property was ever used as a rental or business asset.
- Beginning basis: purchase price (plus qualifying purchase costs where applicable)
- Plus: capital improvements (new roof, additions, major systems, structural upgrades)
- Minus: depreciation deductions taken over time
- Result: adjusted basis
A common error is confusing repairs with improvements. Routine repairs generally do not increase basis, while improvements that add value, prolong life, or adapt use generally do. Documentation matters. Keep invoices, dates, and project details. In an audit, basis support can materially reduce taxable gain.
Step 2: Determine Amount Realized from the Sale
Your gross contract price is not your taxable amount by itself. You typically subtract selling expenses such as broker commissions, escrow costs, transfer-related legal fees, and other closing costs that are considered selling expenses. This gives your amount realized.
- Start with total sale price.
- Subtract selling costs.
- The result is your net amount realized.
Then compare this amount realized against adjusted basis. If amount realized exceeds adjusted basis, you have a gain. If it is lower, you may have a loss, though personal residence losses are usually not deductible.
Step 3: Split Gain into Depreciation Recapture and Capital Gain
If you claimed depreciation on a rental or mixed-use property, part of your gain can be taxed as unrecaptured Section 1250 gain, often capped at 25% federally. This portion is handled differently than the standard long-term capital gain portion. In practical terms, you generally:
- Identify total gain.
- Carve out depreciation recapture portion (up to accumulated depreciation and limited by gain).
- Treat remaining gain as capital gain subject to long-term capital gain rates if holding period rules are met.
This is one reason investors can face higher effective tax than owner-occupants with similar sale gains.
Step 4: Apply the Primary Residence Exclusion Rules (Section 121)
If the property is your principal residence and you meet the ownership and use tests, you may exclude up to $250,000 of gain if single, or up to $500,000 if married filing jointly. In general, you must have owned and used the home as your main home for at least 2 out of the 5 years before the sale.
Important detail: depreciation recapture from post-1997 depreciation is generally not excluded under Section 121. So even when much of your gain is excluded, recapture may still generate tax.
| 2024 Federal Long-Term Capital Gains Brackets | 0% Rate Upper Limit | 15% Rate Upper Limit | 20% Rate Above |
|---|---|---|---|
| Single | $47,025 | $518,900 | $518,900 |
| Married Filing Jointly | $94,050 | $583,750 | $583,750 |
| Head of Household | $63,000 | $551,350 | $551,350 |
| Married Filing Separately | $47,025 | $291,850 | $291,850 |
These are federal long-term capital gains thresholds used to determine the applicable rate bands. The rate is progressive and stacked on top of your other taxable income, which means your wages, business income, and interest can push part of your gain into a higher capital gains band.
Step 5: Account for NIIT and State Taxes
Higher-income taxpayers may owe the 3.8% Net Investment Income Tax (NIIT). It generally applies when modified adjusted gross income exceeds threshold amounts. Property gains can be part of net investment income in many cases, so this can materially increase total tax.
Then apply your state rules. Some states tax capital gains as ordinary income, some apply dedicated rates, and a few have no income tax. If you are modeling proceeds for a move, retirement, or 1031 strategy planning, state tax assumptions can change your net outcome by tens of thousands of dollars.
| Key Federal Property Gain Thresholds and Rates | Single | MFJ | HOH | MFS |
|---|---|---|---|---|
| Section 121 exclusion limit | $250,000 | $500,000 | $250,000 | $250,000 |
| NIIT threshold (MAGI) | $200,000 | $250,000 | $200,000 | $125,000 |
| Depreciation recapture federal cap | 25% | 25% | 25% | 25% |
| Residential rental recovery period (MACRS) | 27.5 years (IRS rules) | |||
Worked Example
Assume you bought a property for $300,000, made $50,000 in improvements, sold for $750,000, and paid $45,000 in selling costs. You have no depreciation and are single with $90,000 of other taxable income. Your net amount realized is $705,000. Your adjusted basis is $350,000. Total gain is $355,000.
If it qualifies for Section 121 and you meet the occupancy test, up to $250,000 may be excluded. That leaves about $105,000 potentially taxable as long-term capital gain. Depending on your other income, most of that amount may fall into the 15% federal capital gains bracket, with potential NIIT if your MAGI exceeds threshold levels. Add state tax and you have your estimated total.
Now compare that with a non-primary residence case where exclusion is unavailable. The full taxable gain may be exposed to long-term rates, plus possible NIIT and state taxes, and potentially recapture if depreciation exists. This is why occupancy history and depreciation records are central to pre-sale planning.
High-Impact Mistakes to Avoid
- Understating basis: Missing improvement records can overstate taxable gain.
- Forgetting selling costs: Legitimate selling expenses reduce gain.
- Ignoring depreciation recapture: Especially common for former rentals turned primary homes.
- Assuming all gains are at 15%: Capital gains rates depend on your full income picture.
- Skipping state treatment: State taxes can be material even when federal tax is modest.
- Not checking exclusion timing: The 2-out-of-5-year test is date sensitive.
Planning Tactics Before You Sell
- Run multiple closing-date scenarios. Income can vary by tax year. A different closing month may lower bracket exposure.
- Consolidate documentation now. Gather settlement statements, permits, invoices, and depreciation schedules before listing.
- Evaluate occupancy strategy. If near Section 121 qualification, timing may materially change tax owed.
- Estimate NIIT early. High earners should model NIIT, not just capital gains rates.
- Coordinate with your CPA on estimated taxes. A large gain may trigger safe harbor or quarterly payment considerations.
This calculator is an educational estimator, not legal or tax advice. Real returns can involve partial exclusions, carryovers, installment sales, passive loss interactions, and state-specific adjustments. For a binding calculation, work with a CPA or tax attorney using your full records.
Authoritative References
- IRS Topic No. 701: Sale of Your Home
- IRS Publication 523: Selling Your Home
- 26 U.S. Code Section 121 (Cornell Law School)
Final Takeaway
To calculate capital gains tax on a property sale, follow a structured sequence: compute adjusted basis, compute amount realized, determine gain, separate depreciation recapture, apply any Section 121 exclusion, then layer on federal long-term capital gains rates, NIIT, and state tax. Most costly errors come from missing data or incorrect assumptions, not arithmetic. If you treat this as a planning exercise before the home hits the market, you can make better pricing, timing, and reinvestment decisions and avoid surprises at tax filing time.