Get The Ultimate
1031 Exchange Calculator.

Want to understand the math behind capital gains from the sale of your investment property? Interested in going deep on the amount of taxes you’ll defer by doing a 1031 exchange? Or what about understanding the reinvestment required to take advantage of full tax deferral on your 1031?

From capital gains calculations to 1031 tax deferment to detailed scenario analysis of 1031 exchange savings you get from hiring 1031 Specialists, our Excel model has it all. Just fill out this simple form, then check your email.

Check Your Email!

You are 1 step away from accessing the ultimate 1031 exchange calculator.

All that’s left to do is check your email!

- 1031 Specialists Team
Oops! Something went wrong while submitting the form.

1031 Exchange Calculator: The Excel Worksheet Behind Every Number

This is the full calculation framework our Excel worksheet runs, documented step by step: adjusted basis, realized gain, cash and mortgage boot, recognized gain, replacement property basis, depreciation recapture, NIIT, and the side by side comparison of selling outright against exchanging. Every formula below is live in the spreadsheet, so you can audit the logic instead of trusting a black box.

Last updated  ·  20 min read  ·  Reviewed by the 1031 Specialists exchange team

The Three Outputs Every 1031 Exchange Calculator Must Deliver

Any useful 1031 exchange calculation, whether you run it by hand, hand it to a CPA, or open a spreadsheet, 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 less any recognized gain, multiplied by the applicable rates: depreciation recapture, capital gains, NIIT, and state.

2. Your taxable boot. The amount that triggers tax this year because you did not fully reinvest. This is the recognized gain, which is the lesser of total boot received or 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 sits below the purchase price by exactly the amount of deferred gain.

Everything below walks through the calculation that produces those three numbers, with a complete worked example using realistic dollar amounts. If you would rather work in a spreadsheet than by hand, the Excel worksheet at the top of this page runs all of it with live formulas.

What the Excel Worksheet Calculates

The 1031 exchange calculator Excel worksheet is a working model, not a static PDF. You enter your own property figures in the input cells and every downstream calculation updates. Nothing is hard coded, so you can trace any output back to its formula.

The worksheet covers six calculation stages:

Excel worksheet contents
StageWhat you enterWhat the worksheet returns
Adjusted basisPurchase price, closing costs, improvements, accumulated depreciationAdjusted basis at sale
Realized gainSale price, selling costsNet sale price and total realized gain
BootReplacement price, old and new mortgage balances, cash added at closingCash boot, net mortgage boot, total boot
Recognized and deferred gainNothing, calculatedGain taxed this year and gain carried forward
Replacement basisNothing, calculatedNew basis, cross-checked two ways
Tax comparisonCapital gains bracket, state rate, NIIT applicabilityTax if you sell outright vs. full 1031 vs. partial 1031

The scenario tab lets you run several replacement property prices at once, which is the fastest way to answer the question most exchangers actually have: how far down in price can I buy before the tax bill outweighs the cash I pull out?

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.

Adjusted basis = Original purchase price + qualifying closing costs at purchase + capital improvements during ownership - accumulated depreciation

Original purchase price is what you paid. 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: roof replacements, HVAC systems, kitchen remodels, additions. Routine repairs such as faucet replacements, patching, and painting are not capital improvements and do not increase basis.

Accumulated depreciation is the total depreciation you have claimed, or were entitled to claim under the "allowed or allowable" rule at IRC section 1016(a)(2), over your ownership period. This is usually the largest basis reduction and the one most often calculated wrong. Pull it from your depreciation schedules rather than estimating.

The "allowed or allowable" trap The IRS reduces your basis by the depreciation you were entitled to claim, whether or not you actually took the deduction. If you never claimed depreciation on your rental property, your basis is still reduced as though you did. File IRS Form 3115 before selling to recover those missed deductions. See the Form 3115 section below.

Depreciation Schedules by Property and Asset Type

Different assets within your property depreciate on different schedules. If you have done a cost segregation study, some components sit on shorter lives, which changes your total accumulated depreciation. Full detail is in IRS Publication 946.

Asset typeRecovery periodMethodConvention
Residential rental building27.5 yearsStraight lineMid-month
Commercial building39 yearsStraight lineMid-month
Land improvements (fencing, paving, landscaping)15 years150% declining balanceHalf-year
Appliances, carpeting, furniture5 years200% declining balance (MACRS)Half-year
Cabinetry, fixtures, signage7 years200% declining balance (MACRS)Half-year
LandNot depreciablen/an/a

