Skip to content
PromptedCRE

Sale proceeds and gain

Work out what a sale leaves the seller at a given price: the gain, the tax on it at rates you enter, and the cash at closing before tax and after.

The sale leaves $2,238,550 after tax: $2,815,000 at closing, less $576,450 of tax on the gain.

The sale leaves $2,238,550 after tax: $2,815,000 at closing, less $576,450 of tax on the gain.

Cash after tax

$2,238,550

on a $6,000,000 price; federal tax at the rates entered, paid with the return

Gain
$2,275,000
amount realized less adjusted basis
Amount realized
$5,775,000
after $225,000 of selling costs
Adjusted basis
$3,500,000
cost plus improvements less depreciation
Clearing price
$3,097,938
the lowest price that pays the payoffs and costs, before tax

Where the price goes

share of the price

  • Selling costs$225,0003.8%
  • Loan and other payoffs$2,960,00049.3%
  • Tax on the gain$576,4509.6%
  • Cash after tax$2,238,55037.3%

How the gain splits

at the rates entered

Gain from depreciation taken
$700,000
priced at the unrecaptured rate
Rest of the gain
$1,575,000
priced at the capital gain rate
Tax on the depreciation part
$201,600
net investment income rate added
Tax on the rest of the gain
$374,850
net investment income rate added
Drawn from
The worked example
Runs
In your browser
For your agent
calc_run with id sale-proceeds

Inputs

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

The sale
$

with any loan the buyer takes over

%

share of the price, such as a commission

$

legal, title, survey; 0 if none

Paid off at closing

These come out of the cash. They do not change the gain.

$

payoff letter total, or a loan taken over

$

a second lien, property tax owed to closing, tenant deposits credited to the buyer

Basis
$

with the acquisition costs added to basis

$

added since the purchase; 0 if none

$

allowed or allowable, claimed or not; 0 if none

Tax rates

Example rates: the top federal rates the rule cards state. Enter your own, or clear all three to stop at cash before tax.

%

on gain beyond the depreciation

%

on gain up to the building's straight-line depreciation

%

only if it applies to the seller; added to both rates; 0 leaves it out

The same sale at five prices.

5 and 10 percent either side · fixed costs, payoffs and basis held · a negative gain is a loss

Selling costs, gain, tax and cash at the price entered and at 5 and 10 percent either side
PriceSelling costsGainTaxCash before taxCash after tax
$5,400,000 (10% lower)$207,000$1,693,000$437,934$2,233,000$1,795,066
$5,700,000 (5% lower)$216,000$1,984,000$507,192$2,524,000$2,016,808
$6,000,000 (entered)$225,000$2,275,000$576,450$2,815,000$2,238,550
$6,300,000 (5% higher)$234,000$2,566,000$645,708$3,106,000$2,460,292
$6,600,000 (10% higher)$243,000$2,857,000$714,966$3,397,000$2,682,034

Every formula it ran, in order.

26 U.S.C. 1001, 1016, 1(h) and 1411; 26 CFR 1.263(a)-1(e)

  1. 1Selling costs$6,000,000.00 price × 3.00% + $45,000.00 fixed$225,000.00
  2. 2Amount realized$6,000,000.00 price − $225,000.00 selling costs$5,775,000.00
  3. 3Adjusted basis$3,800,000.00 cost + $400,000.00 improvements − $700,000.00 depreciation$3,500,000.00
  4. 4Gain$5,775,000.00 amount realized − $3,500,000.00 adjusted basis$2,275,000.00
  5. 5Gain from depreciation takenmin($700,000.00 depreciation, $2,275,000.00 gain)$700,000.00
  6. 6Rest of the gain$2,275,000.00 gain − $700,000.00 from depreciation$1,575,000.00
  7. 7Tax on the depreciation part$700,000.00 × (25.00% unrecaptured + 3.80% net investment income)$201,600.00
  8. 8Tax on the rest of the gain$1,575,000.00 × (20.00% capital gain + 3.80% net investment income)$374,850.00
  9. 9Tax on the gain$201,600.00 + $374,850.00$576,450.00
  10. 10Cash at closing, before tax$5,775,000.00 amount realized − $2,900,000.00 loan payoff − $60,000.00 other payoffs$2,815,000.00
  11. 11Cash after tax$2,815,000.00 before tax − $576,450.00 tax$2,238,550.00
  12. 12Clearing price($2,900,000.00 loan payoff + $60,000.00 other payoffs + $45,000.00 fixed costs) ÷ (1 − 3.00%)$3,097,938.14
  13. 13Cash after tax at a price 10% lower$5,400,000.00 price: $5,193,000.00 amount realized − $2,960,000.00 payoffs − $437,934.00 tax$1,795,066.00
  14. 14Cash after tax at a price 5% lower$5,700,000.00 price: $5,484,000.00 amount realized − $2,960,000.00 payoffs − $507,192.00 tax$2,016,808.00
  15. 15Cash after tax at a price 5% higher$6,300,000.00 price: $6,066,000.00 amount realized − $2,960,000.00 payoffs − $645,708.00 tax$2,460,292.00
  16. 16Cash after tax at a price 10% higher$6,600,000.00 price: $6,357,000.00 amount realized − $2,960,000.00 payoffs − $714,966.00 tax$2,682,034.00

