Imagine selling a stock at a loss, feeling clever about locking in a tax deduction — then buying it back a week later, only to discover the IRS won’t honor that loss. This frustrating situation catches thousands of American investors off guard every year, and it all comes down to the wash sale rule.
After all, the stakes are real: losing a deduction you counted on can mean a surprise tax bill at the worst possible time. Worse yet, many investors don’t even realize they triggered a violation until they’re sitting across from a tax preparer in April.
With that in mind, this piece breaks down exactly how the wash sale rule works, what triggers it, how it affects retirement accounts, and — most importantly — how to legally work around it.

What Is the Wash Sale Rule?
The wash sale rule is an IRS regulation under Internal Revenue Code Section 1091 that prevents investors from claiming artificial tax losses. Its core purpose is to stop people from selling a security just to book a loss — then immediately jumping back into the same position as if nothing changed.
In plain terms, you cannot sell a security at a loss and repurchase the same or substantially identical security within a specific time window and still deduct that loss on your taxes.
Critically, the disallowed loss doesn’t simply vanish. Instead, it gets added to the cost basis of the newly purchased security, which may reduce your taxable gain when you eventually sell — but that benefit is deferred, not immediate.
The rule has existed for decades, and the IRS enforces it strictly. Many investors assume it only applies to stocks, but it covers a broader range of securities than most people expect.
How the 61-Day Window Actually Works
The most misunderstood part of this regulation is its timing. To be specific, the wash sale window spans 61 days total — 30 days before the sale, the day of the sale itself, and 30 days after the sale.
That detail trips people up constantly. And here’s the kicker: the clock doesn’t start when you sell — it actually started 30 days earlier. So even a purchase you made a month ago can disallow a loss you try to claim today.
The Three Conditions That Trigger a Wash Sale Violation
A wash sale violation occurs when all three of the following conditions are met at the same time:
- You sell a stock or security at a loss
- You buy back a “substantially identical” security within the 61-day window
- The transaction occurs in any account you own — including IRAs and spousal accounts
Notably, that third point surprises many investors. Even if you sell in a taxable brokerage account and repurchase in a separate IRA, the wash sale rule still applies. Fidelity notes that wash sales across different accounts are a common and costly oversight.
What Counts as “Substantially Identical”?
While the IRS doesn’t provide an exhaustive list, the term “substantially identical” generally covers securities that are so similar they represent the same economic exposure. Here are the most common examples:
- Selling shares of Company A and buying them back within 30 days
- Selling a stock and buying call options on the same stock
- Selling one share class of a fund and buying another share class of the same fund
- Selling a mutual fund and buying an ETF that tracks the exact same index
On the other hand, selling an S&P 500 ETF and replacing it with a total market ETF typically does not trigger a wash sale, since those funds track different indexes. This distinction is central to legal tax-loss harvesting strategies.
The Cost Basis Adjustment: Your Deferred Silver Lining
Now, when the IRS disallows a loss, that amount isn’t truly erased — it gets rolled into the cost basis of your replacement security. This mechanism is worth understanding because it affects your future tax liability.
For example, suppose you buy 100 shares at $50 each, sell them at $40 (a $1,000 loss), and then repurchase within the window at $42. Your disallowed $1,000 loss gets added to the $4,200 repurchase cost, giving you an adjusted cost basis of $5,200.
So, when you eventually sell those shares, that higher cost basis reduces your taxable gain — or increases your deductible loss. The tax benefit isn’t lost; it’s postponed.
Wash Sale Rule and Retirement Accounts: A Hidden Trap
Many investors believe their IRA or Roth IRA is a safe workaround. Unfortunately, that belief leads to one of the most common — and expensive — wash sale mistakes.
If you sell a stock at a loss in your taxable account and repurchase the same security inside an IRA within the 61-day window, the loss is permanently disallowed. Unlike in a taxable account, where the loss gets added to your cost basis, there is no cost basis adjustment mechanism inside an IRA.
TurboTax confirms that this is one of the most permanent consequences of a wash sale violation.
Below is a quick comparison of how wash sale outcomes differ across account types:
| Account Type | Wash Sale Triggered? | Loss Outcome |
|---|---|---|
| Taxable Brokerage → Taxable Brokerage | Yes | Loss added to cost basis of replacement security |
| Taxable Brokerage → Traditional IRA | Yes | Loss permanently disallowed — no basis adjustment |
| Taxable Brokerage → Roth IRA | Yes | Loss permanently disallowed — no basis adjustment |
| IRA → IRA (same security) | Yes | Loss permanently disallowed inside tax-advantaged account |
As the table shows, any cross-account repurchase within the wash sale window carries real risk. Spousal accounts also count — if your spouse repurchases a security you just sold at a loss, that can trigger a violation too.
What About Cryptocurrency?
Here’s where things get interesting. As of 2025, the IRS classifies cryptocurrency as property, not a security. That means the wash sale rule technically does not apply to crypto transactions under current law.
Consequently, investors can sell Bitcoin or Ethereum at a loss, immediately repurchase the same asset, and still claim the tax deduction. This is a legitimate advantage that many crypto traders use for tax-loss harvesting.
However, this gap may not last long. AdvisorFinder’s 2025 guide notes that Congress has repeatedly discussed expanding wash sale rules to include digital assets, so investors should monitor potential legislative changes closely.
Legal Strategies to Avoid Wash Sale Violations
Fortunately, investors have several legitimate options to harvest losses without triggering the rule. These strategies preserve your tax deduction while keeping your portfolio positioned for recovery.
Wait Out the 31-Day Period
The simplest approach is to wait at least 31 days after the sale before repurchasing the same security. This clears the post-sale portion of the wash sale window entirely, though it does expose you to market movement during that period.
Replace With a Similar — But Not Identical — Security
Alternatively, consider swapping into a comparable but legally distinct investment. Some practical examples include:
- Sell an S&P 500 ETF, buy a total market or equal-weight ETF instead
- Sell shares in one technology fund, replace with a different sector ETF tracking similar — but not identical — holdings
- Sell an individual stock, replace with a broad sector ETF that includes similar exposure
These swaps let you stay invested in the same general market area while legally sidestepping the wash sale trigger. The key is ensuring the replacement security tracks a different index or represents a genuinely different basket of holdings.
Track Across All Your Accounts
Many brokerage platforms report wash sales on Form 1099-B, but they only track activity within their own system. If you hold accounts at multiple brokers, monitor your trades manually or use tax-tracking software to catch cross-account violations before they happen.
Wrapping It All Up
Ultimately, the wash sale rule exists to close a loophole — but it frequently catches well-intentioned investors who are simply trying to manage their portfolios tax-efficiently.
The 61-day window, the broadly defined “substantially identical” standard, and the cross-account reach of the rule all create real complexity.
Clearly, the disallowed loss, the permanent consequences of IRA-involved violations, and the current crypto exemption are all details that can meaningfully affect your tax bill. Investor.gov provides a useful quick reference for the core definition if you want a concise government source to revisit.
In short, with careful timing, smart security substitution, and consistent cross-account tracking, you can still harvest tax losses effectively — without accidentally handing your deduction back to the IRS.
Watch this short video to quickly understand the **wash sale rule** and avoid costly tax mistakes.
Frequently Asked Questions
Do dividends and reinvested dividends create wash sales?
If I sell only part of my position at a loss, can only part of the loss be disallowed?
How do I report a wash sale on my tax return if my broker does not catch it?
Can employee stock purchase plans and company stock grants trigger wash sales?
Do tax lots matter when avoiding wash sales?