What to Know About Tax-Loss Harvesting and Your Student Loans

If you have a taxable investment account (aka brokerage account, aka general investing account) and federal student loans, tax-loss harvesting is a powerful and underutilized strategy that can help you reduce your tax bill, improve your after-tax returns, and keep your AGI lower, which directly reduces your income-driven repayment payment. Here's how it works and what to watch out for.

What is tax-loss harvesting?

Tax-loss harvesting is the practice of strategically selling investments that have declined in value to “realize” a loss, which can then be used to offset taxable gains or, if you have no gains, to reduce your ordinary income by up to $3,000 per year. Any losses beyond that carry forward to future tax years indefinitely.

The key word is realized. If your portfolio is down but you haven't sold anything, the IRS doesn't see a loss. You have to actually sell the investment to put that loss to work.

A quick example: You sell a stock at a $5,000 loss. You also sold another investment for a $4,000 gain earlier in the year. Your $5,000 loss offsets the $4,000 gain entirely which zeros out that tax bill, and the remaining $1,000 can offset ordinary income.

And remember, this is for taxable investment accounts, not tax deferred or preferred accounts like Roth IRAs, 401ks, HSAs, etc. 

Short-term vs. long-term: Why it matters

The IRS categorizes your gains and losses by how long you've held the investment:

  • Short-term (held one year or less): taxed at your ordinary income rate, which can be as high as 37% for high-income earners.
  • Long-term (held more than one year): taxed at preferential rates — 0%, 15%, or 20% depending on your income.

The matching rules matter though, which mean short-term losses first offset short-term gains, and long-term losses first offset long-term gains. Any leftover losses can “pass through” to offset the other type, and then finally to ordinary income (up to the $3,000 annual cap).

The wash-sale rule: An important constraint

Before you harvest a loss, you need to watch out for the wash-sale rule. The IRS prohibits you from claiming a tax loss if you buy a “substantially identical” investment within 30 days before or after the sale in any account, including your spouse's.

That last part trips up a lot of households. If you and your spouse hold similar funds across separate accounts and one of you sells for a loss while the other buys the same thing in a different account (any other account, even retirement accounts), the deduction is disallowed. This can be an issue especially with robo-advisor accounts that can't “see” each other's trades and may inadvertently trigger wash sales.

After harvesting a loss, you have two clean options: wait 30 days to repurchase the original investment, or immediately buy something similar but not identical (for example, replacing one S&P 500 ETF with a different broad-market ETF) so you stay invested vs wait around in cash.

IRS example: You buy 100 shares of X stock for $1,000. You sell these shares for $750, and within 30 days from the sale, you buy 100 shares of the same stock for $800. Because you bought substantially identical stock, you cannot deduct your loss of $250 on the sale

How tax-loss harvesting affects your student loans

Here's where it gets interesting for our federal loan borrowers out there.

If you're on an income-driven repayment (IDR) plan such as PAYE, IBR, ICR, or SAVE, your monthly payment is calculated based on your Adjusted Gross Income (AGI). Tax-loss harvesting can help in two ways: it can offset capital gains you'd otherwise have to report which keeps your AGI from rising, and if losses exceed gains, up to $3,000 can be deducted directly against ordinary income, which reduces your AGI. Both outcomes can help lower or avoid unexpected increases to your IDR payment.

The impact here grows with your income and loan balance. And if you're on a path to loan forgiveness, a lower AGI means lower payments and more loan forgiveness.

Is it worth it? What the research says

An MIT study analyzed 25 years of S&P 500 data (1990–2014) and found that tax-loss harvesting generated a tax alpha of approximately 0.85%–1.00% annually at a 35% tax rate, and up to ~1.10% at a 50% tax rate. The study did not account for wash sale constraints, meaning real-world results could be lower. The framework computes tax alpha by maintaining two portfolios: (1) a base buy-and-hold portfolio and (2) a tax-efficient loss-harvesting portfolio, with tax alpha defined as the difference in returns between the two.

The opportunities to harvest losses are largely out of your control. Volatile markets create more of them, calm markets fewer. That's why this isn't a one-time strategy. The value builds through consistent implementation and coordination over time.

