Skip to content
PromptedCRE

Like-kind exchange math

Work out what a like-kind exchange defers: the gain realized, the boot after debt and cash net against each other, the gain recognized now, the gain deferred, the replacement's basis and the tax at rates you enter.

Of the $2,350,000 gain, $100,000 is recognized now and $2,250,000 is deferred; the replacement's basis is $2,050,000.

Of the $2,350,000 gain, $100,000 is recognized now and $2,250,000 is deferred; the replacement's basis is $2,050,000.

Gain deferred

$2,250,000

Boot received
$100,000
cash, other property, net debt relief
Tax now
$28,800
at the rates entered
Tax deferred
$570,500
at the same rates

Where the gain goes

  • Recognized now$100,0004.3%
  • Deferred$2,250,00095.7%

How the debt nets

liabilities relieved count as cash received

Debt paid off
$1,600,000
Covered by new debt
$1,600,000
Covered by cash added
$0
Net debt relief (boot)
$0

Checks for a full deferral

  • YesThe replacement's $4,300,000 price is at least the $3,850,000 amount realized.
  • No$100,000 in cash and other property is taken out, and it is boot.
  • YesNew debt and cash added cover the debt paid off, so the debt relief is not boot.

The 45-day identification and 180-day exchange periods are dated in the deadline calendar.

Drawn from
The worked example
Runs
In your browser
For your agent
calc_run with id exchange-1031

Inputs

Worked example. Type over any value on a dashed line.

Property given up
$
$

commission, title, closing

$

cost plus improvements less depreciation

$

at closing, or taken over by the buyer

$

allowed or allowable; 0 if none

Replacement property
$
$

a new loan, or one taken over

$

your own cash, beyond the proceeds

$

intermediary, title, closing; not loan fees

Taken out of the exchange
$

after every cost is paid

$

its fair market value; 0 if none

Tax rates

Example rates: the federal maximums the rule cards state. Enter your own; 0 leaves a rate out.

%

on gain beyond the depreciation

%

on gain up to the depreciation

%

added to both rates

Every formula it ran, in order.

26 CFR 1.1031(b)-1 and 1.1031(d)-2

  1. 1Amount realized$4,000,000.00 sale price − $120,000.00 selling costs − $30,000.00 exchange costs$3,850,000.00
  2. 2Realized gain$3,850,000.00 amount realized − $1,500,000.00 adjusted basis$2,350,000.00
  3. 3Liabilities relieveddebt paid off or taken over on the property given up, treated as money received$1,600,000.00
  4. 4Offset by new debtmin($1,600,000.00 relieved, $2,150,000.00 new debt)$1,600,000.00
  5. 5Offset by cash addedmin($1,600,000.00 − $1,600,000.00 relief left, $0.00 cash added)$0.00
  6. 6Net liability relief$1,600,000.00 − $1,600,000.00 − $0.00$0.00
  7. 7Boot received$100,000.00 cash taken + $0.00 other property + $0.00 net liability relief (neither new debt nor cash added offsets cash or other property taken)$100,000.00
  8. 8Recognized gainmin($100,000.00 boot, $2,350,000.00 realized gain)$100,000.00
  9. 9Deferred gain$2,350,000.00 realized − $100,000.00 recognized$2,250,000.00
  10. 10Basis of the replacement$1,500,000.00 basis given up + $2,150,000.00 new debt + $0.00 cash added − $100,000.00 cash taken − $1,600,000.00 liabilities relieved + $100,000.00 recognized − $0.00 other property$2,050,000.00
  11. 11Basis cross-check, from price$4,300,000.00 replacement price − $2,250,000.00 deferred$2,050,000.00
  12. 12Sources and uses gap$3,850,000.00 realized − $1,600,000.00 debt paid off + $2,150,000.00 new debt + $0.00 cash added − $4,300,000.00 replacement − $100,000.00 cash taken − $0.00 other property$0.00
  13. 13Recognized gain from depreciation takenmin($800,000.00 depreciation taken, $100,000.00 recognized), taken first$100,000.00
  14. 14Tax now$100,000.00 × (25.00% + 3.80%) + $0.00 × (20.00% + 3.80%)$28,800.00
  15. 15Tax on the whole gainas if all of it were recognized now: $800,000.00 × 28.80% + $1,550,000.00 × 23.80%$599,300.00
  16. 16Tax deferred$599,300.00 on the whole gain − $28,800.00 now$570,500.00
  17. 17Replacement at least equal in value$4,300,000.00 replacement ≥ $3,850,000.00 amount realizedyes
  18. 18All net equity reinvested$100,000.00 cash taken + $0.00 other property = $0.00no
  19. 19Debt replaced$0.00 net liability relief = $0.00yes

