How Are Capital Gains Calculated on Sale of Property
Use this advanced estimator to calculate adjusted basis, capital gain, home sale exclusion, federal capital gains tax, depreciation recapture, NIIT, and optional state tax.
Your results will appear here
Enter values and click Calculate Capital Gains.
Expert Guide: How Are Capital Gains Calculated on Sale of Property?
When you sell real estate for more than your tax basis, the profit is generally a capital gain. The basic idea sounds simple, but the real tax result depends on adjusted basis, exclusions, depreciation recapture, holding period, filing status, and your total income. This guide walks through each moving part in practical language so you can estimate your potential tax bill before listing your property.
1) The Core Formula
For most U.S. taxpayers, capital gain on property sale starts with this structure:
- Amount Realized = Sale price minus selling expenses
- Adjusted Basis = Purchase price plus eligible acquisition costs plus capital improvements minus depreciation
- Total Gain = Amount realized minus adjusted basis
If the result is positive, you have a gain. If it is negative, you may have a loss. Personal-use home losses are generally not deductible, while many investment losses may be deductible subject to tax rules.
2) What Counts in Your Adjusted Basis
Your adjusted basis matters because it can substantially reduce taxable gain. Many sellers underestimate it. The following usually increase basis:
- Original purchase price
- Title fees and settlement charges paid at purchase that are capitalizable
- Major improvements that add value or extend life, such as roof replacement, room additions, structural upgrades, full kitchen remodels, and certain system replacements
The following generally do not increase basis:
- Routine maintenance and repairs, such as painting touch-ups and minor fixes
- Utility bills and HOA dues
- Mortgage interest (usually deductible separately, not added to basis)
For rental or business-use property, depreciation reduces basis over time. This increases gain when sold and may trigger depreciation recapture tax, often up to 25 percent at the federal level.
3) Short-Term vs Long-Term Gain
Holding period is a major driver of tax rate:
- Short-term gain: property held 1 year or less, generally taxed at ordinary income rates.
- Long-term gain: property held more than 1 year, generally taxed at favorable long-term capital gains rates (0 percent, 15 percent, or 20 percent depending on income).
Because ordinary rates can be much higher than long-term rates, crossing the one-year mark can significantly reduce tax for many investors.
4) Home Sale Exclusion for Primary Residences
If you sell your main home and meet ownership and use tests, you may exclude up to:
- $250,000 of gain for most single filers
- $500,000 of gain for many married couples filing jointly
Common qualification framework:
- You owned the home for at least 2 of the 5 years before sale.
- You lived in the home as your principal residence for at least 2 of those 5 years.
- You did not claim the same exclusion on another home in the prior 2 years.
Partial exclusions may apply for specific reasons such as work relocation, certain health issues, or other qualifying unforeseen events. The exclusion is one of the most valuable tax benefits for homeowners.
5) Depreciation Recapture on Rental or Mixed-Use Property
If you rented the property and took depreciation deductions, part of the gain may be taxed as unrecaptured section 1250 gain, often at up to 25 percent federal tax. This portion is generally separate from the 0 percent, 15 percent, or 20 percent long-term capital gain brackets.
In plain terms, depreciation helped lower taxable income each year you owned the rental. On sale, the IRS may recapture part of that prior benefit through a different tax rate layer.
6) Net Investment Income Tax (NIIT)
Higher-income taxpayers may owe an additional 3.8 percent NIIT on net investment income, including some real estate gains, subject to thresholds. For many households, key thresholds are:
- $200,000 for Single and Head of Household
- $250,000 for Married Filing Jointly
- $125,000 for Married Filing Separately
This can materially increase total effective tax on a property sale, especially for investment properties or large gains.
7) 2024 Federal Long-Term Capital Gains Brackets by Filing Status
| Filing Status | 0% Rate Up To | 15% Rate Range | 20% Rate Starts Above |
|---|---|---|---|
| Single | $47,025 | $47,026 to $518,900 | $518,900 |
| Married Filing Jointly | $94,050 | $94,051 to $583,750 | $583,750 |
| Head of Household | $63,000 | $63,001 to $551,350 | $551,350 |
| Married Filing Separately | $47,025 | $47,026 to $291,850 | $291,850 |
These thresholds are used for tax year 2024 planning and are one reason your filing status and total income can shift tax results significantly.
8) Housing Price Trend Data and Why It Matters for Capital Gains Planning
Home values have risen strongly in recent years, which means more owners are exposed to larger gains at sale.
| Year | U.S. Median Existing-Home Price (Approx.) | Year-over-Year Change |
|---|---|---|
| 2019 | $274,600 | Baseline |
| 2020 | $296,300 | +7.9% |
| 2021 | $346,900 | +17.1% |
| 2022 | $386,300 | +11.4% |
| 2023 | $389,800 | +0.9% |
Prices are rounded from widely cited national housing market reports. The planning implication is straightforward: faster appreciation can push more sellers above exclusion limits or into higher capital gains bands.
9) Example Calculation Step by Step
Assume the following:
- Purchase price: $300,000
- Purchase closing costs added to basis: $5,000
- Improvements: $40,000
- Depreciation: $0
- Sale price: $700,000
- Selling expenses: $42,000
Step 1, adjusted basis = 300,000 + 5,000 + 40,000 – 0 = $345,000.
Step 2, amount realized = 700,000 – 42,000 = $658,000.
Step 3, total gain = 658,000 – 345,000 = $313,000.
If the seller qualifies for a $250,000 primary residence exclusion (single filer), taxable gain could drop to around $63,000 before considering additional layers such as NIIT or state taxes.
10) State Taxes and Local Rules
Federal tax is only part of the full picture. Many states tax capital gains as ordinary income or with their own rates and rules. Some states have no income tax, while others can materially increase total tax. Local transfer taxes, documentary taxes, and transaction fees can also affect net proceeds.
Because state treatment varies widely, always include state tax in your estimate. This calculator provides an adjustable state rate input so you can model your likely net result.
11) Practical Tax Planning Strategies Before You Sell
- Document basis thoroughly: keep records for purchase costs and all capital improvements.
- Time the sale date: crossing into long-term holding can reduce tax.
- Check exclusion eligibility: primary residence status can save substantial tax.
- Review depreciation history: especially for rentals or mixed-use periods.
- Coordinate with income timing: bonus income, retirement distributions, and large gains in the same year can increase rates and NIIT exposure.
- Model multiple scenarios: this helps set realistic listing price and net proceeds expectations.
12) Authoritative Resources
- IRS Topic No. 701: Sale of Your Home
- IRS Publication 523: Selling Your Home
- Federal Housing Finance Agency (FHFA) House Price Index Data
Important: This calculator is an educational estimate tool, not legal or tax advice. Actual tax outcomes can differ due to partial exclusions, prior home office use, installment sales, like-kind exchange history, loss limitations, and jurisdiction-specific rules. Consult a licensed CPA, EA, or tax attorney for transaction-specific advice.