For most investors without a cost segregation study the calculation is straightforward: take the depreciable building basis (purchase price less land value), divide by 27.5 for residential or 39 for commercial, adjust for the mid-month convention in the first and last year, and multiply by years of ownership. The half-year convention on 5, 7, and 15 year property can be displaced by the mid-quarter convention if more than 40% of your annual additions land in the fourth quarter.

If depreciation recapture is the number you are chasing rather than the exchange math, our depreciation recapture calculator isolates that single figure.

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.

Realized gain = (Sale price - selling costs) - adjusted basis

Selling costs include real estate commissions, title insurance, escrow fees, transfer taxes, and qualified intermediary 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 they are paid out of exchange funds they create cash boot instead.

Step 3: Calculate Boot Correctly (and the Mistake Most Calculators Make)

Boot is the portion of exchange value you received that was not reinvested in like-kind real property. This is where most online 1031 calculators go wrong, so it is worth being precise.

The definition that actually governs

Boot received is the sum of two things, and only two things:

Total boot = cash and other property received + net debt relief

Cash received is the money that actually comes back to you from the qualified intermediary after the replacement property closes. Net debt relief is the amount by which your mortgage went down, reduced by any outside cash you brought to the closing table.

The double-count error to avoid Many published calculators tell you to run a "price test" (net sale price less replacement price) and an "equity test" (old mortgage less new mortgage) and then add the two results together. That overstates your boot, because the price shortfall already contains the debt reduction. Run the price test as a cross-check on your total, never as a component you add to something else.

The cross-check: the value test

In a standard delayed exchange where all net proceeds pass through the qualified intermediary, the total boot equals the amount you bought down in price:

Value shortfall = Net sale price of relinquished property - purchase price of replacement property (if zero or negative, no boot)

If your component build-up (cash plus net debt relief) does not equal the value shortfall, one of your inputs is wrong. The Excel worksheet flags this automatically, which is the single most useful check in the file.

Boot netting: how cash and debt interact

The netting rules under Treasury Regulation section 1.1031(b)-1(c) allow some offsets, but they are asymmetric:

Offset directionAllowed?
Outside cash paid at closing offsets mortgage bootYes
Additional debt assumed offsets mortgage bootYes
Additional debt assumed offsets cash bootNo

This asymmetry is the most common source of unexpected tax bills. Taking on a bigger mortgage does not offset cash you pulled out of the exchange. If you are modelling a partial exchange specifically, our partial 1031 boot calculator runs this in isolation.

Step 4: Determine Your Recognized Gain

The recognized gain is the amount you actually owe tax on this year. It is set by a ceiling rule:

Recognized gain = lesser of (total boot) or (realized gain) (cannot be less than zero)

If your boot is $80,000 but your realized gain is only $50,000, you are taxed on $50,000. You can never be taxed on more gain than you actually realized. Note that the reverse does not apply: a loss on the exchange is not recognized either.

Your deferred gain, the portion that carries forward into the replacement property, is simply:

Deferred gain = Realized gain - Recognized gain

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 sits below the purchase price by exactly the amount of deferred gain. That is how the IRS keeps the deferred tax alive inside the property.

Replacement basis = FMV of replacement property - deferred gain

The statutory version at IRC section 1031(d) reaches the same number from the other direction, and this is the one to use if you want to prove your work:

Replacement basis = Adjusted basis of relinquished property - cash boot received - debt on relinquished property + cash paid into the exchange + debt on replacement property + gain recognized
Do not omit the debt terms A widely circulated shorthand version of this formula lists only basis, cash invested, recognized gain, and exchange expenses, less boot received. It leaves out both mortgage balances, so it fails on any exchange involving debt, which is nearly all of them. Use the full six-term version above.

Both methods must produce the same number. If they do not, the error is upstream, almost always in accumulated depreciation or in the boot calculation.

Why the lower basis matters A lower basis means less annual depreciation and a larger taxable gain when you eventually sell. The deferred gain does not disappear, it is embedded in the gap between the replacement property's market value and its basis. That is the real cost of deferral. For most investors the time value of keeping that tax money invested outweighs the eventual higher bill, which is exactly the trade the comparison tab in the worksheet quantifies.

Worked Example: Full Exchange vs. Partial Exchange

Scenario inputs

You bought a residential rental in 2014 for $800,000, with $10,000 of qualifying closing costs. Land was allocated at $162,000, leaving a depreciable building basis of $648,000. You replaced the roof in 2018 for $40,000. Your depreciation schedules show $235,000 of accumulated depreciation across the building and the roof through the date of sale. You carry a $300,000 mortgage. You sell in 2025 for $1,400,000 with $70,000 of selling costs.

