Capital Gains on Sale of Property Calculator
Estimate gain, exclusion, federal tax, NIIT, state tax, and net proceeds using a practical U.S. tax model.
Results
Enter your details and click calculate to view your capital gain and estimated taxes.
How Is Capital Gains Calculated on Sale of Property? Complete Expert Guide
When you sell real estate for more than your tax basis, the difference is generally a capital gain. That sounds simple, but in real life, the final tax number depends on several moving parts: your adjusted basis, your selling expenses, your holding period, your filing status, whether the property was your main home, and whether depreciation was claimed. If you want to estimate your tax correctly before listing your property, you need a structured method, not a rough guess.
At a high level, the calculation starts with this concept: gain equals amount realized minus adjusted basis. The amount realized is usually your sale price minus direct costs of sale. Adjusted basis starts with what you paid, then increases for eligible capital improvements and certain acquisition costs, and decreases for depreciation deductions. Once you know the gain, you then evaluate exclusions and tax rates. That second stage is where most errors happen.
Step 1: Calculate Amount Realized
Your amount realized is not always your contract price. In many cases, you can subtract selling expenses tied directly to the transaction. Common examples include broker commissions, transfer taxes, attorney fees, title charges, and other closing costs associated with selling. If your gross sale price is $750,000 and selling costs are $45,000, your amount realized becomes $705,000.
- Start with gross sale price.
- Subtract direct selling costs.
- The result is your amount realized for gain calculation.
Step 2: Calculate Adjusted Basis
Adjusted basis is the value the IRS uses to measure your economic investment in the property. Begin with purchase price, add eligible acquisition closing costs and capital improvements, then subtract depreciation claimed (or allowable). Routine repairs usually do not increase basis, but improvements that add value, prolong life, or adapt the property to new uses generally do.
- Purchase price
- + Buying closing costs that qualify
- + Capital improvements (new roof, major remodel, additions)
- – Depreciation deductions claimed for rental/business use
- = Adjusted basis
If you purchased at $420,000, paid $8,000 in qualifying buying costs, added $60,000 in improvements, and claimed no depreciation, your adjusted basis is $488,000.
Step 3: Calculate Preliminary Gain
Now subtract adjusted basis from amount realized:
Preliminary Gain = Amount Realized – Adjusted Basis
Using the numbers above: $705,000 – $488,000 = $217,000 gain.
If the result is negative, you may have a capital loss. For personal residences, losses are generally not deductible. For investment property, the treatment differs and can involve capital loss rules and passive activity rules.
Step 4: Apply Section 121 Exclusion for a Primary Residence
For many homeowners, this is the biggest tax reducer. Under Internal Revenue Code Section 121, qualifying sellers can exclude up to $250,000 of gain if single, or up to $500,000 if married filing jointly. To qualify, you generally must meet ownership and use tests: owned and used the home as your main residence for at least 2 of the 5 years before sale. Special rules exist for military, divorce, death of spouse, and partial exclusions due to work or health moves.
Important practical point: depreciation recapture from post-1997 depreciation is generally not excluded by Section 121. That piece can still be taxable, often at a maximum 25% federal rate.
Step 5: Determine Short-Term vs Long-Term Gain
Holding period matters. If held one year or less, gain is usually short-term and taxed at ordinary income rates. If held more than one year, gain is usually long-term and taxed at preferential capital gains rates (0%, 15%, or 20%, depending on taxable income and filing status). High earners may also owe the 3.8% Net Investment Income Tax (NIIT).
2024 Federal Long-Term Capital Gains Brackets (Selected IRS Thresholds)
| Filing Status | 0% Rate Up To | 15% Rate Up To | 20% Rate Over |
|---|---|---|---|
| Single | $47,025 | $518,900 | $518,900 |
| Married Filing Jointly | $94,050 | $583,750 | $583,750 |
| Married Filing Separately | $47,025 | $291,850 | $291,850 |
| Head of Household | $63,000 | $551,350 | $551,350 |
These thresholds are used in many 2024 planning models and should be verified for your filing year before final filing.
NIIT and State Taxes: The Often-Missed Layers
Many sellers calculate only federal capital gains tax and forget two major add-ons. First is NIIT, generally 3.8% on net investment income for taxpayers above threshold income levels. Second is state tax. Some states have no income tax; others tax capital gains at ordinary rates. For high-value sales, these components can materially change your net proceeds, so they should be part of pre-sale planning.
- NIIT threshold examples: $200,000 single, $250,000 MFJ, $125,000 MFS.
- State treatment varies widely; check your state department of revenue.
- Depreciation recapture can increase federal burden even if other gain is excluded.
Inflation Context for Real Estate Gains (BLS CPI-U Annual Average)
| Year | U.S. CPI-U Annual Average Inflation | Why It Matters for Sellers |
|---|---|---|
| 2020 | 1.2% | Low inflation period, nominal gain closer to real gain. |
| 2021 | 4.7% | Higher inflation increased nominal home values and replacement costs. |
| 2022 | 8.0% | Very high inflation year, larger gap between nominal and real return. |
| 2023 | 4.1% | Inflation cooled but remained above pre-2021 norms. |
Worked Example
Assume you are single, selling a primary residence. Sale price is $750,000. Selling costs are $45,000. Purchase price was $420,000. Buying costs were $8,000. Capital improvements were $60,000. No depreciation claimed. You owned and lived in the home long enough to qualify for Section 121.
- Amount realized: $750,000 – $45,000 = $705,000
- Adjusted basis: $420,000 + $8,000 + $60,000 – $0 = $488,000
- Preliminary gain: $705,000 – $488,000 = $217,000
- Section 121 exclusion (single): up to $250,000
- Taxable capital gain: $0 (because gain is fully excluded)
In this case, federal capital gains tax may be zero on the excluded amount, though your exact outcome depends on facts, including prior exclusions within two years and mixed-use rules.
Common Mistakes That Lead to Overpaying
- Forgetting basis adjustments: Missing major improvements can overstate taxable gain significantly.
- Ignoring selling expenses: Commission and closing costs usually reduce gain.
- Misclassifying repairs as improvements: Repairs are generally deductible in rental context, not basis additions for personal property.
- Assuming all gain is excluded: Exclusion rules are conditional and do not fully erase depreciation recapture.
- Skipping NIIT: High-income households can owe additional federal surtax.
- No document trail: Without receipts and records, support for basis increases becomes weaker under audit.
Recordkeeping Checklist Before You Sell
Collect your closing statement from purchase and expected seller net sheet. Assemble invoices for improvements (not routine maintenance), permits, contractor agreements, and proof of payment. If the property was ever rented or used for business, collect depreciation schedules from prior tax returns. Also gather evidence for occupancy tests if claiming primary residence exclusion, such as utility bills, voter registration, or driver license history.
Good records do two things: they reduce risk and they help you avoid paying tax on gain that is not truly taxable.
Tax Planning Strategies to Discuss with a Professional
- Timing the sale across tax years to manage bracket exposure.
- Coordinating other income events (bonus, stock sale, retirement distributions).
- Evaluating installment sale structures for non-primary properties.
- Considering 1031 exchange options for qualifying investment property only.
- Reviewing partial exclusion eligibility when full 2-out-of-5 tests are not met.
- Planning for estimated taxes to avoid penalties on large gains.
Authoritative Sources
For official guidance and current-year details, review these sources:
- IRS Publication 523: Selling Your Home
- IRS Topic No. 409: Capital Gains and Losses
- U.S. Bureau of Labor Statistics CPI Data
Important: This calculator is an educational estimate, not legal or tax advice. U.S. property tax treatment can vary by facts and state law. Always confirm your final numbers with a CPA, Enrolled Agent, or tax attorney before filing.