Can Mortgage Payoff Be Deducted From Capital Gains?

No, a mortgage payoff cannot be deducted from capital gains when you sell your home. Paying off the remaining loan balance at closing is a debt repayment to your lender, not a cost of buying or selling the property, and the IRS leaves it out of the gain calculation entirely. Your taxable profit depends on what you originally paid for the home, what you spent improving it, and what it cost to sell. It does not depend on how much you still owed the bank.

This catches sellers off guard because the mortgage payoff shows up on the closing statement right next to the commissions and transfer taxes, and the check you walk away with reflects the payoff directly. The cash in your pocket and the gain the IRS taxes are two different numbers.

How the Gain Is Actually Calculated

The formula is short. Take the sale price, subtract your selling expenses, and subtract your adjusted basis. What remains is your capital gain or loss, reported on Form 8949 and summarized on Schedule D.1Internal Revenue Service. Publication 523 (2025), Selling Your Home

Your adjusted basis is your total investment in the property. It starts with what you paid for the home and includes purchase closing costs that weren’t deducted elsewhere, such as title insurance, legal fees, transfer taxes, survey fees, and recording charges.2Internal Revenue Service. Publication 551, Basis of Assets Capital improvements made during ownership push the basis higher.

Selling expenses come off the sale price to give you your amount realized. These are the costs directly tied to getting the deal closed: real estate commissions, legal fees, title and escrow charges, transfer taxes paid by the seller, advertising and staging costs, and any loan points the seller agreed to pay on the buyer’s behalf.1Internal Revenue Service. Publication 523 (2025), Selling Your Home

Holding period controls the rate. One year or less and the gain is short-term, taxed as ordinary income. More than a year and it qualifies for the long-term rates of 0%, 15%, or 20%, depending on your taxable income.3Internal Revenue Service. Topic No. 409, Capital Gains and Losses

Why the Mortgage Balance Is Left Out

The IRS taxes the profit on the asset. How you financed the purchase, and how much of that financing was still outstanding when you sold, are separate questions about debt. Paying off a loan returns borrowed money to the lender. It is not a cost of acquiring the home and not a cost of selling it, so it has no slot in the formula.

A simple comparison makes it concrete. Two neighbors each buy identical houses for $300,000. One pays cash. The other puts 5% down and takes out a $285,000 mortgage. Both have the same basis of $300,000 before any improvements. Ten years later, both sell for $500,000. Both have the same capital gain. One walks away with far more cash because they owe nothing to a bank, but the IRS sees identical profit on identical assets.

Here is a worked example on a single sale. You bought your home for $350,000. Over the years you spent $40,000 on capital improvements, bringing your adjusted basis to $390,000. You sell for $550,000 and pay $35,000 in selling expenses. Your gain is $550,000 minus $35,000 minus $390,000, or $125,000. That figure stays at $125,000 whether your remaining mortgage was $250,000, $50,000, or zero. The payoff amount only changes the size of the check from the title company.

Mortgage-Related Costs That Do Affect Your Taxes

The principal balance is irrelevant to capital gains, but several mortgage-related items do touch your tax return. They just belong on different lines, and in most cases they reduce ordinary income rather than the gain itself.

Mortgage Interest

Monthly interest paid during ownership is an itemized deduction on Schedule A for the years you paid it.4Internal Revenue Service. Publication 936 (2025), Home Mortgage Interest Deduction None of the interest you have paid over the life of the loan increases your basis, reduces your sale price, or lowers your capital gain. It never enters the Schedule D math.

Points

Points the buyer paid at purchase are treated as prepaid interest. You can usually deduct them in the year of purchase if certain conditions are met, or spread the deduction over the life of the loan. Any remaining undeducted balance can be deducted in the year you sell.1Internal Revenue Service. Publication 523 (2025), Selling Your Home Again, this is an ordinary income deduction, not a reduction of capital gain.

Points the seller pays to help the buyer get financing are different. Those are treated as a selling expense for the seller and reduce the amount realized.5Internal Revenue Service. Topic No. 504, Home Mortgage Points The buyer, in turn, must reduce their basis by the amount of seller-paid points.6Internal Revenue Service. Publication 936 (2025), Home Mortgage Interest Deduction – Section: Points Paid by the Seller

Prepayment Penalties

Some mortgages charge a penalty for early payoff. The IRS treats that penalty as deductible home mortgage interest, claimed on Schedule A in the year you pay it.4Internal Revenue Service. Publication 936 (2025), Home Mortgage Interest Deduction It is not a selling expense and does not reduce your capital gain.

What Actually Lowers Your Gain

If the mortgage payoff is off the table, the two levers that genuinely shrink a taxable gain are your adjusted basis and your selling expenses. Both reward good recordkeeping.

On the basis side, capital improvements are projects that add value, extend the home’s useful life, or adapt it to a new use. Replacing a roof, adding a bathroom, finishing a basement, installing central air conditioning, and paving a driveway all qualify.2Internal Revenue Service. Publication 551, Basis of Assets Routine maintenance and cosmetic repairs do not. Patching drywall, repainting rooms, and fixing a leaky faucet keep the property running but do not raise your basis. The test is whether the work fundamentally improves the home or merely maintains it.

Some events reduce basis instead of raising it. Depreciation you claimed, or could have claimed, on a rental or home office portion comes off. Insurance reimbursements for casualty losses and any casualty loss deductions you took also come off.7Internal Revenue Service. Publication 547 (2025), Casualties, Disasters, and Thefts A residential energy credit, such as one claimed for solar panels, reduces the basis increase you would otherwise get from that project.8Internal Revenue Service. Instructions for Form 5695

Keep receipts for every improvement. A forgotten $15,000 kitchen remodel from a decade ago is $15,000 of gain you will otherwise pay tax on for no reason.

On the selling-expense side, pull the closing disclosure and work through each seller-paid line. Commissions are usually the largest. Attorney fees for the contract or title work, title insurance and escrow charges, state or local transfer taxes, professional photography and staging, and seller-paid buyer points all come off the sale price.1Internal Revenue Service. Publication 523 (2025), Selling Your Home

Why Most Sellers Owe Nothing Anyway

For a primary residence, the Section 121 exclusion is usually the whole ball game. If you owned and lived in the home as your main residence for at least two of the five years before the sale, you can exclude up to $250,000 of gain as a single filer or $500,000 as a married couple filing jointly.9Office of the Law Revision Counsel. 26 USC 121 – Exclusion of Gain From Sale of Principal Residence The two years do not need to be consecutive; they need to total 24 months within that five-year window. Neither spouse can have used the exclusion on another home sale within the past two years.

The exclusion applies after you calculate the gain. So the mortgage payoff still has nothing to do with it, but for most ordinary home sales the gain comes in under the ceiling and the tax bill is zero. Where the exclusion runs out, every dollar of legitimate basis and every dollar of legitimate selling expense you can document is a dollar of taxable gain you avoid.

Higher-income sellers should also watch for the 3.8% net investment income tax, which can apply when modified adjusted gross income exceeds $200,000 for single filers or $250,000 for married couples filing jointly.10Office of the Law Revision Counsel. 26 U.S. Code 1411 – Imposition of Tax Any gain excluded under Section 121 is not counted as net investment income for this surtax.11Internal Revenue Service. Instructions for Form 8960 (2025) So if the Section 121 exclusion wipes out your full gain, the 3.8% does not come into play either.