What Is the Wash Sale Rule for Investors?

Updated July 9, 2026 6 min read

Selling an investment at a loss and quickly buying it back can seem like a clever way to lock in a tax break while keeping the same position, but there’s a rule specifically designed to stop that.

The short answer

The wash sale rule disallows a tax deduction for a capital loss if the investor buys a substantially identical investment within 30 days before or after the sale that created the loss. The disallowed loss doesn’t disappear entirely — it typically gets added to the cost basis of the replacement investment, deferring the tax benefit rather than eliminating it. The rule applies across an investor’s accounts, not just within the one where the sale happened.

The 61-day window

The rule covers a 61-day span: 30 days before the sale, the day of the sale itself, and 30 days after. Buying the same or a substantially identical security anywhere in that window triggers the disallowance, even if the repurchase happens in a completely different account, including certain retirement accounts. This trips people up when they’re trying to combine tax-loss harvesting with automated features like dividend reinvestment, since a reinvested dividend that happens to fall inside the window can unintentionally count as a repurchase.

What counts as “substantially identical”

This is where the rule gets genuinely ambiguous. Buying back the exact same holding clearly counts, but the government hasn’t published a precise, mechanical test for how similar two different funds or securities need to be before they’re considered substantially identical. Two funds tracking the same index are generally treated as substantially identical to each other, while two funds tracking different indexes in a similar sector are usually treated as distinct, though there’s judgment involved and guidance can shift. This uncertainty is part of why investors doing loss harvesting inside a taxable brokerage account often choose a clearly different fund as a replacement rather than something that might be argued as equivalent.

Why the rule exists

Without a wash sale restriction, an investor could sell a losing position purely to generate a tax deduction, buy the identical investment back moments later, and end up in exactly the same market position while claiming a loss for tax purposes that didn’t reflect any real change in exposure. The rule exists to prevent that kind of purely tax-motivated churn, requiring a genuine change in what’s held — even temporarily or through a similar-but-different fund — before a loss can be counted.

Practical friction points

The rule creates some real planning headaches. An investor who sells at a loss near the end of a calendar year and wants to stay invested has to find a replacement that’s different enough to avoid the wash sale label, then decide whether and when to switch back. Automatic investment plans and dividend reinvestment settings can also trigger unintended wash sales if they’re not paused around a harvesting transaction. None of this changes how capital gains and losses are taxed in general — it only affects whether a specific loss can be claimed in the year it was realized.

The bottom line

The wash sale rule is a guardrail that keeps a capital loss deduction tied to an actual change in investment exposure, not just a same-day swap back into the identical holding. It applies across accounts and over a 61-day window, and the line for what counts as “substantially identical” isn’t always crisp. Anyone navigating it in practice is working with rules that are set by the government and subject to change, which makes it worth confirming current guidance rather than relying on assumptions from a prior year.