TL;DR
- A 1031 exchange formula computes realized gain as sale price minus selling costs minus adjusted basis, then compares that figure against any "boot" received to determine what portion of the gain is taxed now versus deferred. - Recognized (taxable) gain in the exchange year equals the smaller of the realized gain or the total boot, meaning boot can never trigger more tax than the transaction actually generated. - Boot commonly comes from two sources: cash pulled out of the deal and unreinvested, or a net reduction in mortgage debt that is not offset by additional cash into the replacement property. - Depreciation recapture is generally taxed at a 25% rate up to the amount of recognized gain, with any remaining recapture carrying forward deferred along with the rest of the exchange. - Modeling shows that fully deferring a gain typically requires the replacement property to meet or exceed both the net sale price and the mortgage debt of the property sold.
A like-kind exchange under IRC §1031 allows an investor selling business or investment real estate to defer capital gains tax by rolling the proceeds into a replacement property, provided a strict set of formulas, deadlines, and structural rules are followed. The deferral is not automatic or unlimited: it depends on how much of the transaction value is "boot" versus how much is reinvested into like-kind property. Modeling the exchange mathematically before a sale closes helps illustrate how much tax exposure a given deal structure would generate.
Informational calculation reference only. All equations, tools, and outputs on this page are intended strictly for educational modeling and mathematical illustration. They do not constitute certified financial, legal, or tax advice. For specific scenarios, consult a certified public accountant (CPA) or a fiduciary financial advisor.
The mathematical formula behind the calculation
The exchange calculation begins with realized gain, which measures the total economic gain on the relinquished property regardless of how much of it ends up taxable:
\text{Realized Gain} = \text{Sale Price} - \text{Selling Costs} - \text{Adjusted Basis}
Adjusted basis reflects the original purchase price plus capital improvements, minus depreciation already claimed. Because depreciation lowers basis over time, a long-held rental property frequently carries a realized gain that is substantially larger than the investor's original cash investment.
Not all of the realized gain is automatically deferred. Any value received in the exchange that is not like-kind real property — referred to as "boot" — is potentially taxable in the year of the exchange. Boot generally comes from two sources modeled together:
\text{Total Boot} = \text{Cash Boot} + \text{Debt-Relief Boot}
Cash boot is net sale equity that is not reinvested into the replacement property. Debt-relief boot arises when the mortgage paid off on the relinquished property exceeds the new loan taken on the replacement property, and that gap is not made up with additional cash contributed to the deal.
The portion of the gain that is actually recognized — meaning taxed in the current year — is capped by the smaller of the two figures already calculated:
\text{Recognized Gain} = \min(\text{Realized Gain}, \ \text{Total Boot})
This formula matters because it means boot can never generate more current-year tax than the transaction's realized gain, even in a scenario with substantial boot relative to a smaller total gain. Everything above the recognized gain carries forward, deferred, into the replacement property's basis.
Depreciation recapture is modeled as a distinct layer within the recognized gain. Under current law, recapture is generally taxed at a flat 25% rate up to the amount of recognized gain, with any excess recapture continuing to carry forward deferred:
\text{Recapture Tax} = \min(\text{Recognized Gain}, \ \text{Accumulated Depreciation}) \times 25\%
Any recognized gain remaining after the recapture layer is taxed at the applicable long-term capital gains rate, plus state tax and the Net Investment Income Tax (NIIT) where applicable:
\text{Total Tax Due} = \text{Recapture Tax} + \big(\text{Recognized Gain} - \text{Recapture Portion}\big) \times \big(\text{LTCG Rate} + \text{State Rate} + \text{NIIT Rate}\big)
Finally, the replacement property's new basis carries the deferred portion of the gain forward, which affects future depreciation schedules and any subsequent sale:
\text{New Basis} = \text{Replacement Property Cost} - \text{Deferred Gain}
Step-by-step practical calculation example
Consider a modeled scenario: an investor sells a rental property for $550,000, incurring $33,000 in selling costs, against an adjusted basis of $250,000. The old mortgage payoff is $150,000. The investor purchases a $600,000 replacement property, financed with a $180,000 new loan.
Step 1 — Calculate realized gain.
$$ \$550{,}000 - \$33{,}000 - \$250{,}000 = \$267{,}000 $$
Step 2 — Determine cash reinvested and boot. Net sale proceeds after selling costs and mortgage payoff equal $550,000 − $33,000 − $150,000 = $367,000. The investor contributes this full amount plus additional cash toward the $600,000 purchase, and the new loan of $180,000 exceeds the $150,000 payoff by $30,000, so there is no net debt reduction.
Step 3 — Calculate total boot. With all net equity reinvested and debt increasing rather than decreasing, cash boot and debt-relief boot are both $0.
$$ \text{Total Boot} = \$0
Step 4 — Apply the recognized gain formula.
Step 5 — Determine the new basis. Because the entire $267,000 realized gain is deferred, it reduces the replacement property's basis below its purchase price.
$$ \$600{,}000 - \$267{,}000 = \$333{,}000 $$
| Scenario input | Modeled value |
|---|---|
| Sale price | $550,000 |
| Selling costs | $33,000 |
| Adjusted basis | $250,000 |
| Realized gain | $267,000 |
| Total boot | $0 |
| Recognized (taxable) gain | $0 |
| Replacement property cost | $600,000 |
| New carryover basis | $333,000 |
Strategic applications for financial modeling
Investors frequently model multiple replacement-property scenarios before identifying candidates within the 45-day identification window. Adjusting the replacement price or loan amount in the formula shows immediately how much boot — and therefore how much current-year tax — a given deal structure would generate, before any offer is made.
Depreciation recapture modeling is a common secondary application. Because recapture is taxed at a flat rate distinct from the long-term capital gains rate, separating the two layers in a model clarifies how much of a hypothetical recognized gain would be taxed at the higher 25% recapture rate versus the lower blended capital-gains-plus-NIIT rate.
Portfolio-level modeling is also common among investors executing sequential exchanges across multiple properties over time. Tracking the carryover basis from each prior exchange into the next property's model shows how deferred gain can accumulate across a multi-property holding period, which becomes relevant if a future sale is not structured as another exchange.
Some investors model a partial exchange deliberately, accepting a calculated amount of boot to extract some cash from a sale while still deferring the majority of the gain. Running the recognized-gain formula against several boot scenarios illustrates the tax cost of extracting varying amounts of cash from the transaction.
Common pitfalls and variable mistakes
A frequent modeling error assumes that reinvesting all cash proceeds alone guarantees full deferral. As the formula shows, debt-relief boot is calculated independently of cash boot — a replacement property financed with a smaller new loan than the old mortgage payoff can generate boot even when every dollar of cash equity is reinvested.
Another common mistake omits selling costs from the realized gain calculation, which overstates the taxable base. Commissions, title fees, and other transaction costs reduce the sale price side of the formula and should be modeled explicitly rather than assumed away.
Modeling errors also arise from treating the 45-day identification and 180-day closing deadlines as flexible. Both deadlines run concurrently from the closing date of the relinquished property and are rarely extended, so a model that assumes a longer identification window than the rules allow can overstate the practical replacement-property options available.
Finally, some models overlook that a Qualified Intermediary must hold sale proceeds throughout the exchange. If the investor receives or controls the funds directly at any point, the exchange is disqualified entirely regardless of how the boot and basis figures were modeled, converting the full realized gain into a current-year taxable event.
Explore the full calculation with adjustable sale price, basis, and financing variables using the 1031 Exchange Calculator.
Disclaimer: While we strive for absolute mathematical precision, actual real-world financial outcomes may vary based on institutional fees, localized tax brackets, changes in federal legislation, or fluctuating market indexes.
