Mortgage over basis calculator: will the tax be bigger than your check?
By Hans Goldstein, founder, Retirement Literacy Foundation · Updated
Enrolled Agent, admitted to practice before the IRS.
Refinanced and pulled cash out? Paying off the loan cuts your cash, not your gain. Enter your numbers and compare the 2026 tax with the cash at closing.
1 · What you paid
2 · What lowered your basis
Don’t know it? Estimate it
3 · The sale
4 · You
The example is a $1,400,000 rental bought for $500,000, refinanced to a $900,000 loan. Change any number and the result updates. 2026 rules.
| Adjusted basis | |
| Total gain | |
| Unrecaptured §1250 gain (up to 25%) | |
| Total estimated tax | |
| Cash at closing after loan payoff | |
| Cash left after tax |
| Purchase price | |
| + Purchase closing costs | |
| + Capital improvements | |
| − Depreciation (allowed or allowable) §1016(a)(2) | |
| − Gain deferred from a prior 1031 | |
| − Casualty losses / insurance reimbursements | |
| Adjusted basis §1011 |
| Sale price | |
| − Selling costs | |
| = Amount realized the loan is NOT subtracted (Reg. 1.1001-2) | |
| − Adjusted basis | |
| Total gain §1001(b) | |
| §1245 recapture (ordinary income) | |
| Unrecaptured §1250 gain (taxed up to 25%) | |
| Remaining long-term capital gain (0/15/20%) |
| §1245 recapture at ordinary rates | |
| Unrecaptured §1250 gain | |
| Capital gain at 0% | |
| Capital gain at 15% | |
| Capital gain at 20% | |
| Net investment income tax 3.8% §1411 | |
| State income tax | |
| Total estimated tax |
| Sale price | |
| − Selling costs | |
| − Loan payoff | |
| Cash at closing | |
| − Total estimated tax | |
| Cash left after tax |
Education, not tax advice. 2026 federal brackets. The 3.8% test uses modified AGI, estimated as your “other taxable income” plus the 2026 standard deduction ($16,100 single / $32,200 married) plus the gain.
Unrecaptured §1250 gain is stacked on top of your other income and each slice taxed at the lower of its ordinary bracket or 25% (§1(h)(1)(E)); the remaining gain fills the 0/15/20% bands above that.
Assumes the property was held more than a year, straight-line depreciation on the building, and that the 3.8% NIIT applies (it may not if you qualify as a real estate professional). No §121 home-sale exclusion, passive-loss carryforwards, AMT or state depreciation differences are modelled. Have a CPA confirm before you sign anything.
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.
- IRC §1011: Adjusted basis is the starting point for gain or loss.
- IRC §1016(a)(2), Basis is reduced by depreciation “allowed or allowable”, claimed or not.
- IRC §1001(b): Gain = amount realized minus adjusted basis.
- Treas. Reg. §1.1001-2, Amount realized includes liabilities the seller is relieved of, debt does not reduce the gain.
- 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.
- IRC §1250: Recapture on depreciable real property (buildings).
- IRC §1245, Recapture on personal property (equipment, cost-segregation components), taxed as ordinary income.
- IRC §1411: 3.8% net investment income tax above $200,000 single / $250,000 joint MAGI (not indexed).
- IRC §453(i): In an installment sale, ordinary-income recapture (§1245 and any §1250 additional depreciation) is recognized in the year of sale.
- 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.
- 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.
- Treas. Reg. §1.1031(d)-2: Net debt relief in a like-kind exchange is treated as money received (mortgage boot).
- IRS Publication 544, Sales and Other Dispositions of Assets, recapture, installment sales, like-kind exchanges.
- IRS Publication 551, Basis of Assets, what increases and decreases basis (improvements, depreciation, casualty losses, insurance reimbursements).
- IRS Publication 946: 27.5-year residential and 39-year nonresidential recovery periods.
- 2026 brackets: Rev. Proc. 2025-32, which sets the 2026 ordinary brackets and the 0/15/20% capital gains breakpoints used here.
- California FTB rate schedules, R&TC §17041 and §17043: California taxes capital gain as ordinary income, 1% to 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.
