ProPilot
Back to blog
Tax & LegalJune 15, 202611 min read

Capital Gains Tax Calculator for Real Estate: Estimate What You'll Owe

Use this real estate capital gains tax calculator to estimate what you owe before you sell. This guide covers the step-by-step formula, a worked example with real numbers, depreciation recapture, and four legal strategies investors use to reduce or defer their tax bill.

capital gains tax calculator real estatereal estate capital gains calculatorcalculate capital gains on sale of propertylong term capital gains real estatecapital gains tax on investment propertydepreciation recapture tax1031 exchange deferral

Selling a rental property? Before you accept an offer, you need to know what you owe. Capital gains tax on real estate can take 15-20% of your profit. Depreciation recapture adds another layer: the IRS taxes back the depreciation deductions you claimed during ownership, at up to 25%. Together, these two taxes often represent the largest single cost of a sale, and most investors do not calculate the full number until closing day.

The formula is not complicated. What catches investors off guard is ignoring depreciation recapture or misunderstanding what goes into the adjusted cost basis. This article gives you the step-by-step calculation, a structured input table to run your own numbers, and the four strategies investors use to legally reduce or defer what they owe. For your specific situation, confirm the final figures with a CPA before you close.


How Capital Gains Tax on Real Estate Works

Capital gains tax on real estate is the federal tax owed on the profit from selling an investment property. Long-term rates (0%, 15%, or 20%) apply to properties held more than 12 months. Investment properties do not qualify for the primary residence exclusion, and depreciation recapture tax of up to 25% applies separately on the depreciation claimed during ownership.

Short-term vs. long-term rates. Properties held 12 months or less are taxed at ordinary income rates: 10% to 37% depending on your bracket. Properties held more than 12 months qualify for long-term capital gains rates. For most real estate investors with taxable income in the mid-range, the rate is 15%.

Depreciation recapture is a separate tax. Every year you own a rental property, you deduct depreciation, which reduces your taxable income. When you sell, the IRS recaptures those deductions by taxing that portion of the gain at a maximum rate of 25%. This applies even if you never actively claimed depreciation on your returns: the IRS calculates what you could have claimed and taxes it back at sale.

Two taxes hit at closing. On most investment property sales, you owe both the long-term capital gains tax and the depreciation recapture tax. High-income investors also face the 3.8% Net Investment Income Tax (NIIT) on top of both if modified AGI exceeds $200,000 single or $250,000 married filing jointly. The total exposure can be substantial on properties with significant appreciation and years of depreciation.

The primary residence exclusion does not apply. This is the most common misconception. Single filers can exclude up to $250,000 of gain on a primary residence; married couples up to $500,000. That exclusion is unavailable on rental properties and investment properties, regardless of how long you held them.


The Capital Gains Tax Formula (Step by Step)

Step 1: Calculate your adjusted cost basis.

Your adjusted cost basis is not just the purchase price. It includes the original purchase price plus capital improvements (roof replacement, HVAC, additions, kitchen gut renovations), plus purchase closing costs, minus the total depreciation deducted during ownership. The depreciation reduces your basis, which increases your taxable gain at sale.

Formula: Adjusted cost basis = Purchase price + Capital improvements + Purchase closing costs - Total depreciation taken

Step 2: Calculate your net proceeds.

Net proceeds equal the selling price minus all selling-side costs: agent commissions (typically 5-6%), transfer taxes, title insurance, and any other closing fees you pay as the seller.

Formula: Net proceeds = Selling price - Selling costs

Step 3: Calculate your gross capital gain.

Gross capital gain = Net proceeds - Adjusted cost basis

Step 4: Separate the depreciation recapture component.

Of the gross gain, the portion equal to total depreciation taken is subject to recapture tax at up to 25%. The remaining gain above the recapture amount is subject to long-term capital gains tax.

Step 5: Apply the 2025 tax rates.

Long-term capital gains rates for 2025 (tax returns filed in 2026):

Rate Single Filer Married Filing Jointly
0% Taxable income under $48,350 Under $96,700
15% $48,350 to $533,400 $96,700 to $600,050
20% Over $533,400 Over $600,050