Marked: the lines your last edit changed.

For your agent: calc_run returns these same 16 lines.

The rules this math rests on.

4 rule cards

  • 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

  • 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

  • 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

How it counts, and how it is checked.

Checked by an independent calculation

How it counts

  • Selling costs are the price times the selling cost rate plus the fixed costs. They reduce the amount realized, so they lower the gain as well as the cash; they are not added to basis. The adjusted basis is cost plus capital improvements less depreciation allowed or allowable, whether or not it was claimed, and the gain or loss is the amount realized less the adjusted basis.
  • Cash at closing before tax is the amount realized less the loan payoff and the other payoffs, which reduce cash, not gain; a loan the buyer takes over counts in the amount realized, so it goes in the price and in the payoffs. The clearing price is the payoffs plus the fixed selling costs, divided by one less the selling cost rate; below it the seller must bring cash to closing.
  • When the three rates are entered, the whole gain is priced as long-term capital gain: the part up to the depreciation taken at the unrecaptured section 1250 rate, the rest at the capital gain rate, and the net investment income rate added to both as if all of the gain were above its threshold. That is the same pricing the like-kind exchange calculator uses for the tax on the whole gain. A loss is not priced, so what it may save in tax is not figured, and with all three rates blank no tax is figured.
  • The ladder runs the same sale at the price and at 5 and 10 percent either side, holding the fixed costs, the payoffs and the basis. Nothing is rounded until it is shown.
  • Left out: state tax, a sale of property held one year or less, depreciation on equipment and other personal property, depreciation beyond straight line on the building or its improvements (section 1250 makes gain up to that amount ordinary income), the netting of the year's other section 1231 gains and losses and the look-back to the five years before, suspended passive losses, installment reporting, tax at the entity level and a sale by a dealer in property. Every rate is an input, the example's rates are the top federal rates the rule cards state, not anyone's own rates, and the result is arithmetic on the inputs, not tax advice.

What the checks pin

  • The worked example's selling costs, amount realized, adjusted basis, gain, depreciation part, tax on each part, cash before and after tax, clearing price and all five ladder rows match a separate Python calculation (decimal module, 2026-11-14) that works the cash as a settlement statement and the gain and the tax two ways each, to the cent.
  • The gain example in IRS Publication 544 (2025) comes out to the amount realized, adjusted basis and $56,000 gain the IRS states.
  • No loan, a loss, a gain smaller than the depreciation taken, no rates, a sale that does not clear the debts, zero selling costs, cash that does not cover the tax and figures in cents are pinned to the same Python calculation; a reviewer's three sales of its own, including a loss with a loan larger than the price and a sale that does not clear the debts yet owes tax on a gain, are pinned to a second Python calculation written from the scope alone.
  • On seven sales, amount realized equals adjusted basis plus gain, the price equals selling costs plus payoffs plus cash, cash is zero at the clearing price and rises by one less the selling cost rate per dollar of price, the ladder's middle row is the result, and on the six with rates the tax equals what the like-kind exchange calculator reports as the tax on the whole gain; depreciation above cost plus improvements, a selling cost rate of 100% and rates given in part are refused in plain words.

Called by 15 steps in 9 playbooks and 1 scenario.

For your agent

It calls calc_run with id sale-proceeds 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-sale-proceeds.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