Your adjusted basis

ItemAmount
Purchase price plus closing costs$810,000
Plus roof replacement (2018)$40,000
Less accumulated depreciation (per schedules)($235,000)
Adjusted basis$615,000

Your realized gain

ItemAmount
Sale price$1,400,000
Less selling costs($70,000)
Net sale price$1,330,000
Less adjusted basis($615,000)
Realized gain$715,000

Net proceeds of $1,330,000 pay off the $300,000 mortgage, so $1,030,000 goes to the qualified intermediary. That figure drives both scenarios below.

Scenario A: full deferral, no boot

You buy a replacement property for $1,500,000 with a $400,000 mortgage. Cash required at closing is $1,100,000. You have $1,030,000 with the QI, so you add $70,000 of outside cash.

ComponentCalculationBoot
Cash received$1,030,000 held less $1,100,000 required, nothing comes back$0
Net debt reliefDebt rose from $300,000 to $400,000$0
Total boot$0
Cross-check: value shortfall$1,330,000 less $1,500,000, negative$0
Recognized gain = lesser of $0 boot or $715,000 realized = $0 Deferred gain = $715,000 Replacement basis = $1,500,000 - $715,000 = $785,000 Statutory check = $615,000 - $300,000 + $70,000 + $400,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. Cash required at closing is $950,000. You hold $1,030,000, so $80,000 comes back to you from the QI.

ComponentCalculationBoot
Cash received$1,030,000 held less $950,000 required$80,000
Net debt relief$300,000 old mortgage less $250,000 new mortgage$50,000
Total boot$130,000
Cross-check: value shortfall$1,330,000 less $1,200,000$130,000
Recognized gain = lesser of $130,000 boot or $715,000 realized = $130,000 Deferred gain = $715,000 - $130,000 = $585,000 Replacement basis = $1,200,000 - $585,000 = $615,000 Statutory check = $615,000 - $80,000 - $300,000 + $130,000 + $250,000 = $615,000

Note that the two boot figures agree at $130,000. Had you added the $80,000 cash, the $50,000 debt relief, and the $130,000 shortfall together, you would have reported $180,000 of boot and overpaid roughly $17,000 in tax on gain you never received.

Step 6: The Full Tax Breakdown on Boot

The $130,000 of recognized gain in Scenario B is taxed in a specific order. Unrecaptured section 1250 gain fills first, then long-term capital gains, then the net investment income tax stacks on top of both.

Tax layerAmount taxedRateTax
Unrecaptured section 1250 gain$130,000, fully inside the $235,000 of accumulated depreciation25%$32,500
Long-term capital gain$0, boot did not exceed accumulated depreciation20%$0
Net investment income tax$130,0003.8%$4,940
State income tax (5% assumed)$130,0005%$6,500
Total tax on boot$43,940

The entire $130,000 falls into the recapture bucket because accumulated depreciation ($235,000) exceeds the recognized gain. That means the whole amount is hit at 25%, not at the lower long-term capital gains rate. Boot is taxed at your worst rate first, which is why partial exchanges are more expensive than most investors expect.

These figures assume married filing jointly with income above the NIIT threshold. Your bracket and state rate are both inputs in the Excel worksheet.

Side by Side: Selling Outright vs. 1031 Exchange

ItemSell outrightFull 1031Partial 1031
Realized gain$715,000$715,000$715,000
Recognized gain$715,000$0$130,000
Deferred gain$0$715,000$585,000
Recapture tax at 25%$58,750$0$32,500
Capital gains tax at 20%$96,000$0$0
NIIT at 3.8%$27,170$0$4,940
State tax at 5%$35,750$0$6,500
Total tax owed$217,670$0$43,940
Tax saved by exchangingn/a$217,670$173,730

Assumptions: married filing jointly, long-term capital gain rate of 20% given total gain above the 20% bracket threshold, NIIT applicable, 5% flat state rate. The 25% recapture applies to the $235,000 of accumulated depreciation, and the remaining $480,000 is taxed as long-term capital gain.

A full exchange saves this investor $217,670 in immediate tax. The partial exchange, where they took $80,000 of cash and $50,000 of debt relief, still saves $173,730 against an outright sale. Put differently: pulling $80,000 of cash out cost $43,940 in tax, an effective rate of about 55% on the cash actually received. That ratio is the number the worksheet is really built to expose, and it is covered in more depth on our capital gains vs. 1031 exchange comparison.

