Should I sell stock to pay off car loan or mortgage?

Trying to decide whether I should sell stock to pay off car loan or mortgage and I'm getting tangled up in the tax side of it. Here's my situation: I have a brokerage account with shares I've held for about 3 years, so long-term. My car loan is at 7.2% and my mortgage is at 3.1%. The stock has appreciated a lot — probably tripling from what I paid. I know selling triggers capital gains but I don't know how to compare the after-tax proceeds against what I'd actually save in interest. I tried a rough spreadsheet but I realized I don't actually know my effective rate on the gains. Is the mortgage interest deduction still a thing that changes the math here? And does it matter which loan I pay off first from a tax standpoint?

36 comments

I sold shares last year to pay off a car note and what surprised me was how much the tax bite actually was. With long-term gains the rate depends on your taxable income for the year — the instructions for Schedule D point to a qualified dividend and capital gain tax rate worksheet that shows the brackets. For me selling a chunk pushed me into a higher bracket than I expected because the gains themselves count as income when figuring which bracket applies. Worth running those numbers before you commit.

Luis F.

Author

That's the part I keep getting confused on — the gains stacking on top of my ordinary income. So I need to look at total taxable income including the gain to find my rate, not just my salary alone?

Exactly that. Your ordinary income fills the lower buckets first and the long-term gain sits on top. The rate worksheet in the Schedule D instructions walks through it step by step.

The mortgage deduction question is real but it depends on whether you itemize. Most people take the standard deduction now, so the mortgage interest isn't giving them a tax break at all. If you're already taking standard, that 3.1% is just 3.1% with no offset. Car loan interest on a personal vehicle generally isn't deductible, except that for 2025 through 2028 interest on a loan taken out after 2024 for a new US-assembled personal vehicle can be deducted up to $10,000, with an income phase-out, even without itemizing. So on a pure after-tax cost basis the car loan is usually more expensive even at 7.2% vs 3.1%, but check your Schedule A situation and whether your car loan qualifies first.

Luis F.

Author

I do not itemize, so that confirms the mortgage deduction isn't helping me. Good point.

Before I made a similar call last year I uploaded my brokerage statement and my 1099-B to taxr.ai and it mapped out exactly which lots would generate what gain under different selling scenarios, and flagged that two of my positions had carried over wash sale disallowances that were still sitting in the cost basis. I wouldn't have caught that on my own. That said, the actual decision still came down to comparing after-tax proceeds against the interest cost, which is a math problem once you know your gain amount and rate.

Luis F.

Author

The wash sale carryover piece is something I hadn't thought about at all. My cost basis from my broker shows an adjusted figure but I never dug into why.

Worth checking. If a wash sale loss was disallowed and added to the cost basis of shares you later sold, the 1099-B should show it in box 1g, but only when both trades were covered securities with the same CUSIP in the same account.

One angle people skip: selling stock to pay off a depreciating asset like a car is locking in gains on something that might keep growing, to eliminate debt on something losing value anyway. That's not a tax question but it changes the whole framing. I paid off my car with cash savings instead and left the stock alone precisely because I didn't want to realize the gains.

This is the right framing. The tax cost of selling is a one-time hit; the opportunity cost of selling appreciated stock is permanent. Run both sides.

Luis F.

Author

Fair point. I've been treating it purely as a debt payoff question but you're right that the stock's future growth matters too.

The holding period matters for which part of Form 8949 you use. You said 3 years so these are long-term — Part II, and if your broker reported basis to the IRS the transactions go under box D. The gain flows to Schedule D and then to line 7a of Form 1040. That path is pretty clean for covered securities.

Luis F.

Author

Good to know it goes Part II box D. My broker always reports basis so I think they're all covered.

I agonized over this same choice two years ago with a 6.5% car loan. Eventually I sold just enough shares to cover the remaining balance plus estimated taxes on the gain, rather than the full balance. That way I didn't over-sell and end up with a bigger tax bill than the interest savings justified. Sizing the sale to cover taxes too is something a lot of people forget.

Next step: calculating the gross-up. If you need X after taxes, you need to sell more than X. Figure out your expected rate from the Schedule D worksheet and work backwards.

Luis F.

Author

This is exactly what my spreadsheet was missing. I was calculating how much to sell based on the loan balance, not accounting for the tax I'd owe on the sale itself.