Depreciation recapture: taxed at up to 25%, regardless of income bracket.

Worked example with real numbers.

You purchased a rental property for $200,000. You made $30,000 in capital improvements over five years. Purchase closing costs were $4,000. You sell for $350,000 and pay $21,000 in agent commissions and closing costs.

Depreciation calculation:

  • Estimated land value (not depreciable): $40,000
  • Depreciable basis: $200,000 - $40,000 = $160,000
  • Annual depreciation: $160,000 / 27.5 years = $5,818/year
  • Five-year total depreciation: $5,818 x 5 = $29,090 (rounded to $29,000)
Line Amount
Purchase price $200,000
Capital improvements $30,000
Purchase closing costs $4,000
Less: Depreciation taken ($29,000)
Adjusted cost basis $205,000
Selling price $350,000
Less: Selling costs ($21,000)
Net proceeds $329,000
Gross capital gain $124,000

Tax breakdown (assuming 15% long-term capital gains rate):

Tax Type Taxable Amount Rate Tax Owed
Depreciation recapture $29,000 25% $7,250
Long-term capital gain $95,000 15% $14,250
Estimated federal total $21,500

After federal tax, you net approximately $102,500 from a $124,000 gross gain. State income taxes reduce this further: in California, add another 9-13%; in Florida and Texas, state taxes on investment gains are zero.


Capital Gains Tax Calculator: Run Your Numbers

Use this input table before you list a property. Fill in your numbers, then follow the five calculation steps below.

Input Your Number
Purchase price $
Capital improvements (additions, roof, HVAC, flooring, etc.) $
Purchase closing costs $
Estimated land value (excluded from depreciation) $
Years owned
Annual depreciation claimed $
Total depreciation taken (years x annual) $
Selling price $
Estimated selling costs (commissions + title + transfer tax) $
Your estimated taxable income this year $
Filing status Single / MFJ

Calculate:

  1. Adjusted cost basis = Purchase price + Improvements + Purchase closing costs - Total depreciation
  2. Net proceeds = Selling price - Selling costs
  3. Gross capital gain = Net proceeds - Adjusted cost basis
  4. Depreciation recapture tax = Total depreciation x 25%
  5. Capital gains tax = (Gross gain - Total depreciation) x your applicable rate (0%, 15%, or 20%)
  6. Total estimated federal tax = Depreciation recapture tax + Capital gains tax

This is an estimate tool. It does not account for state taxes, the 3.8% NIIT for high-income investors, or deal-specific variables like installment sale treatment. Use it to frame the conversation with your CPA, not to replace it.


4 Strategies to Reduce or Defer Capital Gains Tax

1. 1031 Exchange

A 1031 exchange lets you defer 100% of your capital gains and depreciation recapture taxes by reinvesting the sale proceeds into a like-kind replacement property. You have 45 days from the sale closing to identify potential replacement properties, and 180 days to close on one. The tax liability carries forward into the replacement property rather than disappearing, but investors who continue exchanging can defer indefinitely. Heirs who receive the property at death get a stepped-up cost basis, which can eliminate the accumulated deferred gain entirely.

One critical point on 1031 and depreciation recapture: the exchange defers the recapture tax, but it does not eliminate it. The accumulated depreciation from the relinquished property reduces the adjusted basis of the replacement, meaning the recapture tax grows with each subsequent property. Plan the eventual exit strategy before you commit to the exchange.

2. Opportunity Zone Investment

Investing your capital gain into a Qualified Opportunity Zone (QOZ) fund within 180 days of the sale defers federal tax on the gain until the earlier of when you exit the fund or December 31, 2026. Gains earned inside the fund that are held for 10 or more years may be excluded from federal tax entirely. This strategy requires careful fund selection and an understanding of the opportunity zone regulations, which are more restrictive than a standard 1031.

3. Installment Sale

Instead of receiving the full proceeds at closing, you can carry a portion of the financing and receive payments over several years. This spreads your capital gains tax across multiple tax years, which can reduce the effective rate if receiving the full gain in one year would push you into the 20% bracket. Installment sales do not defer depreciation recapture: that portion is taxed in full in the year of sale regardless of the payment schedule.