Marked: the lines your last edit changed.

For your agent: calc_run returns these same 19 lines.

The rules this math rests on.

6 rule cards

  • Like-kind exchange: boot received and basis of the replacement property

    Federal
    Rule us-fed.irc.1031-boot-and-basis

    When an otherwise qualifying exchange also gives the taxpayer money or other property, gain is recognized up to the money plus the other property's fair market value; no loss is recognized. Liabilities the other party assumes, or subject to which the relinquished property passes, count as money received. Liabilities the taxpayer takes on, and cash or other property it gives, offset liabilities relieved, but liabilities taken on never offset cash or other property received. The replacement's basis is the basis given up, less money received and plus gain recognized; the regulation's examples also add liabilities taken on and cash paid. Other property received takes its fair market value as basis.

    26 USC 1031(b), (c) and (d); 26 CFR 1.1031(b)-1(c) and 1.1031(d)-2Sources checked AI-drafted

  • Like-kind exchange: what property qualifies

    Federal
    Rule us-fed.irc.1031-like-kind-real-property

    For exchanges completed after 2017, no gain or loss is recognized when real property held for productive use in a trade or business or for investment is exchanged solely for like-kind real property to be held for either use. Real property held primarily for sale does not qualify. Like kind looks to the nature of the property, not its grade or quality: improved and unimproved real estate are like kind; United States and foreign real property are not. Real property means land and improvements, and interests such as fee ownership, leaseholds, options and easements, but not notes, securities, most partnership interests or stock other than cooperative housing stock.

    26 USC 1031(a)(1), (a)(2) and (h); 26 CFR 1.1031(a)-1(b) and 1.1031(a)-3(a)Sources checked AI-drafted

  • Unrecaptured section 1250 gain on the sale of depreciated real property

    Federal
    Rule us-fed.irc.unrecaptured-section-1250-gain

    Section 1250 treats gain on depreciable realty as ordinary income up to additional depreciation, all of it for most property. Additional depreciation is all depreciation for property held one year or less; if longer, only the excess over straight line, so a straight-line building has none. Unrecaptured section 1250 gain is long-term capital gain, not otherwise ordinary, that would be ordinary if section 1250 reached all depreciation at 100 percent, less any excess of net short-term capital loss, collectibles loss and long-term loss carryover over collectibles and section 1202 gain. Its top rate, for individuals, estates and trusts, is 25 percent. Allowable depreciation counts unless records show less allowed.

    26 U.S.C. 1(h)(1)(E), 1(h)(4) and 1(h)(6)(A) (cap in 1(h)(6)(B)); 26 U.S.C. 1250(a)(1) and (b)(1) and (3)Sources checked AI-drafted

  • Net investment income tax: 3.8 percent on rents and gains above a threshold

    Federal
    Rule us-fed.irc.net-investment-income-tax

    An individual owes 3.8 percent tax on the lesser of net investment income or modified adjusted gross income above $250,000 (joint return or surviving spouse), $125,000 (married filing separately) or $200,000 (otherwise); the thresholds are not indexed. Net investment income includes rents and net gain from selling property, less allocable deductions, unless earned in the ordinary course of a nonpassive trade or business. A regulatory safe harbor deems a real estate professional's rents and gains from a rental real estate activity in which they participate over 500 hours in the year, or in five of the ten prior years, to arise in a trade or business.

    26 U.S.C. 1411(a), (b) and (c); 26 CFR 1.1411-4(a), (b) and (g)(7)Sources checked AI-drafted

  • Gain on business real property: section 1231 netting

    Federal
    Rule us-fed.irc.section-1231-gains-and-losses

    Section 1231 covers gains and losses from selling, exchanging or involuntarily converting real or depreciable property used in a trade or business and held over one year, other than inventory or property held primarily for sale to customers. If a year's recognized section 1231 gains exceed its section 1231 losses, all are treated as long-term capital gains and losses; otherwise none is a capital gain or loss. A net section 1231 gain is ordinary income up to the non-recaptured net section 1231 losses of the five most recent preceding years. Unrecaptured section 1250 gain from a year's section 1231 dispositions cannot exceed that year's net section 1231 gain.

    26 U.S.C. 1231(a), (b)(1) and (c); 26 U.S.C. 1(h)(6)(A)(i) and (B)Sources checked AI-drafted

  • Gain on a sale: amount realized and adjusted basis

    Federal
    Rule us-fed.irc.gain-and-adjusted-basis

    Gain on a sale is the amount realized less adjusted basis; a loss is the reverse. The amount realized is money plus the fair market value of property received, and generally includes liabilities the sale discharges, such as a mortgage the buyer assumes or a nonrecourse loan the property is sold subject to. Costs paid to facilitate the sale, such as commissions, reduce the amount realized and are not deducted or added to basis; a dealer in property deducts them. Adjusted basis is the basis, generally cost, raised by capital expenditures and lowered by depreciation: the amount allowable, claimed or not, or a larger amount allowed that reduced tax.

    26 U.S.C. 1001(a) and (b), 1011(a), 1012(a) and 1016(a)(1) and (2); 26 CFR 1.263(a)-1(e) and 1.1001-2(a); IRS Publication 544Sources checked AI-drafted