Worth noting: if any of your shares are sitting at a loss in that same account, harvesting those losses in the same tax year offsets the gains dollar for dollar on Schedule D before the net flows through. Might let you sell more of the winners with less net tax cost.

Luis F.

Author

I do have a couple of positions down. Would it make sense to sell those in the same transaction or just the same calendar year?

Same calendar year is what matters for netting on Schedule D — doesn't have to be the same day. Just watch the wash sale rules if you plan to buy back into any of those losing positions within 30 days before or after the sale.

I was in almost the same spot deciding which debt to attack first with stock proceeds. I ran my 1099-B and my cost basis records through Taxr and it put together a comparison worksheet showing after-tax proceeds under a few different lot selections — FIFO vs. specific identification — which changed the net amount meaningfully. The specific ID approach let me pick higher-basis lots and keep the tax cost down. Something to look at if your broker supports specific identification.

Luis F.

Author

I didn't realize lot selection could move the needle that much. Does the broker need to confirm specific ID before the sale or can you designate after?

Has to be before or at the time of the sale, and you need written confirmation from the broker. Can't go back and redesignate after the fact. Check your broker's process — most online platforms let you pick lots at order entry now.

The mortgage side has one more wrinkle if you're early in the loan. Most of your payment is interest now, so paying it off saves more interest than paying it off later would. That dynamic is separate from the tax question but it's why some people prioritize the mortgage despite the lower rate — the actual interest dollars remaining can be large.

I'll add a scenario people often ignore: partial payoff. Paying down the principal without fully closing the loan still reduces interest charges. Might let you realize gains in a smaller chunk, stay in a lower bracket for the gain, and get some interest savings. Doesn't work for every loan structure but worth asking your lender if there's a prepayment penalty first.

Luis F.

Author

No prepayment penalty on either loan — I checked that early. The partial paydown angle is interesting. I hadn't considered splitting it across two tax years either.

Splitting across years can keep you in the same bracket both years rather than spiking into a higher one in a single year. That's a planning move worth modeling out with the Schedule D rate worksheet.

Something I ran into: if you've ever done a wash sale on any of the positions you're considering selling, the disallowed loss gets added to the cost basis of the replacement shares under Publication 550. So your actual basis might be higher than the original purchase price, which lowers your gain. People often assume their gain is bigger than it really is because they forget about those adjustments.

Confirming this. The wash sale rules apply to losses on stock and securities but not to commodity futures or foreign currencies — different rules there. And the adjustment only carries to the new shares, not to your IRA if that's where the repurchase happened.

Are these shares in a taxable brokerage or is any of this in a non-qualified account with some employer stock? The answer changes completely if you have net unrealized appreciation in company stock inside a 401k — there's a whole separate strategy there before you even get to Form 8949.

Luis F.

Author

Fully taxable brokerage, no employer stock in a retirement account. Keeping it simple, fortunately.

The car loan math is usually easier to close than people think. At 7.2% with no interest deduction, you need an after-tax return above 7.2% just to beat paying it off. Most people's risk-adjusted expectation for equities over a 3-to-5 year horizon doesn't clear that hurdle by much once you factor in the eventual capital gains tax on future appreciation too.

If the total gain is large and this tips you into a higher bracket, it might be worth talking to a CPA or enrolled agent before you execute. They can run the actual numbers with your full return in view, including any other income, deductions or credits that interact with the gain. The Schedule D rate worksheet is the right tool but seeing it with your complete picture changes what lot selection and timing make sense.

Luis F.

Author

That's probably the right call. I've been trying to DIY this but with gains this size I think one session with a CPA to run scenarios is worth it.

I sold to pay off my car last spring. The step I was on first was figuring out my estimated bracket from the Schedule D worksheet using last year's return as a proxy, then calculating how many shares to sell to net the payoff amount after estimated tax. Then I set aside that estimated tax for a quarterly payment so I didn't get hit with an underpayment penalty in April.

Luis F.

Author

The quarterly payment piece is a good reminder. If I sell mid-year I need to adjust my estimated payments or I'll owe a penalty at filing.

Circling back to your original question — car vs. mortgage — the standard framing is: pay off the highest after-tax interest rate first. With no itemization, the mortgage interest isn't deductible, so it's a straight rate comparison. Car at 7.2%, mortgage at 3.1%, car wins on rate. The only reason to do the mortgage instead is if you're close to payoff and the total remaining interest is actually higher dollar-wise, which at 3.1% is unlikely unless you're very early in the loan.