Save tax
The wash sale rule: How to harvest losses without violating it
The wash sale rule is the one technical detail that breaks DIY tax-loss harvesting. Here's the IRS wording, the 61-day window, and a practical playbook for clean harvests.
Tax-loss harvesting only works if you don't accidentally trigger a wash sale. The rule is simple in principle and surprisingly easy to violate by accident — automatic dividend reinvestment, spouse trades, and 401(k) auto-buys are the three common foot-guns.
This guide walks through the rule, the 61-day window, what "substantially identical" actually means in practice, and the swap pairs most investors use.
The rule, in plain English
If you sell a security at a loss and buy a "substantially identical" security within 30 days before or after the sale, the IRS disallows the loss for tax purposes. The disallowed loss is added to the cost basis of the replacement security, so you get the deduction eventually — when you sell the replacement — but you don't get it this year.
The IRS source is 26 U.S. Code § 1091 and IRS Publication 550. Both say "substantially identical" without defining it precisely.
The 61-day window
30 days before the sale + the day of the sale + 30 days after = 61 days total. The window is symmetric — buying BEFORE the loss sale can also trigger a wash sale.
| Event | Date | Wash sale? |
|---|---|---|
| Buy 100 VTI | May 15 | — |
| Sell 100 VTI at a loss | June 1 | Yes — May 15 buy was within 30 days before |
| Buy 100 VTI again | June 20 | Yes — within 30 days after June 1 sale |
| Buy 100 VTI | July 5 | No — 34 days after the sale |
What "substantially identical" means in practice
The IRS hasn't drawn a bright line. The community consensus, based on case law and common practice:
Definitely substantially identical:
- The exact same stock (Apple → Apple).
- The exact same fund (VTI → VTI, even at different brokers).
- Different share classes of the same fund (VTSAX → VTI both track CRSP US Total Market — same provider, same underlying).
- Likely two different S&P 500 funds from any provider (SPY, VOO, IVV) — same underlying index.
Generally considered safe (different enough):
- Two total-market funds tracking different indexes from different providers (VTI tracking CRSP vs. SCHB tracking Dow Jones US Broad).
- An S&P 500 fund swapped for an S&P 500 ex-Tech sector fund.
- VTI (US total) swapped for ITOT (iShares total — tracks S&P Total Market).
- Two different bond funds with different durations or credit quality.
Conservative interpretation: when in doubt, swap to a fund tracking a different index from a different provider. The further the differentiation, the safer.
Common swap pairs investors use
| Asset class | Sell this | Buy this (within 31 days) |
|---|---|---|
| US total market | VTI (Vanguard) | SCHB (Schwab) or ITOT (iShares) |
| S&P 500 | VOO | SCHX (S&P 500-similar large-cap) — slightly safer than IVV/SPY |
| International developed | VEA | IEFA or SCHF |
| Emerging markets | VWO | IEMG or SCHE |
| Total bond market | BND | AGG or SCHZ |
The pattern: swap across providers AND across the underlying index. VTI → SCHB is the cleanest US total-market swap.
The five common ways people accidentally trigger wash sales
- Automatic dividend reinvestment. If you're harvesting losses on VTI but dividends are auto-reinvesting in VTI in a different account, that buy counts. Fix: turn off DRIP before harvesting.
- 401(k) auto-contributions. If your 401(k) auto-buys a fund similar to one you sold at a loss in taxable, that's a wash sale across accounts. Less risky if the funds are clearly different (most 401(k) S&P 500 institutional fund is technically a different security but the IRS could argue identical).
- Spouse's account. MFJ couples share wash sale rules across all accounts. Coordinate.
- Re-buying too soon. Day 30 of the post-sale window is still inside the wash period — wait at least 31 days.
- Buying first, then selling. The 30-day-before window catches people who bought a tax lot in mid-May and harvest the loss in mid-June.
The IRA wash sale trap
This is the most expensive wash sale mistake. If you sell a security at a loss in a taxable account and buy the substantially identical security in your IRA within 30 days, the IRS not only disallows the loss — it doesn't even add the disallowed loss to the IRA's basis (because IRA basis isn't tracked for individual securities).
Net result: the loss is permanently lost. This is the only common case where a wash sale doesn't just defer the deduction — it eliminates it.
Source: IRS Revenue Ruling 2008-5.
What if you accidentally trigger one?
The loss isn't deleted forever — it's added to the basis of the replacement security. When you eventually sell the replacement, your gain is reduced (or your loss is increased) by the disallowed amount.
Example: bought VTI at $200, sold at $180 (loss of $20). Wash sale: bought VTI again within 30 days at $185. The $20 loss is disallowed this year. Your basis on the new VTI shares is $185 + $20 = $205. When you eventually sell at $230, your taxable gain is $25 instead of $45.
The catch: if you hold the replacement forever, you never realize the benefit. Wash sales aren't free if you don't eventually sell.
Where to do harvesting
Most major brokers track wash sales within their own systems and report on Form 1099-B. Robo-advisors like Betterment and Wealthfront automate tax-loss harvesting with built-in wash-sale logic.
For DIY at a low-cost brokerage:
Full harvesting strategy in our tax-loss harvesting guide.
The bottom line
The wash sale rule isn't hard to navigate — you just have to know it exists. The simplest playbook:
- Turn off DRIP on any fund you're harvesting.
- Pause 401(k) auto-buys of overlapping funds for ~35 days.
- Coordinate with your spouse if MFJ.
- Swap to a different-index/different-provider fund.
- Wait at least 31 days before buying back the original.
Do that and the loss harvest works cleanly every time.
Related reading
Frequently asked questions
- What's the wash sale rule in one sentence?
- If you sell a security at a loss and buy a 'substantially identical' security within 30 days before or after, the IRS disallows the loss for tax purposes and adds it to the basis of the replacement security. Net effect: you don't get to claim the loss this year — you defer it.
- What counts as 'substantially identical'?
- The IRS hasn't given a bright-line definition, but the practical consensus: the exact same stock, the exact same fund (CUSIP), or two funds tracking the exact same index from the same provider. Two different S&P 500 funds from different providers (VOO vs. SPY vs. IVV) likely ARE substantially identical. Two total-market funds tracking different indexes (VTI tracking CRSP vs. SCHB tracking Dow Jones) are generally considered safe swaps.
- How long is the 'wash sale window'?
- 61 days total — 30 days before the loss sale plus 30 days after, plus the day of the sale. So if you sell at a loss on June 1, you'd need to avoid buying the substantially identical security from May 2 through July 1.
- Does the wash sale rule apply to IRAs?
- Yes — and brutally. If you sell a security at a loss in your taxable brokerage and then buy it in your IRA within 30 days, the loss is permanently disallowed (you don't even get the basis bump on the replacement — because IRA basis isn't tracked). This is the most expensive wash sale mistake.
- What about my spouse's account?
- Yes — for married couples filing jointly, the wash sale rule applies across both spouses' accounts. Selling VTI at a loss in your account and your spouse buying VTI in theirs within 30 days triggers a wash sale.
- Does the broker enforce the wash sale rule automatically?
- Partially. Your broker tracks wash sales WITHIN a single account and reports them on your 1099-B. They DO NOT track across accounts at different brokers, across IRAs, or across spouses. You're responsible for catching those.