Capital Gains Calculator for Sale of Property
Estimate taxable gain, exclusion, federal capital gains tax, and potential Net Investment Income Tax.
Results
Enter your numbers and click Calculate Capital Gain.
How Do I Calculate Capital Gains on Sale of Property?
If you are asking, “how do I calculate capital gains on sale of property,” you are already focusing on the right issue. For many owners, the tax bill is not based on the full sale price. It is based on a series of calculations that starts with your gain, then applies exclusions, then applies federal tax rates based on your holding period and income profile.
The practical workflow is simple: first determine your adjusted basis, second determine your amount realized on sale, third subtract to get your gain, fourth apply any home sale exclusion under Section 121, and fifth apply the correct capital gains rate. This page calculator does exactly that with standard assumptions so you can get a fast planning estimate.
Step 1: Determine Your Adjusted Basis
Your adjusted basis generally starts with what you paid for the property, then increases for qualifying capital improvements, and decreases for depreciation claimed if the property was rented or used for business. Many sellers lose money by failing to track improvements, because every valid dollar added to basis can reduce taxable gain.
- Start with purchase price plus certain acquisition costs.
- Add capital improvements such as room additions, major remodels, roof replacement, new systems, and permanent upgrades.
- Subtract depreciation claimed on rental or business use.
Formula: Adjusted Basis = Purchase Price + Improvements – Depreciation
Step 2: Determine Your Amount Realized on Sale
Amount realized usually means what you sold the property for minus direct selling costs. Commissions, transfer fees, title fees, legal fees, and some closing costs reduce the amount realized. This matters because lower amount realized means lower gain.
Formula: Amount Realized = Sale Price – Selling Costs
Step 3: Calculate Gross Capital Gain
Now subtract adjusted basis from amount realized.
Formula: Gross Gain = Amount Realized – Adjusted Basis
If that number is negative, you generally have a loss. For personal-use property, losses are usually not deductible. For investment property, loss treatment follows different rules and may be deductible against gains depending on facts and tax limits.
Step 4: Apply the Home Sale Exclusion (If Eligible)
Many homeowners can exclude gain under Internal Revenue Code Section 121. The common limits are:
- $250,000 exclusion for single filers.
- $500,000 exclusion for married filing jointly (if qualification rules are met).
To qualify in standard cases, you typically must have owned and used the home as your principal residence for at least 2 of the last 5 years before sale, with additional restrictions on prior exclusions. The calculator includes a direct “2-out-of-5 test” input so you can model this quickly.
Primary IRS source: IRS Publication 523, Selling Your Home.
Step 5: Determine Whether Gain Is Short Term or Long Term
Holding period matters. Property held for one year or less usually produces short term gain taxed at ordinary income rates. Property held for more than one year usually produces long term gain taxed at preferential rates. For most real estate owners, long term treatment applies, but quick flips can create short term taxation.
2024 Federal Long Term Capital Gains Rate Thresholds (Taxable Income)
| Filing Status | 0% Rate Up To | 15% Rate Up To | 20% Rate Above |
|---|---|---|---|
| Single | $47,025 | $518,900 | Over $518,900 |
| Married Filing Jointly | $94,050 | $583,750 | Over $583,750 |
| Married Filing Separately | $47,025 | $291,850 | Over $291,850 |
| Head of Household | $63,000 | $551,350 | Over $551,350 |
Use current IRS instructions for your filing year: Schedule D and related instructions.
Net Investment Income Tax (NIIT) Considerations
Higher income taxpayers may owe an additional 3.8% NIIT on net investment income. Broadly, NIIT can apply when modified adjusted gross income exceeds threshold amounts (commonly $200,000 single, $250,000 married filing jointly, $125,000 married filing separately). Depending on facts, part of your taxable property gain may be subject to NIIT. That is why this calculator has an NIIT toggle for planning.
Depreciation Recapture for Rental Property
If you claimed depreciation on a rental or mixed-use property, tax treatment gets more complex. Depreciation reduces basis, which increases gain when you sell. A portion may be taxed at special “unrecaptured Section 1250 gain” rates (up to 25%), not just standard long term rates. This calculator adjusts basis for depreciation and gives a general federal estimate, but complex rental sales should be modeled with a CPA before filing.
Example 1: Primary Residence with Partial Exclusion Impact
- Purchase price: $300,000
- Improvements: $50,000
- Depreciation: $0
- Adjusted basis: $350,000
- Sale price: $650,000
- Selling costs: $40,000
- Amount realized: $610,000
- Gross gain: $260,000
- Single filer exclusion: up to $250,000
- Taxable gain after exclusion: $10,000
In this example, only $10,000 remains taxable at applicable rates. This is why properly applying the Section 121 exclusion is critical for homeowners.
Example 2: Investment Property with Depreciation Claimed
- Purchase price: $280,000
- Improvements: $40,000
- Depreciation claimed: $60,000
- Adjusted basis: $260,000
- Sale price: $520,000
- Selling costs: $30,000
- Amount realized: $490,000
- Gross gain: $230,000
- No primary residence exclusion
- Taxable gain: $230,000, potentially split among long term gain, recapture rules, and NIIT
For rental property, documents supporting depreciation schedules are essential. Missing these records can produce filing errors or overpayment.
Market Context: Why More Sellers Ask About Capital Gains
Home values rose sharply in many U.S. markets during and after 2020. Higher sales prices create larger potential gains, even after commissions and closing costs. The table below shows U.S. median sales prices for new houses sold, illustrating why tax planning before listing has become more important.
| Year (U.S.) | Median Sales Price of New Houses Sold | Year over Year Direction |
|---|---|---|
| 2019 | $327,100 | Baseline |
| 2020 | $336,900 | Up |
| 2021 | $396,900 | Up sharply |
| 2022 | $457,800 | Up sharply |
| 2023 | $428,600 | Down from peak, still elevated |
Source series: U.S. Census Bureau new residential sales data: census.gov/construction/nrs.
Records You Should Keep Before You Sell
- Final closing statement from purchase and sale.
- Receipts and contracts for capital improvements.
- Depreciation schedules from prior tax returns for rentals.
- Proof of primary residence use if claiming Section 121.
- Property tax, insurance, and legal records tied to basis adjustments.
Good records can materially reduce your tax. In many audits, documentation quality is the difference between accepted basis and denied basis.
Common Mistakes That Increase Tax Bills
- Forgetting to include capital improvements in basis.
- Treating all closing costs as basis additions when they are not.
- Ignoring depreciation adjustments for former rentals.
- Assuming all homeowners automatically owe zero tax.
- Using the wrong holding period for short term versus long term treatment.
- Ignoring NIIT where income is near thresholds.
- Not checking state capital gains or state income tax rules.
What About State Taxes?
This calculator is focused on federal planning. Your state may tax capital gains at ordinary income rates or provide state specific treatment. Some states have no broad income tax; others have high marginal rates. If your gain is significant, run a parallel state estimate before setting net proceeds expectations.
Advanced Planning Strategies to Discuss with a Tax Professional
- Timing the sale across tax years to manage bracket exposure.
- Coordinating charitable giving and other deductions in the year of sale.
- For investment property, analyzing like-kind exchange pathways under Section 1031 where eligible.
- Reviewing installment sale options and cash flow versus tax timing tradeoffs.
- Evaluating business-use allocations for mixed-use property.
Legal and Rule Reference
For homeowners seeking the legal framework, you can review the underlying statute for exclusion of gain from sale of principal residence under Internal Revenue Code Section 121 at Cornell Law School Legal Information Institute. Use this with IRS publications and forms for practical filing instructions.
Bottom Line
To calculate capital gains on sale of property correctly, do not start with tax rate tables. Start with basis and selling cost accuracy. Then apply home sale exclusion eligibility, determine short term or long term status, and finally apply federal rates and NIIT rules as needed. If your transaction includes rental use, depreciation, partial exclusions, or high income thresholds, get professional review before filing. A one hour pre-sale tax review can prevent large surprises at return time.