How it counts, and how it is checked.

Checked by an independent calculation

How it counts

  • The amount realized is the sale price less selling and exchange costs, each cost taken as paid out of the proceeds so the cash taken out is what is left, and the realized gain is that amount less the adjusted basis; this follows Form 8824, which adds exchange expenses to the basis given up, and the replacement's basis comes out the same as if the exchange costs were added to its price instead.
  • Debt paid off counts as cash received; new debt on the replacement and then cash added offset it, as in 26 CFR 1.1031(d)-2 example 2, and neither offsets cash or other property taken out. Boot is cash taken plus other property plus the debt relief left over, and the recognized gain is the lesser of boot and the realized gain; a loss is never recognized.
  • The replacement's basis is the basis given up, plus new debt and cash added, less cash taken and debt paid off, plus gain recognized, less other property (which takes its fair market value); it is checked against the replacement price less the deferred gain, and the two agree whenever the money in equals the money out.
  • Tax is priced at the rates entered: gain up to the depreciation taken at the unrecaptured section 1250 rate, the rest at the capital gain rate, the net investment income rate added to both, and recognized gain taken from the depreciation part first. The tax deferred is the tax on the whole gain less the tax now.
  • The example's rates are the federal maximums the rule cards state, not anyone's own rates, and the result is arithmetic on the inputs, not tax advice.
  • Left out: the netting of the year's other section 1231 gains and losses, the look-back that makes net section 1231 gain ordinary income up to the net section 1231 losses of the five years before, and the cap the year's net section 1231 gain puts on the unrecaptured section 1250 part; recognized gain and the tax on the whole gain are priced as if all of it were long-term.

What the checks pin

  • The worked example's amount realized, realized gain, netting, boot, recognized and deferred gain, basis both ways, sources and uses gap, tax now, tax on the whole gain and tax deferred match a separate Python calculation (decimal module, 2026-11-13) laid out as IRS Form 8824 lines 15 to 25, to the cent.
  • The regulation's own illustrations in 26 CFR 1.1031(d)-2 (example 1, and example 2 for both parties) and 1.1031(b)-1 (example 1) come out to the recognized gain and basis the regulation states.
  • Trading down in debt with cash added to cover it, with none, and with part of it; full boot; a loss; other property received; zero rates; and inputs that do not balance are pinned to the same Python calculation; a balanced closing entered in cents shows a gap of exactly zero.
  • On five balanced closings, sources equal uses, recognized plus deferred equals realized, recognized never exceeds boot or gain, the two bases agree, tax now plus tax deferred equals the tax on the whole gain, and with no boot the basis equals its closed form; costs above the price, a rate of 100% and negative amounts are refused in plain words.

Called by 6 steps in 3 playbooks.

For your agent

It calls calc_run with id exchange-1031 and the same inputs as the form above, and gets back the result, its working and the rule cards it rests on. The worked example is pinned in __tests__/calc-exchange-1031.test.ts and __tests__/calc-modules.test.ts, which run it through the same function this page and the tool call.

Where the catalog stands

96 written in full: 72 playbooks, 22 scenarios and 2 audits. An agent can do 64% of the 1169 written steps.

Federal + Texas · Counted