1031 Exchange Calculator Formula

Understand the math behind the 1031 exchange calculator. Each variable explained with a worked example.

Formulas Used

Total Tax Deferred

tax_deferred = total_tax_deferred

Minimum Replacement Property Price

min_replacement_price = sale_price

Minimum New Mortgage Required

min_replacement_debt = mortgage_paid_off

Realized Gain

gain_realized = realized_gain

Federal Capital Gains Deferred

fed_tax_saved = federal_cap_gains

Depreciation Recapture Deferred

dep_tax_saved = dep_recapture

Variables

VariableDescriptionDefault
sale_priceRelinquished Property Sale Price(USD)600000
adjusted_basisAdjusted Basis(USD)350000
selling_costsSelling Costs(USD)36000
mortgage_paid_offMortgage Balance Paid Off(USD)200000
depreciation_takenDepreciation Taken(USD)50000
cap_gains_rateCapital Gains Rate(%)15
depreciation_recapture_rateDepreciation Recapture Rate(%)25
state_tax_rateState Capital Gains Rate(%)5
net_saleDerived value= sale_price - selling_costscalculated
realized_gainDerived value= net_sale - adjusted_basiscalculated
federal_cap_gainsDerived value= (realized_gain - depreciation_taken) * cap_gains_rate / 100calculated
dep_recaptureDerived value= depreciation_taken * depreciation_recapture_rate / 100calculated
state_taxDerived value= realized_gain * state_tax_rate / 100calculated
total_tax_deferredDerived value= federal_cap_gains + dep_recapture + state_taxcalculated
exchange_equityDerived value= net_sale - mortgage_paid_off - selling_costs > 0 ? net_sale - mortgage_paid_off : 0calculated

How It Works

1031 Like-Kind Exchange

Section 1031 of the Internal Revenue Code allows investors to defer capital gains taxes by exchanging one investment property for another of like kind.

Requirements for Full Deferral

1. Replacement price must equal or exceed the sale price of the relinquished property 2. All equity must be reinvested into the replacement property 3. Debt must be replaced with equal or greater debt on the replacement property

Critical Timelines

  • 45 days: Identify replacement property (up to 3 properties)
  • 180 days: Close on the replacement property
  • What Qualifies

  • Investment or business real estate only (not primary residence)
  • Like-kind is broad: apartment can exchange for commercial, land, etc.
  • A qualified intermediary must hold the funds between sales
  • Worked Example

    Selling investment property for $600,000 with $350,000 basis, $36,000 selling costs, $200,000 mortgage, $50,000 depreciation taken.

    sale_price = 600000adjusted_basis = 350000selling_costs = 36000mortgage_paid_off = 200000depreciation_taken = 50000cap_gains_rate = 15depreciation_recapture_rate = 25state_tax_rate = 5
    1. 01Net sale: $600,000 - $36,000 = $564,000
    2. 02Realized gain: $564,000 - $350,000 = $214,000
    3. 03Federal cap gains: ($214,000 - $50,000) x 15% = $24,600
    4. 04Depreciation recapture: $50,000 x 25% = $12,500
    5. 05State tax: $214,000 x 5% = $10,700
    6. 06Total tax deferred: $24,600 + $12,500 + $10,700 = $47,800
    7. 07Minimum replacement property price: $600,000
    8. 08Minimum new mortgage: $200,000

    Ready to run the numbers?

    Open 1031 Exchange Calculator