1031 Exchange Calculator: How to Calculate Your Deferred Tax, Taxable Boot, and Replacement Property Basis
The complete calculation framework for a 1031 exchange — from adjusted basis through realized gain, recognized gain, cash and mortgage boot, replacement property basis, depreciation recapture, NIIT, and the full side-by-side tax comparison of selling outright vs. exchanging.
The Three Outputs Every 1031 Calculator Must Deliver
Any useful 1031 exchange calculation — whether done by hand, a CPA, or an online tool — needs to produce three numbers:
1. Your deferred tax — the total tax you avoid by exchanging instead of selling outright. This is the realized gain minus any recognized gain, multiplied by the applicable tax rates (depreciation recapture, capital gains, NIIT, and state taxes).
2. Your taxable boot — the amount that triggers immediate tax because you didn't fully reinvest. This is the recognized gain — the lesser of your total boot received or your total realized gain.
3. Your replacement property basis — the starting point for depreciation on the new property and the number that determines your gain when you eventually sell. It's lower than the purchase price by the amount of deferred gain.
The rest of this article walks through every calculation step to produce those three numbers, with a complete worked example using realistic dollar amounts.
Step 1: Calculate Your Adjusted Basis
Your adjusted basis is the starting point for every gain calculation. It represents your investment in the property, adjusted for depreciation and improvements.
+ qualifying closing costs at purchase
+ capital improvements during ownership
− accumulated depreciation
Original purchase price is what you paid for the property. Qualifying closing costs include title insurance, attorney fees, recording fees, transfer taxes, and escrow fees — but not prepaid taxes, insurance prorations, or loan origination fees. Capital improvements are expenditures that add value or extend the property's life: new roofs ($15K–$50K+), HVAC systems ($5K–$25K), kitchen remodels, additions, and similar projects. Routine repairs (faucet replacements, patching, painting) are not capital improvements and don't increase basis.
Accumulated depreciation is the total depreciation you've claimed — or were entitled to claim under the "allowed or allowable" rule (IRC §1016(a)(2)) — over your ownership period. This is usually the largest basis reduction and is critical to calculate accurately.
Depreciation Schedules by Property and Asset Type
Different assets within your property depreciate on different schedules. If you've done a cost segregation study, some components may be on shorter lives, affecting your total accumulated depreciation.
| Asset Type | Recovery Period | Method | Convention |
|---|---|---|---|
| Residential rental building | 27.5 years | Straight-line | Mid-month |
| Commercial building | 39 years | Straight-line | Mid-month |
| Land improvements (fencing, paving, landscaping) | 15 years | 150% declining balance | Half-year |
| Appliances, carpeting, furniture | 5 years | 200% declining balance (MACRS) | Half-year |
| Cabinetry, fixtures, signage | 7 years | 200% declining balance (MACRS) | Half-year |
| Land | Not depreciable | — | — |
For most investors without a cost segregation study, the calculation is straightforward: take the depreciable building basis (purchase price minus land value), divide by 27.5 (residential) or 39 (commercial), adjust for the mid-month convention in the first and last year, and multiply by years of ownership.
Step 2: Calculate Your Realized Gain
The realized gain is your total economic profit from the transaction — the full gain that exists whether you exchange or sell outright.
Selling costs include real estate commissions, title insurance, escrow fees, transfer taxes, and QI fees. These are "qualified exchange expenses" that reduce your amount realized. Loan origination fees, property repairs, and prorations are not qualified and cannot be deducted here — if paid from exchange funds, they create cash boot.
Step 3: Calculate Boot — The Two-Test Framework
Boot is the portion of exchange value you received that wasn't reinvested in like-kind real property. It comes in two forms, and you must run both tests independently.
Test 1: The Price Test (Cash Boot)
(If negative or zero, cash boot = $0)
If your replacement property costs less than what you sold for (after selling costs), the difference is cash boot — money that wasn't reinvested in like-kind property.
Test 2: The Equity Test (Mortgage Boot)
(If negative or zero, mortgage boot = $0)
If you reduced your debt level through the exchange, the debt relief is mortgage boot. The IRS treats being freed from a liability the same as receiving cash.
Boot Netting: How Cash and Mortgage Boot Interact
The netting rules under Treasury Regulation §1.1031(b)-1(c) allow some offsets, but they're asymmetric:
| Offset Direction | Allowed? |
|---|---|
| Cash paid → offsets mortgage boot | ✅ Yes |
| Extra debt assumed → offsets mortgage boot | ✅ Yes |
| Extra debt assumed → offsets cash boot | ❌ No |
This asymmetry is the most common source of unexpected boot. Taking on a bigger mortgage does not offset cash you took out of the exchange.
(Cannot be less than $0)
Step 4: Determine Your Recognized Gain
The recognized gain is the amount you actually owe tax on this year. It's determined by a simple ceiling rule:
(Cannot be less than $0)
If your boot is $80,000 but your realized gain is only $50,000, you're taxed on $50,000. You can never be taxed on more gain than you actually realized.
Your deferred gain — the portion that carries forward into the replacement property — is simply:
Step 5: Calculate Your Replacement Property Basis
The replacement property's tax basis determines your annual depreciation deduction and your gain when you eventually sell. It's always lower than the purchase price by the amount of deferred gain — this is how the IRS preserves the deferred tax in the property's basis.
Equivalently:
+ additional cash invested
+ recognized gain
+ exchange expenses
− boot received
Both formulas should produce the same number. If they don't, recheck your math — it means an error in one of the prior steps.
Complete Worked Example: Full Exchange vs. Partial Exchange
You purchased a residential rental property in 2014 for $800,000, with $10,000 in qualifying closing costs. Land value: $162,000 (20%). You claimed $235,000 in depreciation over 10 years. You made a $40,000 roof replacement in 2018. You have a $300,000 mortgage. You sell in 2025 for $1,400,000 with $70,000 in selling costs.
Your Adjusted Basis
| Item | Amount |
|---|---|
| Purchase price + closing costs | $810,000 |
| + Roof replacement (2018) | $40,000 |
| − Accumulated depreciation (building + roof) | −$235,000 |
| Adjusted basis | $615,000 |
Your Realized Gain
| Item | Amount |
|---|---|
| Sale price | $1,400,000 |
| − Selling costs | −$70,000 |
| Net sale price | $1,330,000 |
| − Adjusted basis | −$615,000 |
| Realized gain | $715,000 |
Scenario A: Full Deferral (No Boot)
You buy a replacement property for $1,500,000 with a $400,000 mortgage, reinvesting all net equity.
| Test | Calculation | Boot |
|---|---|---|
| Price test | $1,330,000 net sale − $1,500,000 replacement = negative | $0 |
| Equity test | $300,000 old mortgage − $400,000 new mortgage = negative | $0 |
| Total boot | $0 |
Deferred gain = $715,000
Replacement basis = $1,500,000 − $715,000 = $785,000
Tax owed this year: $0
Scenario B: Partial Exchange (With Boot)
You buy a replacement property for $1,200,000 with a $250,000 mortgage, and pocket $60,000 in cash from the QI.
| Test | Calculation | Boot |
|---|---|---|
| Price test (cash boot) | $1,330,000 − $1,200,000 | $130,000 |
| Equity test (mortgage boot) | $300,000 − $250,000 | $50,000 |
| Total boot | $180,000 |
Deferred gain = $715,000 − $180,000 = $535,000
Replacement basis = $1,200,000 − $535,000 = $665,000
Step 6: The Full Tax Breakdown on Boot
The $180,000 of recognized gain in Scenario B is taxed in a specific order: depreciation recapture fills first, then capital gains, then NIIT stacks on top.
| Tax Layer | Amount | Rate | Tax |
|---|---|---|---|
| Depreciation recapture (Section 1250) | $180,000 (fully within $235K accumulated) | 25% | $45,000 |
| Capital gains (remaining boot) | $0 (boot didn't exceed depreciation) | 15% | $0 |
| Net Investment Income Tax | $180,000 (MAGI > $250K MFJ) | 3.8% | $6,840 |
| State income tax (5% assumed) | $180,000 | 5% | $9,000 |
| Total tax on boot | $60,840 |
The entire $180,000 of recognized gain falls within the depreciation recapture bucket because accumulated depreciation ($235,000) exceeds the recognized gain. This means the entire amount is hit at the 25% recapture rate — not the lower 15% capital gains rate.
Side-by-Side: Selling Outright vs. 1031 Exchange
| Item | Sell Outright | Full 1031 | Partial 1031 |
|---|---|---|---|
| Realized gain | $715,000 | $715,000 | $715,000 |
| Recognized gain | $715,000 | $0 | $180,000 |
| Deferred gain | $0 | $715,000 | $535,000 |
| Recapture tax (25% on $235K depr.) | $58,750 | $0 | $45,000 |
| Capital gains tax (15% on $480K) | $72,000 | $0 | $0 |
| NIIT (3.8%) | $27,170 | $0 | $6,840 |
| State tax (5%) | $35,750 | $0 | $9,000 |
| Total tax owed | $193,670 | $0 | $60,840 |
| Tax savings from exchange | — | $193,670 | $132,830 |
A full 1031 exchange saves this investor $193,670 in immediate taxes. Even the partial exchange — where they extracted $180,000 in boot — saves $132,830 compared to selling outright. That's money that stays invested, compounding over time.
Sequential Exchanges: How Prior 1031 Carryover Basis Works
If the property you're selling was itself acquired through a prior 1031 exchange, your adjusted basis carries over from the original property — not from the purchase price of the current one. This is the carryover basis principle, and it compounds with each exchange.
You bought Property A for $300,000. After depreciation, your adjusted basis was $220,000. You exchanged into Property B (FMV $500,000) with full deferral. Your basis in Property B is $220,000 — not $500,000. The $280,000 deferred gain carries forward.
Years later, you exchange Property B (now worth $800,000, basis eroded to $180,000 after more depreciation) into Property C (FMV $900,000). Your basis in Property C is $180,000. The deferred gain from Property A and Property B — now $720,000 — sits embedded in Property C's basis.
If you sell Property C outright for $900,000, you owe tax on $720,000. If you exchange again, the deferral continues. If you hold until death, your heirs receive a stepped-up basis at fair market value, and the entire deferred gain is eliminated permanently under IRC §1014.
This is why serial 1031 exchangers track their basis meticulously across properties. Your "basis story" can span decades and multiple properties, and losing track of it means underreporting or overreporting gain when the chain eventually breaks.
What If You Never Claimed Depreciation? The Form 3115 Fix
Under the "allowed or allowable" rule (IRC §1016(a)(2)), the IRS reduces your basis by the depreciation you were entitled to claim — whether or not you actually took it. This means you owe recapture on depreciation you never deducted, and your adjusted basis is lower than you think.
The fix: file IRS Form 3115 (Application for Change in Accounting Method) and take a Section 481(a) adjustment. This lets you recover all missed depreciation in a single tax year without amending prior returns. The correction should be filed before you sell — ideally in the tax year preceding the sale — so you capture the deductions before the recapture event.
This is not optional. If you've owned a rental property for 10 years without claiming depreciation, you've missed roughly $36,400 per year in deductions on a $250,000 depreciable basis — over $364,000 total. At a 24% tax bracket, that's $87,360 in lost tax savings. And you'll still owe recapture on the full $364,000 when you sell.
The Mid-Month Convention: Partial-Year Depreciation
Real property (buildings) under MACRS uses the mid-month convention, not the half-year convention. This means the IRS assumes the property was placed in service in the middle of the month you acquired it, and disposed of in the middle of the month you sold it.
If you purchased a residential rental on March 15, the IRS treats the acquisition as occurring on March 15.5 (the middle of March). You get half a month of depreciation for March, then full months for April through December — 9.5 months of depreciation in Year 1.
At disposition, the same applies. If you sell in September, you get 8.5 months of depreciation for that year (January through mid-September). This affects your final-year depreciation and, consequently, your total accumulated depreciation at sale.
For personal property identified through a cost segregation study (appliances, carpeting, land improvements), the half-year convention applies instead — you get half a year of depreciation in both the first and last year of ownership.
Frequently Asked Questions
What happens if I didn't claim depreciation — do I still owe recapture tax?
Yes. Under the "allowed or allowable" rule (IRC §1016(a)(2)), the IRS treats you as if you claimed depreciation whether you did or not. Your basis is reduced by what you were entitled to deduct. File Form 3115 before selling to recover the missed deductions and correct your depreciation going forward.
How do I calculate boot if my replacement property costs less than my relinquished property?
The difference between the net sale price and the replacement property's purchase price is cash boot. Run a second test: if your new mortgage is smaller than the old one, the difference is mortgage boot. Both are taxable. You can offset mortgage boot by adding outside cash, but extra debt cannot offset cash boot (the asymmetry principle).
What is my new depreciation basis after a 1031 exchange?
Your replacement property basis equals the purchase price minus the deferred gain. This lower basis is split into two schedules: carryover basis (continuing the old property's remaining depreciation) and excess basis (any additional investment, starting a new 27.5-year schedule). Both are allocated between land and building.
Can I do a 1031 exchange if my property was acquired through a previous 1031 exchange?
Yes. Sequential exchanges are common. Your adjusted basis carries forward from the original property — not the purchase price of the current one. The deferred gain compounds with each exchange. Chaining exchanges until death allows heirs to receive a stepped-up basis, eliminating all deferred gain permanently.
What is the difference between mortgage boot and cash boot?
Cash boot occurs when you don't reinvest all proceeds — the replacement costs less than the net sale price. Mortgage boot occurs when your new debt is less than your old debt — the IRS treats debt relief like receiving cash. Both are taxable. They're calculated independently with separate netting rules.
Do I need a cost segregation study before doing a 1031 exchange?
Not required, but it can help. A cost segregation study reclassifies building components into shorter depreciation schedules (5, 7, or 15 years), accelerating deductions. On the relinquished property, it helps calculate total accumulated depreciation accurately. On the replacement, it maximizes future depreciation. Be aware that Section 1245 property identified through cost segregation may be recaptured at ordinary income rates (up to 37%), not the 25% Section 1250 rate.
What happens to my deferred tax when I die?
Under IRC §1014, your heirs receive the property at its fair market value — the stepped-up basis — as of the date of death. This eliminates all accumulated deferred gain, depreciation recapture, and capital gains. The deferred tax is never paid. This is one of the most powerful benefits of serial 1031 exchanges held through a lifetime.
The math behind a 1031 exchange is sequential and deterministic: adjusted basis → realized gain → boot (price test + equity test) → recognized gain → replacement basis → tax breakdown. Every step feeds the next. Get the adjusted basis wrong — especially by missing depreciation or ignoring the allowed-or-allowable rule — and every number downstream is wrong. Run both the price test and equity test for boot. Remember the asymmetry principle. And always build the side-by-side comparison: the tax you'd owe selling outright vs. the tax after the exchange. That delta — often six figures — is the number that justifies the complexity.
