Tax & Policy
Tax-Loss Harvesting and the Wash-Sale Rule That Undoes It
Selling a losing position to offset a winning one is one of the few genuinely free moves in investing — you keep your exposure, and you reduce your tax bill. It is also one of the easiest to execute incorrectly, because a rule written in the 1920s to stop exactly this maneuver is still on the books, and the version of it people carry in their heads is usually missing the half that does the real damage.
What harvesting actually buys you
Tax-loss harvesting means selling an investment that is worth less than you paid for it, realizing the capital loss, and using that loss to reduce taxes owed on gains elsewhere. You then buy something similar so your portfolio still looks the way you intended.
It is worth being precise about what this achieves, because the usual framing oversells it. Harvesting is primarily deferral, not elimination. When you sell at a loss and buy a replacement, your new position has a lower cost basis than the old one. That lower basis means a larger gain when you eventually sell the replacement. You took a deduction now and created a bigger taxable gain later.
That is still valuable, for three reasons. Money saved on taxes today can be invested and compound for the intervening years. Your marginal rate later may be lower than it is now, particularly if you harvest during peak earning years and sell in retirement. And if the position is ultimately donated to charity or passes to heirs with a step-up in basis, the deferred gain may never be taxed at all.
But "free money" it is not. It is a timing arbitrage, and its value depends on the gap between your rate now and your rate later.
The order losses are applied in
Losses do not simply reduce whatever you want. The IRS applies them in a fixed sequence, and knowing the sequence tells you which losses are worth the most.
- Short-term losses offset short-term gains first. Short-term gains — from assets held one year or less — are taxed at ordinary income rates, which top out at 37% for 2026. These are the most expensive gains you can have, so losses that offset them are the most valuable.
- Long-term losses offset long-term gains next. Long-term gains are taxed at 0%, 15% or 20% depending on taxable income. For 2026, the 0% rate applies to taxable income up to $49,450 for single filers and $98,900 for married filing jointly; the 20% rate begins at $545,500 and $613,700 respectively.
- Leftover losses cross over. If short-term losses exceed short-term gains, the excess offsets long-term gains, and vice versa.
- Up to $3,000 offsets ordinary income. Whatever remains after all gains are wiped out can reduce ordinary income — wages, interest, self-employment earnings — by up to $3,000 per year ($1,500 if married filing separately). This figure is set in statute and is not adjusted for inflation.
- The rest carries forward indefinitely. Unused losses roll into future years, retaining their short-term or long-term character, until they are used up or you die.
One consequence worth noting: if you are in the 0% long-term capital gains bracket, harvesting long-term losses to offset long-term gains accomplishes nothing, because those gains were not going to be taxed anyway. In that situation, the opposite move — deliberately realizing gains at 0% to reset your basis higher — is usually the better play.
The wash-sale rule: a 61-day window, not 30
Here is where most people get it wrong. The wash-sale rule disallows your loss if you acquire a substantially identical security within 30 days before or 30 days after the sale. Counting the day of sale itself, that is a 61-day window, not a 30-day one.
The "before" half is the part that gets forgotten. Someone who buys more of a falling position on the 10th, decides it is hopeless and sells the whole lot at a loss on the 20th, has triggered a wash sale on the shares bought ten days earlier — even though they bought nothing afterward.
When a wash sale occurs, the loss is not destroyed. It is disallowed for the current year and added to the cost basis of the replacement shares. The holding period of the original shares also carries over. So in an ordinary taxable account, a wash sale is a deferral, not a permanent loss — annoying, but survivable.
The window runs thirty days in both directions. A purchase you made three weeks before you decided to sell can disqualify the loss you were counting on.
"Substantially identical" is deliberately undefined
The statute uses the phrase "substantially identical" and never defines it, and the IRS has declined to publish a bright-line test. What is reasonably settled:
- The same security is obviously identical. Selling shares of a company and rebuying that company within the window is a wash sale.
- The same fund is identical, including buying it at a different brokerage or in a different account you own.
- Stock and options on that stock can trigger the rule. Buying a call option on a position you just sold at a loss is treated as acquiring the security.
- Two different issuers' funds tracking the same index is the genuinely grey area. Two S&P 500 funds from different companies hold the same 500 stocks in the same weights. The IRS has never ruled that this is a wash sale, and many practitioners treat it as acceptable, but it has also never been blessed. The conservative approach, and the one most advisors use, is to move to a fund tracking a different index — from an S&P 500 fund to a total-market fund, for instance — which changes the actual holdings while keeping the exposure nearly the same.
The IRA trap, where the loss dies permanently
This is the version of the rule that causes real damage, and it is not widely known.
In Revenue Ruling 2008-5, the IRS held that buying a substantially identical security inside an IRA within the wash-sale window triggers the rule on a loss realized in a taxable account. That alone would be merely inconvenient. The destructive part is what happens next: because IRAs do not track cost basis in a way that produces a future deduction, the disallowed loss is not added to the IRA shares' basis in any usable way. It is simply gone. Forever.
The practical trap is mundane. Someone sells a broad index fund at a loss in their brokerage account on the 5th. On the 15th, their automatic 401(k) or IRA contribution buys the same fund, because it has been doing that every month for years and nobody thought about it. The taxable loss is permanently forfeited.
Two more traps in the same family
Your spouse's account counts. A purchase by your spouse, or by a corporation you control, is attributed to you. Married couples filing jointly cannot sidestep the rule by splitting the transaction across two accounts.
Automatic dividend reinvestment counts as a purchase. A fund that pays a quarterly dividend and reinvests it automatically has bought shares on your behalf. If that reinvestment lands inside the window, it triggers a partial wash sale on the number of shares purchased. The fix is to switch reinvestment off on any position you plan to harvest, ideally a month before.
When it is actually worth doing
Harvesting has real costs: transaction friction, tracking error while you hold a substitute, record-keeping, and the risk of doing it wrong. A few conditions make it clearly worthwhile.
You have realized gains to offset, especially short-term ones. You are in a high marginal bracket now and reasonably expect a lower one later. The loss is large enough to matter — harvesting a $200 loss to save $48 in tax is not worth the attention. And you have a clean replacement that keeps your allocation intact without creeping toward substantially identical.
It is much less compelling if you are in the 0% long-term bracket, if the position is small, or if the only available substitute is meaningfully different from what you wanted to own. And it is never a reason to sell something you otherwise wanted to keep. The tax tail should not wag the portfolio dog; harvesting is a way to make a decision you already made slightly cheaper, not a reason to make the decision.
Key takeaways
- Harvesting defers tax rather than eliminating it — the replacement position carries a lower basis and a larger future gain.
- Losses apply in a fixed order: short-term against short-term, long-term against long-term, then cross-over, then up to $3,000 against ordinary income, then carried forward indefinitely.
- The wash-sale window is 61 days: 30 before the sale, the day of, and 30 after. The "before" half is what most people miss.
- In a taxable account a wash sale defers the loss into the replacement's basis; a purchase inside an IRA destroys it permanently under Rev. Rul. 2008-5.
- Your spouse's purchases count, and automatic dividend reinvestment counts as a purchase — turn it off before harvesting.
- If your long-term gains are already taxed at 0%, harvesting long-term losses against them accomplishes nothing.