FREE · 501(c)(3) NONPROFIT · EDUCATION ONLY

Mortgage over basis: will the tax be bigger than your check?

Paying off a mortgage at closing does not reduce your taxable gain. The gain is figured on the full sale price minus your adjusted basis; the loan payoff only reduces your cash. After a cash-out refinance the loan can sit above your basis — and then the tax can be larger than the check you walk away with. Put in your numbers and see both side by side.

1 · What you paid

If you exchanged into this property, the price of the replacement property.
Title, escrow, recording, transfer tax you paid to buy. Not loan fees.
Roof, additions, remodels. Not repairs.

2 · What lowered your basis

Total from every year’s Form 4562 / Schedule E. Enter it even if you never claimed it — §1016(a)(2) lowers your basis by the depreciation you were allowed. If you exchanged into this property, include depreciation from the property you gave up; it carries over.
Don’t know it? Estimate it

§1245 property. Recaptured as ordinary income, not capped at 25%. Leave 0 if unsure.
The deferred gain carries in as a lower basis.
Both reduce basis (IRS Pub 551). Leave 0 if none.

3 · The sale

Commission + closing. 6% is typical.
Every loan secured by the property, including any cash-out refinance or HELOC.

4 · You

Audit trail / Sources

Every rule this calculator applies, and where it comes from. Rates are 2026 federal; state rates are the same table our capital gains calculator uses.

  1. IRC §1011 — Adjusted basis is the starting point for gain or loss.
  2. IRC §1016(a)(2) — Basis is reduced by depreciation “allowed or allowable” — claimed or not.
  3. IRC §1001(b) — Gain = amount realized minus adjusted basis.
  4. Treas. Reg. §1.1001-2 — Amount realized includes liabilities the seller is relieved of — debt does not reduce the gain.
  5. IRC §1(h)(1)(E) and §1(h)(6) — Unrecaptured §1250 gain is taxed at no more than 25%; the 0/15/20% layers apply to the rest.
  6. IRC §1250 — Recapture on depreciable real property (buildings).
  7. IRC §1245 — Recapture on personal property (equipment, cost-segregation components) — taxed as ordinary income.
  8. IRC §1411 — 3.8% net investment income tax above $200,000 single / $250,000 joint MAGI (not indexed).
  9. IRC §453(i) — In an installment sale, ordinary-income recapture (§1245 and any §1250 additional depreciation) is recognized in the year of sale.
  10. Treas. Reg. §1.453-12 — Unrecaptured §1250 gain in an installment sale is taken into account as payments are received, before other long-term gain.
  11. Treas. Reg. §15a.453-1(b)(3) — Qualifying debt assumed by the buyer in excess of basis is a payment in the year of sale.
  12. Treas. Reg. §1.1031(d)-2 — Net debt relief in a like-kind exchange is treated as money received (mortgage boot).
  13. IRS Publication 544 — Sales and Other Dispositions of Assets — recapture, installment sales, like-kind exchanges.
  14. IRS Publication 551 — Basis of Assets — what increases and decreases basis (improvements, depreciation, casualty losses, insurance reimbursements).
  15. IRS Publication 946 — 27.5-year residential and 39-year nonresidential recovery periods.
  16. 2026 brackets: Rev. Proc. 2025-32 — 2026 ordinary brackets and the 0/15/20% capital gains breakpoints used here.
  17. California FTB rate schedules, R&TC §17041 and §17043 — California taxes capital gain as ordinary income, 1%–12.3% plus the 1% Mental Health Services Tax over $1M.

The Retirement Literacy Foundation is a 501(c)(3) public charity. This page is general education, not tax, legal or investment advice. Nothing is sold here.

Questions people ask

How does a mortgage affect capital gains tax when I sell?
It does not change the gain. Under IRC 1001(b) and Treas. Reg. 1.1001-2 the amount realized includes the debt paid off or assumed, so the gain is sale price minus selling costs minus adjusted basis — whatever you owe. The loan changes only how much cash you receive.
Can I owe more tax than the cash I get from the sale?
Yes. If a cash-out refinance pushed the loan above your adjusted basis, your taxable gain is larger than your cash at closing by exactly that difference. The refinance cash was tax-free when you borrowed it; the sale is when the gain behind it is finally taxed.
Is cash-out refinance money taxable?
Not when you borrow it — a loan is not income. But it does not raise your basis either (unless spent on improvements), so it increases the gap between what you owe and what your basis is when you sell.
What is mortgage boot in a 1031 exchange?
If the loan paid off on the property you sell is larger than the debt on the replacement property, and you do not add cash to make up the difference, the net debt relief is boot and it is taxable in the year of the exchange (Treas. Reg. 1.1031(d)-2).
What happens to mortgage over basis in an installment sale?
If the buyer assumes or takes the property subject to your loan, the part of that loan above your adjusted basis is treated as a payment received in the year of sale (Treas. Reg. 15a.453-1(b)(3)(i)). The ordinary-income part of depreciation recapture (Section 1245, including cost-segregation items) is taxed in the year of sale no matter how the payments are spread (IRC 453(i)); the 25% unrecaptured Section 1250 gain is spread over the payments with the rest of the gain (Treas. Reg. 1.453-12).