Should I sell stocks to pay off my 2.75% student loan early?

Trying to decide whether I should sell stocks to pay off my 2.75% student loan early. I have about 18 months left on the loan. My portfolio is a mix of index funds, some held over a year, some I bought last spring. The ones with the biggest gains are the long-term ones. I ran some rough numbers and the interest savings feel small compared to what I might owe on capital gains, but I'm not 100% sure I'm thinking about it right. I already checked that none of these shares have a wash sale issue since I'm not planning to rebuy. Is the tax hit on selling long-term appreciated shares likely to wipe out whatever I'd save on 2.75% interest? Or am I missing something about how to compare these two numbers?

35 comments

What's your rough tax bracket? That's the first thing that changes this answer. Long-term capital gains rates depend on your taxable income, and the IRS instructions for Schedule D walk through which rate applies to your situation. The gap between your gains rate and 2.75% interest is basically the whole question.

Darius B.

Author

I think I'm in the middle bracket generally but I'd have to check exactly where I land after adding the gains in. That's part of what I'm unsure how to calculate.

Had a similar crossroads last year with a low-rate loan versus a taxable brokerage account. I uploaded my 1099-B and my draft return to taxr.ai and it mapped out which lots were short-term versus long-term, what the estimated gain would be on each, and roughly what that added to my Schedule D. Made it a lot easier to see the actual after-tax cost of selling. Worth doing before you commit either way.

Darius B.

Author

That's exactly the kind of breakdown I need. I keep doing it in my head and second-guessing myself.

The lot-by-lot view is what really helped me. Once I could see which shares had the smallest gain relative to their value, the decision got clearer.

Are the short-term lots showing a gain or a loss? If some of the ones you bought last spring are actually down, selling those first could offset other gains and change the math entirely before you even touch the long-term winners.

Darius B.

Author

Some of the spring ones are slightly down actually. I hadn't thought about harvesting those first to offset the long-term gains. That's a good point.

Loss harvesting step: identify the lots with unrealized losses, sell those first, let the losses on Form 8949 offset your gains on Schedule D before you decide whether to sell the appreciated ones at all.

2.75% is really low. Even after tax, a broad index fund has historically returned more than that over most multi-year periods. I'm not saying never pay it off, but the math usually favors keeping invested at that rate. The tax cost of selling just makes the case for staying in stronger.

Agreed on the rate being low. Though past returns don't guarantee anything going forward, which is why I think the tax calculation still matters — you're locking in a certain cost (the gains tax) to avoid an uncertain benefit (maybe beating 2.75% in the market).

How are your shares held — in a taxable brokerage, an IRA, a 401(k)? That changes everything. Selling inside a retirement account has no immediate capital gains event. If any of your index funds are inside a Roth or traditional IRA you could rebalance there without triggering Form 8949 at all.

Darius B.

Author

The ones I'm thinking of selling are all in a taxable brokerage. My retirement accounts are separate and I wasn't planning to touch those.

Taxable brokerage confirmed: then every sale is a reportable event. Long-term lots go in Part II of Form 8949, short-term in Part I. The holding period starts the day after you bought and ends on the trade date you sell, not the settlement date.

Does your loan have a prepayment penalty? Some federal loans don't but some private ones do. Worth checking your loan terms before you do anything — a prepayment fee could change the savings number you're comparing against.

Something worth checking: is your student loan interest deductible on your return? If you're eligible to deduct it, the effective rate of the loan is lower than 2.75%, which makes paying it off even less attractive compared to staying invested. The deduction phases out at certain income levels though, so look at your Schedule 1 to see what you actually claimed last year.

Darius B.

Author

I do take the deduction when I qualify for it. I hadn't factored that into the effective rate. So 2.75% after the deduction is even lower. That shifts things.

Went through this with a mix of RSUs and index fund shares last tax year. I gave Taxr my 1099-B and the cost basis statements from my broker and it flagged which lots had the highest gain-to-proceeds ratio and listed them in order from least to most tax-efficient to sell. Saved me a lot of spreadsheet work. My conclusion after seeing the numbers: selling the least-appreciated lots to cover a small remaining balance can make sense, but liquidating big long-term winners to retire a 2.75% loan almost never pencils out after tax.

Darius B.

Author

The rank-order view by gain-to-proceeds is what I need. I've been thinking of it as all-or-nothing but I might only need to sell a portion to feel comfortable.

Partial sale step: figure out what payoff amount you actually need, then work backward from the least-appreciated lots to cover just that amount. You might only trigger a small gain.

What does your emergency fund look like? If paying off the loan — or selling to do it — would leave you cash-thin, that's a risk that doesn't show up in the tax math at all. Sometimes keeping the loan and keeping the shares liquid is the right call just for that reason.

Darius B.

Author

Emergency fund is solid, so that's not the concern here. It's really just the pure math of tax cost vs. interest savings.

To be precise on the holding period question you raised: for securities traded on an established market, your holding period starts the day after the trade date you bought, and ends on the trade date you sold — not the settlement date. So if you bought something April 15 of last year, the one-year mark for long-term treatment is April 16 this year.

Darius B.

Author

Good to know exactly. I was counting from settlement date in my head, which would have been a few days off.

A few days matters when you're right on the line. Check the actual trade dates in your brokerage account, not the confirmation emails, which sometimes show settlement.

Are you planning to reinvest the money you're no longer sending to the loan each month once it's paid off? Because if yes, you'd just be buying back into the market at current prices after selling at current prices, minus the tax. That's essentially a tax cost with no change in market exposure, plus 18 months of interest savings at 2.75%.

One angle I don't see mentioned: if you have capital loss carryforwards from prior years, those would offset the gains from selling. Worth checking your prior-year Schedule D or the carryover worksheet. Losses carried forward apply dollar-for-dollar against this year's gains before you owe anything.

Darius B.

Author

I don't have any carryforwards — last year was a good year. But that's a great thing to check in general before this kind of decision.

Is there any chance these shares are inside an employee stock purchase plan or came from RSU vesting? The cost basis reporting on those can be messier than a plain index fund purchase. If the basis on your 1099-B is wrong or missing you need to correct it on Form 8949 with a code B in column (f), not just accept whatever the broker reported: if basis was reported to the IRS (box A or D), keep the 1099-B basis in column (e) and fix it with an adjustment in column (g); if it wasn't (box B or E), put the right basis in column (e).

Darius B.

Author

These are plain index fund purchases, no RSUs or ESPP involved. So the cost basis should be straightforward from the broker.

To bring it back to your original question: the simplest version of the math is — after-tax return you expect to earn on the shares minus the after-tax cost of the loan. At 2.75% the loan cost is very low. The capital gains tax on selling appreciated long-term shares is a certain, immediate cost. Paying off 18 months of a 2.75% loan by selling winners rarely comes out ahead.

This is the right framing. The loss harvesting angle and the deductibility angle can tilt the numbers, but the base case math almost always favors staying invested at that rate.

Worth noting: once you sell and pay off the loan, those gains are done and taxed. If the market keeps rising, you've also given up the compounding on whatever you sold. The 18-month timeline is short enough that this is real money, not hypothetical.

18 months of compounding on a meaningful position at current market conditions is not nothing. That's the hidden cost the tax calculation doesn't fully capture.

Where did you land overall? Curious whether the loss harvesting idea changed your plan at all.

Darius B.

Author

After all this I'm leaning toward selling only the spring lots that are slightly down — harvesting those losses — and leaving the long-term winners alone. The 2.75% loan will be gone in 18 months regardless and the tax cost of selling appreciated shares just doesn't justify the small interest savings. I'll double-check my holding periods on the trade dates before I do anything.