4. Cost Segregation and Bonus Depreciation

A cost segregation study reclassifies certain building components from 27.5-year depreciable life to 5 or 7-year property. Combined with current bonus depreciation rules (40% for 2025, phasing down each year), this generates accelerated deductions in the year of purchase that can offset gains from a separate property sale. The strategy requires a qualified engineer to perform the study and should be coordinated with your CPA well before year-end.


ProPilot and Deal-Level Tax Tracking

Accurately calculating your tax exposure at sale requires tracking specific numbers throughout the hold period: original purchase price, capital improvements added each year, the depreciation schedule, and the timing of your exit. Most investors piece this together from spreadsheets, bank records, and contractor invoices, which creates real risk of miscalculation when it matters most.

ProPilot's portfolio management tools maintain a complete financial record for each property: acquisition cost, capital improvements logged by year, depreciation tracking, and exit data. When it's time to sell, your CPA gets a clean deal history instead of a box of receipts. The calculation that took two hours in a spreadsheet takes a few minutes when the data is already organized.

Run your deal history in ProPilot. Try it free for 7 days.


Frequently Asked Questions

What is the capital gains tax rate on real estate in 2025?

Long-term capital gains on investment property held over 12 months are taxed at 0%, 15%, or 20% depending on taxable income. For 2025: the 0% rate applies to single filers under $48,350 (MFJ under $96,700); the 15% rate applies to most investors; the 20% rate applies to single filers over $533,400 (MFJ over $600,050). Short-term gains on properties held 12 months or less are taxed as ordinary income at rates up to 37%.

Does the primary residence exclusion apply to rental properties?

No. The $250,000 single / $500,000 married exclusion applies only to a principal residence where the seller lived for at least 2 of the last 5 years. Rental properties and investment properties do not qualify. The full capital gain on a rental property is taxable regardless of the gain amount.

What is depreciation recapture and how much is it taxed?

Depreciation recapture is the tax the IRS charges on the depreciation deductions you claimed during your ownership of a rental property. It is taxed at a maximum rate of 25% on the recaptured amount, separate from the capital gains rate. This applies even if you never actively claimed the deduction: the IRS calculates what you were entitled to claim and taxes the corresponding amount at sale.

How do I avoid capital gains tax when selling a rental property?

The most effective strategies are: (1) a 1031 exchange, which defers taxes by reinvesting in a like-kind property within 180 days; (2) an Opportunity Zone fund investment, which defers and may eliminate gains for long-term holders; and (3) holding the property until death, when heirs receive a stepped-up cost basis that can eliminate the accrued gain. The primary residence exclusion is not available on investment properties. Consult a CPA before implementing any of these strategies.

What happens to depreciation recapture in a 1031 exchange?

A 1031 exchange defers depreciation recapture along with the capital gain. The accumulated depreciation carries forward into the replacement property and reduces its adjusted cost basis. The recapture tax is not triggered until you sell a property without executing another exchange. Some investors chain multiple exchanges and use estate planning to eliminate the deferred liability at death via the stepped-up basis rules.

Can I deduct selling costs from my capital gain?

Yes. Selling costs reduce your net proceeds and therefore your taxable gain. Deductible selling costs include agent commissions, transfer taxes, title insurance (seller's portion), attorney fees, and escrow fees paid at closing. Keep all closing statements from the sale, as these documents are the primary support for the selling cost deduction.


The Bottom Line

Capital gains tax on an investment property sale is predictable if you track the right inputs. Most investors fall in the 15% long-term bracket and owe an additional 25% on depreciation recapture. On a deal with meaningful appreciation and five or more years of ownership, the combined federal tax liability often lands between $15,000 and $40,000 or more.

Running the numbers before you list gives you options: you can evaluate a 1031 exchange, consider timing the sale for a lower-income year, or structure an installment sale. Investors who calculate early have time to plan. Those who calculate at closing are out of options.

Our full guide to capital gains tax on real estate covers the rate tables, holding period rules, and state-specific treatment in more detail. And when you are ready to defer, see 1031 exchange rules explained for the identification timelines, qualified intermediary requirements, and common mistakes that disqualify exchanges.

Try ProPilot free for 7 days.