Tax-loss harvesting has a tripwire. Under the wash sale rule (Internal Revenue Code §1091), if you sell a security at a loss and buy a substantially identical security within 30 days before or after the sale — a 61-day window centered on your sale — the loss is disallowed on that return.

"Disallowed" usually means deferred, not destroyed: the loss is added to the basis of the replacement shares. But one common move makes it permanent — replacing the shares inside an IRA. This guide walks the mechanics, the substantially-identical question for funds, and how to harvest losses without tripping the rule. It is the compliance companion to Tax-Loss Harvesting, Explained.

The 61-day window and the basis adjustment

The window runs from 30 days before the sale to 30 days after. Any purchase of substantially identical stock or securities in that window — by you, in any of your accounts, including automatic dividend reinvestments — can wash the loss, share for share: if you sell 100 shares at a loss and repurchase 60 in the window, 60 shares' worth of loss is disallowed.

For a taxable-account replacement, the disallowed loss is added to the basis of the replacement shares, and the holding period of the old shares tacks on. Economically you get the loss later — when you sell the replacement — rather than now. Brokers report wash sales on Form 1099-B for the same account and same security; cross-account and cross-broker washes are your responsibility to track, and the IRS's records do not absolve you because a form missed it.

The IRA trap: the loss that never comes back

If the replacement purchase happens in your traditional or Roth IRA, the IRS ruled (Revenue Ruling 2008-5) that the wash sale rule still applies — but the basis adjustment has nowhere to go, because IRA basis does not work that way. The loss is permanently disallowed. The same logic reaches a spouse's accounts: purchases by your spouse in the window can wash your sale.

The operational rule for harvesters: before selling at a loss in a taxable account, check every account you and your spouse control — 401(k) purchases count too in the IRS's view of "replacement" risk areas that advisors treat cautiously — for recent or scheduled buys of the same security, and pause automatic reinvestments in the affected funds for the window.

What counts as substantially identical

For individual stocks, the answer is easy: the same company's shares (and options on them) are substantially identical. For funds, the IRS has never published a bright-line test, and practice has settled into risk tiers:

  • Same fund, different share class (investor vs. institutional shares of one portfolio): treated as substantially identical — do not use as a swap.
  • Two funds tracking the same index from different sponsors: the gray zone. Many practitioners avoid it; the conservative harvest uses a different index.
  • Funds tracking different indexes (an S&P 500 fund swapped for a total-market or large-cap index fund): the standard harvest pattern — economically similar exposure, different underlying index.

Document what you swapped into and why; the file matters more than false precision, because the term is defined by facts and circumstances, not a list.

Harvesting without the headache

  1. Turn off dividend reinvestment for the position before you sell (a DRIP buy three weeks later is the most common accidental wash).
  2. Sell, and immediately buy the replacement exposure tracking a different index — staying invested is the point of the harvest (see Capital Gains Management for how the harvested loss is then used).
  3. Calendar day 31: after the window closes you may swap back to the original fund if you prefer it.
  4. Keep IRA and 401(k) contributions from buying the sold security during the window — change the target allocation temporarily if needed.

Options, crypto, and other edges

Buying a call option or a contract to acquire the same stock in the window also triggers the rule. Cryptocurrency, by contrast, is property rather than a "security" under current IRS treatment, and the wash sale rule has not applied to it — a status Congress has repeatedly proposed changing, so treat the crypto exception as current-law, not permanent, and verify before relying on it in a given year. Real estate is outside the rule entirely.

Official documentation and references

Keep going

Educational disclaimer: This article is general education, not personalized financial, tax, legal, or benefits advice. Primary sources, plan documents, and — for insurance and estate topics — your state's law and licensed professionals govern your situation. All numbers in examples are illustrative.