When you file, all of this flows onto Form 8824. Our Form 8824 worksheet calculator maps each figure above to its line number, and the IRS instructions are at About Form 8824.

Sequential Exchanges and Carryover Basis

If the property you are selling was itself acquired through a prior 1031 exchange, your adjusted basis carries over from the original property rather than from the purchase price of the current one. This compounds with each exchange.

Example: three properties, two exchanges

You bought Property A for $300,000. After depreciation your adjusted basis was $220,000. You exchanged into Property B at a fair market value of $500,000 with full deferral. Your basis in Property B is $220,000, not $500,000, and $280,000 of gain carries forward.

Years later Property B is worth $800,000 and its basis has eroded to $180,000 through further depreciation. You exchange into Property C at $900,000, adding $100,000 of new capital at closing. Realized gain on B is $620,000, all deferred. Your basis in Property C is $180,000 plus the $100,000 you added, so $280,000. Check it the other way: $900,000 FMV less $620,000 deferred gain equals $280,000.

If you sell Property C outright for $900,000 you owe tax on $620,000. If you exchange again, deferral continues. If you hold until death, your heirs take a stepped-up basis at fair market value under IRC section 1014 and the entire deferred gain is eliminated.

The point worth internalising: new capital you contribute along the way increases your basis. Only the deferred gain suppresses it. Serial exchangers who assume basis simply carries across untouched will overstate their embedded gain, which is why tracking every exchange in one file matters. Our 1031 exchange deadline tracker handles the timing side of the same problem.

If You Never Claimed Depreciation: The Form 3115 Fix

Under the allowed or allowable rule, the IRS reduces your basis by the depreciation you were entitled to claim whether or not you took it. You owe recapture on deductions you never received, and your adjusted basis is lower than you think.

The fix is to 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. File it before you sell, ideally in the tax year preceding the sale, so the deductions land before the recapture event.

The numbers are meaningful. On a $250,000 depreciable basis, straight-line residential depreciation is $250,000 divided by 27.5, or $9,091 per year. Ten years of missed deductions is roughly $90,909. At a 24% marginal rate that is about $21,818 of tax savings left on the table, and you will still owe 25% recapture on the full $90,909 when you sell, roughly $22,727. You pay the recapture either way, so the only question is whether you collect the deductions first.

Watch the depreciable base Depreciation can never exceed the depreciable basis. If a calculator tells you that ten years on a $250,000 basis produced more than $250,000 of deductions, the model is broken. Total straight-line depreciation over the full 27.5 year life equals the depreciable basis exactly.

The Mid-Month Convention: Partial-Year Depreciation

Real property under MACRS uses the mid-month convention rather than the half-year convention. The IRS treats the property as placed in service at the midpoint of the month you acquired it, and disposed of at the midpoint of the month you sold it.

Buy a residential rental in March and you get half a month for March plus nine full months for April through December, which is 9.5 months of depreciation in year one. Sell in September and you get eight full months plus half of September, which is 8.5 months in the final year. Both adjustments feed your total accumulated depreciation at sale, which then feeds adjusted basis, realized gain, and every number downstream.

For personal property identified through a cost segregation study, such as appliances, carpeting, and land improvements, the half-year convention applies instead: half a year of depreciation in both the first and last year of ownership, unless the mid-quarter convention is triggered.

Build It Yourself: The Excel Formula Reference

If you would rather build your own 1031 exchange spreadsheet than use ours, here is the complete formula chain using named ranges. Define each input as a named range in Excel or Google Sheets and the rest calculates itself.

Inputs to define

PurchasePrice, ClosingCosts, Improvements, AccumDep, SalePrice, SellingCosts, OldMortgage, ReplacementPrice, NewMortgage, CapGainRate, StateRate

Core calculation chain

AdjBasis = PurchasePrice + ClosingCosts + Improvements - AccumDep NetSalePrice = SalePrice - SellingCosts RealizedGain = MAX(0, NetSalePrice - AdjBasis) CashToQI = NetSalePrice - OldMortgage CashRequired = ReplacementPrice - NewMortgage CashReceived = MAX(0, CashToQI - CashRequired) CashPaid = MAX(0, CashRequired - CashToQI) NetDebtRelief = MAX(0, (OldMortgage - NewMortgage) - CashPaid) TotalBoot = CashReceived + NetDebtRelief RecognizedGain = MIN(TotalBoot, RealizedGain) DeferredGain = RealizedGain - RecognizedGain ReplacementBasis= ReplacementPrice - DeferredGain

