Wash-sale traps: How to harvest losses without disqualifying them
How does the wash-sale rule trap investors and disqualify tax losses?
The wash-sale rule is the IRS's antidote to an obvious tax loophole: without it, an investor could sell a stock at a loss, claim the deduction, and immediately repurchase the identical stock to regain market exposure. The loss would be deducted indefinitely, reducing taxes without changing the investment. The IRS closed this loophole by disallowing losses when the same (or "substantially identical") security is repurchased within 30 days before or after the sale. Violating the rule costs thousands—not in penalties, but in lost deductions. A $10,000 loss that triggers the wash-sale rule defers the loss to the repurchased shares, meaning you cannot claim the tax benefit until you eventually sell those shares years later (or ever, if you die holding them). For active investors and those who harvest losses seasonally, understanding and avoiding this trap is non-negotiable.
Quick definition: The wash-sale rule disallows a loss deduction if the same or substantially identical security is purchased within 30 days before or after the sale. The disallowed loss is deferred to the repurchased shares' cost basis.
Key takeaways
- The 30-day window: 30 days before the sale, the sale date, and 30 days after (61 days total).
- "Substantially identical" is broader than identical shares; it includes the same security and highly correlated funds (ETF vs. mutual fund tracking the same index).
- Violating the rule defers the loss to the repurchased shares; you don't lose the loss permanently, but the deduction is delayed potentially indefinitely.
- Married couples filing jointly are treated as a single taxpayer, so both spouses' trades trigger wash-sale rules for each other.
- Automatic dividend reinvestment can inadvertently trigger the wash-sale rule.
The 30-day window: timing is absolute
The wash-sale clock is unforgiving. If you sell a security at a loss on November 15, you cannot repurchase it (or a substantially identical security) during this window:
- October 16 through November 14 (30 days before the sale)
- November 15 (the sale date)
- November 16 through December 14 (30 days after the sale)
This is 61 days total. Purchasing on November 15 (the sale date itself) violates the rule. Purchasing on December 14 violates it. Purchasing on December 15 does not.
The IRS measures the holding period of the repurchased shares from the original purchase date, not the repurchase date. If you sell shares at a loss on November 15 (originally purchased June 15) and repurchase on December 15, the new shares inherit the June 15 cost basis as if you never sold. The loss is deferred, and the new shares' holding period resets (for tax-rate purposes), but the cost basis is stepped forward as if you'd been holding continuously.
Concrete example:
David bought Apple stock on March 1 for $150 per share (100 shares, $15,000 invested). By September 15, Apple fell to $130, and David decided to harvest the $2,000 loss. He sold the shares on September 15. He immediately wanted to maintain market exposure, so he purchased 100 shares of the Vanguard Total Stock Market ETF (VTI) on September 16, thinking VTI is "different enough" from Apple to avoid the wash-sale rule. It is not. VTI is a broad index fund with very high correlation to Apple (Apple is ~6% of VTI's holdings). The IRS would likely challenge this as "substantially identical." Assuming the IRS disallows the loss, David's deduction is deferred. The $2,000 loss is added to the VTI cost basis, making it $17,000 instead of $15,000. David now owns VTI at an "effective" cost basis of $170 per share. If he sells VTI at $140 per share the next year, his loss is $3,000, not $2,000, because the deferred wash-sale loss has been added back.
What "substantially identical" means
The IRS regulation does not define "substantially identical" with precision, but the agency provides examples. A few clear cases:
- Identical securities: Selling shares of ABC Corp. and repurchasing shares of ABC Corp. is a violation.
- Same security in different forms: Selling ABC shares and purchasing ABC ADRs (American Depositary Receipts) is likely a violation (same underlying security).
- Index funds tracking the same index: Selling VTSAX (Vanguard Total Stock Market Admiral Shares) and repurchasing VTI (Vanguard Total Stock Market ETF) is likely a violation. Both track the same index to within 0.01%.
- Sector ETFs and their mutual-fund equivalents: Selling VGT (Vanguard Information Technology ETF) and repurchasing VITAX (Vanguard Information Technology mutual fund) is a violation; they hold the same stocks.
Gray areas where the IRS has been less aggressive:
- Different index funds tracking similar but distinct indices: Selling an S&P 500 fund (SPY, IVV) and purchasing a broader total market fund (VTI, BND) the next day has some wash-sale risk, but the IRS is less aggressive here because the securities have materially different compositions. Courts have sometimes allowed this, but it's not risk-free.
- Closely related funds in the same family: Selling Vanguard Growth ETF (VUG) and repurchasing Vanguard Growth Mutual Fund (VIGRX) is a wash-sale risk, but using correlated alternatives (e.g., VUG to iShares Growth ETF, IGV) is often considered acceptable because they have different underlying holdings and managers, though correlation is high.
- International vs. domestic versions of the same index: Selling VTI (U.S. total market) and repurchasing VXUS (U.S. ex-U.S. total market) has not been actively challenged by the IRS, but it remains a gray area.
The safest approach is to use truly different funds after harvesting a loss. If you sell a position in a specific tech stock, do not repurchase a tech ETF. Buy a broad total market fund, a bond fund, or a different sector. The one-month waiting period is not that long, and the certainty of the tax deduction is worth the temporary shift in allocation.
Married couples and joint filers
For tax purposes, a married couple filing jointly is treated as a single taxpayer. If the wife sells XYZ stock at a loss and the husband buys XYZ within the 30-day window, the wash-sale rule applies to the wife's loss. This catches many couples off guard, especially those with separate brokerage accounts or independent investment styles.
Consider a practical scenario: A wife who actively trades and a husband with a buy-and-hold portfolio. The wife sells a stock at a loss on October 15, expecting to harvest the deduction. The husband, unaware of her trade, receives a dividend in the same stock on October 20 and reinvests it, triggering an automatic purchase within the wash-sale window. The wife's loss is disallowed. This situation has happened to hundreds of couples, and communication about trading activity is now a standard best practice.
Dividend reinvestment and automatic wash sales
Dividend reinvestment programs (DRIPs) can inadvertently trigger wash-sale violations. If you own a stock that pays a dividend, sell the stock at a loss, and the dividend is paid and automatically reinvested before the 30-day wash-sale window closes, the reinvested purchase is a repurchase of the same security, violating the rule.
Similarly, if you own a mutual fund that distributes a capital-gain dividend, and you elect to reinvest it, the reinvestment is a new purchase that could trigger a wash-sale if you've sold the fund within 30 days prior.
To avoid this, you have options:
-
Pause dividend reinvestment during the wash-sale window. After selling a position at a loss, switch to cash dividends (not reinvested) for 30 days after the sale. Reinvest manually after the window closes.
-
Use different funds during the window. If you've harvested a loss from Fund A, do not allow Fund A's dividends to reinvest during the 30-day window. Redirect the dividends to a different fund.
-
Plan the harvest to avoid dividend payment dates. If you know a stock pays dividends on December 15, do not harvest a loss in late November; wait until after the payment date.
Most modern brokers offer tools to prevent reinvestment during wash-sale windows, but these rely on you to flag positions. Checking your holdings quarterly and marking loss-harvested positions for special handling is prudent.
Corporate actions and unexpected wash sales
Stock splits, spinoffs, mergers, and reorganizations create wash-sale traps that many investors overlook. If you sell shares at a loss, and the company merges or is acquired within the 30-day wash-sale window, you may be forced to accept shares of a new security as part of the transaction. Those new shares are often considered substantially identical to the old shares, triggering the wash-sale rule for the loss you harvested.
Example: You sell ABC Corp. at a loss on June 15. On July 5, ABC is acquired by XYZ Corp., and you're forced to convert your shares to XYZ stock as part of the merger agreement. The IRS may view XYZ stock as substantially identical to the ABC stock you sold, disallowing your loss.
These scenarios are rare, but they happen. Investors who harvest losses should check company news and investor relations for any M&A activity within the following 30 days. If an acquisition is announced, you may need to revisit your strategy.
The deferral is not permanent (usually)
It's important to clarify: disallowing a loss does not eliminate it permanently. The loss is deferred to the cost basis of the repurchased security. If you repurchase shares at $130 per share and the deferred loss is $2,000, your new cost basis is $2,000 higher, as if you'd paid $130 + (2,000 / 100 shares) = $150 per share originally. If you later sell those shares at $150, you realize no gain or loss; the deferred loss has been applied.
However, the deferral creates three problems:
-
Timing loss. The deduction is delayed, potentially by years. You cannot use it in the current year, reducing this year's tax savings.
-
Potential permanent loss if you hold until death. If you hold the repurchased shares until death, your estate receives a stepped-up basis at fair market value on the date of death. The deferred loss embedded in the cost basis is erased and never used.
-
Forced realization timing. Once the wash-sale loss is embedded in a new position, you cannot selectively choose when to realize it. You must either sell the new position (realizing the loss, plus any new gains or losses from the new position), or hold it forever (losing the benefit if you die).
For these reasons, avoiding the wash-sale rule entirely is far superior to deferring it.
Tracking wash sales and compliance
To avoid inadvertent violations, maintain a quarterly spreadsheet of all positions sold at a loss, including:
- Security name and ticker
- Sale date
- Loss amount
- Wash-sale window end date (sale date + 30 days)
- Replacement security (if any) and purchase date
- Compliance status
Most tax software and brokers now flag wash-sale violations automatically when you report trades. But waiting for April to discover a violation is too late. Identifying and correcting violations in real time (before December 31 closes the tax year) allows you to reposition, if needed, or correctly defer the loss to the repurchased shares' basis.
FAQ
What if I accidentally violate the wash-sale rule? Can I fix it?
If you discover a violation before December 31, you can still reposition. Sell the repurchased shares (or wait 30 days after the original sale and repurchase the original security in a way that doesn't trigger the rule). Once December 31 passes, the violation is "locked in," and the loss is deferred to the repurchased shares' basis. You cannot amend the return to undo it without professional help and possible IRS disputes.
Does the wash-sale rule apply to long-term losses differently than short-term losses?
No. The rule applies the same way to both. A long-term loss (held over one year) that violates the wash-sale rule is deferred just like a short-term loss. However, because long-term losses and short-term losses have different tax benefits when applied (short-term losses offset short-term gains first), the mechanics of deferral can be more complex.
Can I buy a different fund in the same sector to avoid the wash-sale rule?
Technically, yes—a different fund is not substantially identical to the original security. However, the IRS has challenged some pairs of funds as substantially identical based on correlation and holdings overlap. A safer approach: buy a completely different asset class (bonds instead of stocks, or a different sector entirely) to minimize IRS challenge.
What if my spouse buys the security during the wash-sale window?
If you file jointly, the spouse's purchase counts as your purchase, and the wash-sale rule applies. You need to coordinate trades with your spouse and both be aware of each other's loss-harvesting activity.
Do capital-gains reinvestments in mutual funds trigger the wash-sale rule?
If you sell a mutual fund at a loss and reinvest the capital-gains distribution from that same fund within 30 days, yes, the reinvestment is a repurchase triggering the wash-sale rule. To avoid this, redirect the distribution to cash or a different fund for 30 days.
How long do I have to wait to repurchase after the wash-sale window closes?
Once the 30-day window after the sale has closed, you can repurchase the same security or substantially identical security without wash-sale risk. If you sold on June 15, the window closes on July 15. You can repurchase on July 16 or later without triggering the rule.
Does the wash-sale rule apply to options and futures?
Yes. Selling a call or put option at a loss and buying a substantially similar option within 30 days can trigger the wash-sale rule. Options traders face significant wash-sale risk and should consult a tax professional.
Common mistakes
1. Not knowing the exact 30-day window. Many investors mistakenly believe "30 days after the sale" means they can repurchase on day 31. The rule includes day 1 through day 30 after the sale; day 31 is safe. Similarly, the window includes 30 days before, so selling on day 31 before (if counting backward) is still in the window. Use a calendar.
2. Assuming different fund families avoid the rule. A Vanguard total-market fund and a Fidelity total-market fund are both total-market funds, with nearly identical holdings. Selling one and repurchasing the other within 30 days is a wash-sale violation. "Different families" does not mean "not substantially identical."
3. Forgetting about dividend reinvestment during the window. An investor sells a stock at a loss on November 10, intending to harvest the $3,000 deduction. On November 20, a dividend is paid and automatically reinvested. The reinvestment is a repurchase within the window, and the loss is disallowed. Pausing reinvestment is a simple fix.
4. Not communicating with a spouse about trading activity. A husband and wife file jointly but manage separate accounts. The wife harvests a loss; the husband, unaware, buys the same stock as part of a rebalance. The wife's loss is disallowed because of the husband's purchase.
5. Assuming a merger or acquisition resets the wash-sale clock. If ABC stock is acquired by XYZ, and you're forced to exchange your ABC shares for XYZ shares within 30 days of selling ABC at a loss, the new XYZ shares are often considered substantially identical, and the loss is disallowed. This is a rare but significant trap.
Related concepts
- Tax-Loss Harvesting Strategies — Strategic loss harvesting within wash-sale constraints.
- Capital Gains: Short-Term vs. Long-Term — How wash-sale deferrals affect holding periods.
- Why Ignoring Taxes Until April Costs Thousands — Real-time wash-sale compliance during the year.
- Triggering Short-Term Gains Needlessly — Avoiding short-term-gains exposure when harvesting.
Summary
The wash-sale rule disallows losses when the same or substantially identical security is repurchased within 30 days before or after the sale. For active investors and those who harvest losses seasonally, the rule is a minefield. Violating it defers the loss (costing years of deduction timing), and in some cases, the loss is never used if the security is held until death. Avoiding the rule requires tracking sale dates, understanding "substantially identical," pausing dividend reinvestment, and communicating with spouses. The effort is minimal compared to the $2,000–$5,000 per loss-harvesting error that incorrect compliance costs.
Next
→ How does wrong asset location waste thousands in taxes yearly?