Skip to main content
capitalgaintaxcalc.com

Real Estate Capital Gains Tax Calculator — Home Sale vs 1031

Estimate tax on a primary-residence sale, an investment sale, or mixed-use property, then compare an outright sale with a 1031 planning deferral for the same lots. Results are educational estimates, not Form 8824 or a closing statement.

Rates last verified: August 2026

Capital Gains Calculator

Federal · NIIT · All 50 states

2026 ratesIRS verified

Follow the three steps, save the sale, then calculate. Required fields are marked with *.

Your tax profile

These apply to every sale in this estimate.

What you sold

Prices and quantity for this lot. Give it a name if you will add more than one sale.

Asset type

When you bought and sold

The IRS uses these dates to decide short-term vs long-term rates.

Next: Save this sale to the order log, then click Calculate now. Tax results do not update until you calculate.

Order log

Sales included in this tax estimate.

Please fill in the details to see your results. Follow the three steps on the left, then save a sale here.

Home sale vs investment property

Real estate capital gains depend on whether the property is your primary residence, an investment, or mixed-use. For a qualifying primary residence, IRC Section 121 may exclude up to $250,000 of gain ($500,000 if married filing jointly) if the ownership and use tests are met — generally owning the home and using it as your main residence for at least two of the five years before the sale. Gain above the exclusion is generally taxed as a capital gain. The exclusion does not wipe out depreciation recapture that can apply if you rented the home.

Investment and rental property do not get the same exclusion on a taxable sale. Previously claimed depreciation may be taxed as unrecaptured Section 1250 gain at a maximum 25% federal rate, with remaining appreciation often taxed at standard long-term rates if the holding period qualifies. Selling expenses and capital improvements adjust amount realized and basis and can reduce taxable gain. State treatment varies: some states piggyback on federal concepts; others have their own conformity rules for exclusions and recapture.

This calculator’s real-estate mode asks for property type, years owned and used in the last five (for Section 121), depreciation claimed, and an optional replacement-property value for a 1031 planning path. After you calculate, a side-by-side table compares an outright sale with a deferral estimate so you can see tax owed this year, net proceeds, and reinvestment purchasing power. Always confirm large sales, 1031 exchanges, and mixed-use allocations with a real-estate-aware CPA.

IRC Section 121 ownership and use tests

Section 121 is a primary-residence rule. In plain English: if you owned the home and lived in it as your main home for at least two years during the five-year window ending on the sale date, you may exclude gain up to the filing-status cap. Both spouses generally must meet the use test for the $500,000 joint cap, with extra ownership rules. You usually cannot claim the full exclusion more than once every two years. Partial exclusions can apply after certain work, health, or unforeseen-circumstance moves — this tool does not compute those reduced caps.

Enter years owned and years used (0–5). If both are at least two, the estimate treats the Section 121 tests as met for a primary or mixed-use property. Investment-only lots never receive the exclusion here. Remaining gain after the cap is stacked as capital gain. Read the Section 121 guide for exceptions, then return to this calculator to model numbers.

IRC Section 1031 like-kind exchange steps

A like-kind exchange under Section 1031 may defer gain on qualifying US investment or business real property swapped for other qualifying US real property. Personal residences generally do not qualify. After 2017, 1031 no longer applies to stocks, crypto, or most personal property. Typical process: sell the relinquished property; have a Qualified Intermediary hold the proceeds so you do not constructively receive cash; identify replacement property within 45 days; close on the replacement within 180 days (or your return due date, if earlier). Boot — cash, leftover value, or other non-like-kind property — can be taxable even in an otherwise qualifying exchange.

On this page, replacement property value at or above amount realized previews a full deferral of that lot’s tax this year. A lower replacement value is modeled as taxable boot run through the same federal, NIIT, and state engine. This is not Form 8824, not a QI cash trace, and not a reverse or improvement exchange. State 1031 conformity is not modeled per state.

IRC Section 1250 depreciation recapture

When you sell investment or mixed-use real estate, depreciation previously claimed generally reduces adjusted basis and can come back as unrecaptured Section 1250 gain, taxed at a maximum 25% federal rate. Remaining appreciation may still use 0%/15%/20% long-term rates if you held the property more than one year. On a loss, this estimate does not recapture depreciation. Enter the total depreciation you claimed; the tool does not build a year-by-year MACRS schedule.

When to sell vs exchange

Sell when Section 121 covers most of the gain, you need cash proceeds, the property is a home that cannot 1031, or an exchange’s timing and QI costs outweigh the deferral. Exchange when you are rolling investment equity into other US real property and want to defer federal tax (and often recapture) this year, understanding that basis carries over and a later taxable sale can still occur. Mixed-use property is the hardest case: this estimate applies recapture first, then Section 121 to remaining gain if the occupancy tests pass, and allows a 1031 planning path on the investment character. That is not a full Publication 523 allocation by days or square footage.

Use the comparison table after Calculate. Option A is the taxable sale. Option B is the 1031 planning path. The recommendation states which option reduces tax this year on this estimate. Deferral is not elimination. Pair the numbers with IRS Publication 523, Publication 544, and the 1031 guide, then a CPA before you sign a listing or exchange agreement.

Section 121 home-sale exclusion1031 exchange rulesSchedule D and Form 8949Capital loss carryover

Real estate tax by state

Also see

Other calculators, how we model the numbers, and IRS Topic 409.

FAQ

Frequently asked questions

What is the Section 121 exclusion?

If you owned and used a home as your primary residence for at least 2 of the last 5 years, you may exclude up to $250,000 of gain ($500,000 if married filing jointly), subject to IRS rules and exceptions.

What is depreciation recapture?

When investment real estate is sold, previously claimed depreciation may be taxed as unrecaptured Section 1250 gain at a maximum 25% federal rate — often higher than standard LTCG rates.

Does a 1031 exchange defer tax?

A like-kind exchange under Section 1031 may defer gain on qualifying investment or business real property when strict timing and identification rules are met. Primary residences generally do not qualify. This calculator shows a planning comparison, not Form 8824.

Are closing costs deductible from gain?

Many selling costs (for example commissions and certain closing fees) reduce amount realised. Buyer closing costs may increase basis. Exact treatment depends on the cost type — keep settlement statements.

What is boot in a 1031 exchange?

Boot is cash or other non-like-kind value you receive instead of rolling all proceeds into replacement property. Boot can be taxable even if the rest of the exchange qualifies. Enter a replacement value below amount realized to preview boot on this page.

How does mixed-use property work here?

Mixed-use is a simplified estimate: claimed depreciation is treated as unrecaptured Section 1250 gain, then Section 121 may apply to remaining gain if you meet the 2-of-5 tests. A 1031 planning path can apply to the investment character. This is not a full Publication 523 allocation.

Do I need a Qualified Intermediary?

In a typical delayed 1031 you use a QI so you do not constructively receive sale proceeds. This tool does not model QI fees or cash tracing. Work with a QI and CPA before you close.

How do occupancy years affect Section 121?

Enter years owned and years used as a main home in the last five years. If both are at least two, this estimate treats the Section 121 tests as met for primary or mixed-use property. Investment-only lots never get the exclusion here.

Guides