Validation formulas

These two cells are what separate a trustworthy worksheet from a plausible-looking one. Both should return OK on every scenario you run.

BootCheck = IF(ROUND(TotalBoot,2)=ROUND(MAX(0,NetSalePrice-ReplacementPrice),2), "OK","Boot does not reconcile to value shortfall") BasisCheck = IF(ROUND(ReplacementBasis,2)=ROUND(AdjBasis - CashReceived - OldMortgage + CashPaid + NewMortgage + RecognizedGain,2), "OK","Basis does not reconcile to IRC 1031(d)")

Tax layers

RecaptureBase = MIN(RecognizedGain, AccumDep) RecaptureTax = RecaptureBase * 0.25 CapGainBase = MAX(0, RecognizedGain - AccumDep) CapGainTax = CapGainBase * CapGainRate NIIT = RecognizedGain * 0.038 StateTax = RecognizedGain * StateRate TotalTax = RecaptureTax + CapGainTax + NIIT + StateTax

Swap RecognizedGain for RealizedGain in the tax block to model the outright sale, and the difference between the two totals is your deferred tax. That single comparison is the entire argument for doing an exchange, and it is the reason our worksheet puts both columns side by side on one tab.

Frequently Asked Questions

Is there a free 1031 exchange calculator in Excel?

Yes. The worksheet linked at the top of this page is a free Excel download that runs every calculation documented above with live formulas rather than hard coded values. You enter your own property figures and the model returns your deferred tax, taxable boot, and replacement property basis, plus a side by side comparison against selling outright.

What happens if I did not claim depreciation, do I still owe recapture tax?

Yes. Under the allowed or allowable rule at IRC section 1016(a)(2), the IRS treats you as having 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 method going forward.

How do I calculate boot if my replacement property costs less than my relinquished property?

Add the cash that actually came back to you from the qualified intermediary to your net debt relief, which is the drop in mortgage balance less any outside cash you brought to closing. In a standard delayed exchange that total will equal the amount you bought down in price, so use the price shortfall as a cross-check rather than adding it on top. Adding both figures together double counts the debt reduction and overstates your tax.

What is my new depreciation basis after a 1031 exchange?

Your replacement property basis equals the purchase price less the deferred gain. That basis splits into two schedules: carryover basis, which continues the relinquished property's remaining recovery period, and excess basis for any additional capital you invested, which starts a fresh 27.5 or 39 year schedule. Both are allocated between land and building before you depreciate.

Can I do a 1031 exchange if my property came from a previous 1031 exchange?

Yes, sequential exchanges are common. Your adjusted basis carries forward from the original property rather than from the current purchase price, though any new capital you contribute along the way does increase basis. The deferred gain compounds with each exchange. Chaining exchanges until death allows heirs to take a stepped-up basis under IRC section 1014, eliminating the deferred gain entirely.

What is the difference between mortgage boot and cash boot?

Cash boot is money that actually comes back to you because you did not reinvest all proceeds. Mortgage boot is debt relief: your new loan is smaller than the one paid off, and the IRS treats being freed from a liability like receiving cash. Both are taxable. Outside cash you contribute can offset mortgage boot, but taking on extra debt cannot offset cash boot.

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 5, 7, and 15 year schedules, accelerating deductions. On the relinquished property it helps you calculate accumulated depreciation accurately. On the replacement it maximises future depreciation. Be aware that section 1245 property identified through cost segregation is recaptured at ordinary income rates rather than the 25% section 1250 rate.

What happens to my deferred tax when I die?

Under IRC section 1014 your heirs receive the property at fair market value as of the date of death, a stepped-up basis. That eliminates the accumulated deferred gain, the depreciation recapture, and the capital gains. The deferred tax is never paid. It is the strongest argument for serial exchanges held through a lifetime, and worth reviewing with an estate attorney rather than assuming current law persists.

Run your own numbers

Download the Excel worksheet using the form at the top of this page, or start with a focused tool: the partial 1031 boot calculator, the depreciation recapture calculator, the Form 8824 worksheet, or the 45-day identification validator. For the underlying rules, the 1031 Bible covers eligibility, timing, and structure in full.

This article explains general 1031 exchange calculation mechanics and is not legal, investment, or tax advice. Tax rates, brackets, and thresholds change. Confirm every figure with a qualified CPA or tax attorney before filing. IRS guidance on like-kind exchanges is available in Publication 544 and the IRS like-kind exchange fact sheet.