A few factors that determine the size of impact with this strategy:

  • Account size matters. Tax-loss harvesting adds the most value on larger taxable balances. For a small account, the dollar benefit may be modest even if the percentage looks good.
  • Ongoing contributions help. When you're still adding money to the account regularly, there are more opportunities to harvest without disrupting your overall allocation.
  • Your tax bracket matters. The higher your marginal rate, the more valuable each harvested dollar becomes.

Tax-loss harvesting for married borrowers filing separately

Many married student loan borrowers file taxes separately (MFS) to keep IDR payments lower, especially when one spouse has a much higher income and/or only one spouse has the loans. Tax-loss harvesting works differently in that scenario:

  • If you file separately, the ordinary income deduction cap drops from $3,000 to $1,500 per spouse.
  • If you have a joint brokerage account and file separately, the investment gains and losses are split between you, and each spouse can claim up to their $1,500 share.
  • The wash-sale rule still applies across all accounts you own, and because spouses filing separately often hold separate accounts, coordination is essential to avoid inadvertently invalidating each other's losses.

Before making any decisions on your tax filing status, it's worth running the numbers both ways,  filing jointly versus separately, to see which produces a better combined outcome when you factor in loan payments, forgiveness projections, tax deductions, and any other factors.

Three steps to harvest a loss

  1. Identify candidates. Look at taxable account positions that have declined in value past a certain threshold you think is reasonable. Remember: this only applies to taxable accounts, not IRAs, 401(k)s, or HSAs.
  2. Sell to realize the loss. Execute the sale. Your broker will typically issue a form showing whether the loss is short-term or long-term, which you'll need for Schedule D when you file.
  3. Reinvest thoughtfully. You can leave the proceeds in cash, or not. If not, you can buy a similar (but not substantially identical) investment immediately so you stay invested. Watch the 30-day window before rebuying the original.

What tax-loss harvesting can't do

A few important boundaries:

  • It doesn't apply to tax-advantaged accounts (401(k), IRA, HSA). Losses inside those accounts aren't recognized by the IRS.
  • It's not a way to avoid taxes permanently, though in some cases (like assets held until death and passed to heirs) the deferred gains may never be realized at all. More commonly, it defers and optimizes taxes while adjusting your cost basis over time.
  • You can't use it to arbitrarily zero out your taxable income. The $3,000 cap ($1,500 if MFS) exists precisely to prevent that. Excess losses carry forward.

The bigger picture: TLH as part of a coordinated strategy

Tax-loss harvesting doesn't operate in isolation and it’s not THE strategy that will change your life and make you rich. It's added power comes from being part of a coordinated approach that includes:

  • Asset location — placing the right investments in the right account types (taxable vs. tax-deferred vs. tax-free) to minimize drag. 
  • Capital gains budgeting — especially useful when you're gradually diversifying away from a concentrated position. Rather than selling everything at once and taking a large tax hit, a planned annual gains budget spreads the cost over several years while harvested losses help offset gains along the way.
  • IDR optimization — coordinating investment decisions with your loan recertification timeline.
  • Wash-sale coordination — especially for couples with multiple accounts at different custodians, where trades in one account can unknowingly disallow losses in another.

The bottom line

Tax-loss harvesting is a legitimate and well-researched strategy for managing and/or reducing your tax burden, and for federal student loan borrowers, the benefit can be even more impactful. But it requires careful execution, particularly around the wash-sale rule, coordination across spouses' accounts, and matching the strategy to your income, loan type, and broader financial plan.

If you're not sure whether it makes sense for your situation, we're happy to walk through it. The answer is almost always “it depends” and getting the details right is where the value comes from.

SLP Wealth, LLC is an SEC-registered investment adviser. This article is for educational purposes and does not constitute personalized tax, legal, or investment advice. Consult a qualified professional before acting on any strategy described here. Past performance is no guarantee of future results. The MIT study's results are hypothetical, based on backtested data, and do not reflect the actual trading or performance of any specific client account.

Hermes Conesa, MBA, CSLP®, contributed to the original version of this article.