TaxesIntermediate5 min read

The wash sale rule: how to harvest losses without voiding them

Sell at a loss, buy back too soon, and the IRS erases your deduction. The 61-day rule every investor eventually meets.

Selling losers to offset gains — tax-loss harvesting — is one of the few free lunches in a taxable account. The wash sale rule is the string attached: sell a security at a loss and buy it (or something 'substantially identical') back within 30 days on either side of the sale, and the loss is disallowed for now. The rule doesn't fine you; it just cancels the deduction you were harvesting.

The mechanics: a 61-day window

The window is 30 days before the sale, the sale date, and 30 days after — 61 days total. Buy substantially identical shares anywhere in that window and the loss is disallowed. It's not gone forever: the disallowed loss gets added to the cost basis of the replacement shares, so you recover it whenever you eventually sell those. The real damage is deferral — plus bookkeeping — not destruction. Unless the repurchase happens inside an IRA, where the loss is destroyed permanently.

  • The 30 days BEFORE the sale counts — buying more, then selling the old lot at a loss a week later, is a wash sale.
  • It applies across ALL your accounts: your taxable account, your IRA, your spouse's accounts. Selling in taxable while your IRA auto-invests in the same fund is a classic accidental wash.
  • Automatic dividend reinvestment is the most common trigger of all — a $40 reinvested dividend can wash part of a deliberate harvest.
  • It applies per lot: partial repurchases wash a proportional part of the loss.
  • It only applies to losses. Selling at a gain and rebuying instantly is fine (that's tax-gain harvesting).
A harvest, washed
In March, Lena buys 100 shares of an S&P 500 ETF at $500 ($50,000). By October it trades at $420 and she sells, harvesting an $8,000 loss — worth about $1,760 against gains at a 22% rate, or $660/year against ordinary income via the $3,000 annual allowance. Two weeks later the market dips further and she buys the same ETF back. Wash sale: the $8,000 deduction is disallowed this year and folded into her new basis ($42,000 paid + $8,000 = $50,000 basis). Had she bought a different large-cap index fund instead — tracking a different index — she'd have kept identical market exposure AND the $8,000 deduction.

'Substantially identical' — the gray zone

The IRS has never precisely defined it. Clearly identical: the same stock, the same fund, options on the stock you sold. Clearly different: stocks of two different companies, or a total-market fund vs. a sector fund. The practical gray zone is index funds: two S&P 500 funds from different companies track the same index, and many professionals treat swapping between them as risky. The standard playbook is to swap between similar-but-not-identical indexes — S&P 500 to a total-market or large-cap index fund — which keeps your allocation intact while being defensibly different.

The IRA repurchase is the fatal version
Repurchase in a taxable account and your loss is merely deferred into the new basis. Repurchase inside an IRA (or Roth IRA) and the IRS says the loss is disallowed AND cannot be added to the IRA's basis — it simply evaporates. If you harvest a loss, pause any IRA auto-purchases of that same fund for the 61-day window.

How to harvest cleanly

  1. Before selling, check for purchases of the same security in the last 30 days — including reinvested dividends — in every account you and your spouse own.
  2. Turn off dividend reinvestment in taxable accounts (take dividends as cash and invest them manually) to kill the most common accidental wash.
  3. Pick your replacement in advance: a similar-but-different fund (different index) so you're never out of the market.
  4. Either hold the replacement permanently, or wait 31+ days before switching back to the original.
  5. Check your 1099-B in January — brokers flag wash sales within one account, but only YOU can catch cross-account and spousal washes.
Don't let the tail wag the dog
A wash sale in a taxable account is a deferred deduction, not a disaster. If avoiding one means sitting out of the market for a month during a rebound, the missed gains can dwarf the tax savings. Harvest with a same-day swap into a comparable fund and you never face that trade-off.

What a clean harvest is worth

61 days
The wash window
30 before + sale day + 30 after
$3,000
Annual loss allowance vs. ordinary income
Excess carries forward forever
~$1,000
Tax saved harvesting a $3,000 loss
At a 32% combined marginal rate

Swap pairs that keep you invested

The practical heart of clean harvesting is having your replacement picked before you sell. The goal is a fund with near-identical behavior that tracks a DIFFERENT index: S&P 500 fund to a total-US-market fund (the two correlate at roughly 0.99), one total-international fund to another built on a different index, a Treasury fund to a similar-duration aggregate bond fund. What you should avoid is swapping a fund for another fund tracking the SAME index from a different provider — cheap identical exposure, but the least defensible position if 'substantially identical' is ever tested. And skip options-based cleverness entirely: buying calls on a stock you just sold at a loss is explicitly a wash sale under the rule's own text.

Worth internalizing once: the rule's cross-account reach includes retirement accounts you fund automatically. The classic self-inflicted wash is selling an index fund at a loss in taxable on the 10th while a 401(k) contribution buys the same fund on the 15th. Payroll contributions to a target-date fund are generally safe (a target-date fund isn't substantially identical to its components), which is one more quiet argument for target-date funds in workplace plans.

The bottom line

The wash sale rule says you can't claim a loss on something you never really stopped owning. Respect the 61-day window, remember it spans every account in the household, turn off automatic reinvestment in taxable accounts, and harvest into a similar-but-different fund the same day. Do that and tax-loss harvesting stays what it should be: a paperwork trick that turns market dips into real tax savings.

Check your understanding

1 of 3
How long is the wash sale window?

Not quite — try again.

The Worth letter

Get smarter about money every week

One email, no spam — practical guides and Worth updates. Unsubscribe anytime.

Put this into practice

Worth tracks your accounts, budgets, and goals — so the concepts in this article aren't just theory.

Start free trial