Wash Sale Rules Explained: How to Avoid Disqualifying Your Tax-Loss Harvesting
Tax-loss harvesting can reduce your capital gains bill and offset up to $3,000 in ordinary income each year. But one IRS rule—the wash sale rule—can erase that benefit entirely if you buy back the same or a similar security too soon. Thousands of investors trigger it by accident every year, particularly during late-year portfolio cleanup. This guide explains exactly how the rule works, where it catches investors off guard, and five concrete strategies to stay compliant.
What Is the Wash Sale Rule? (And Why It Matters to Tax-Loss Harvesters)
The IRS prohibits you from claiming a capital loss if you sell a security at a loss and then repurchase a “substantially identical” security within a 61-day window: 30 days before the sale, the sale date itself, and 30 days after. This is the wash sale rule, codified under IRC Section 1091.
The rule is broader than most investors expect. It applies across any account you control, including:
- Your individual brokerage accounts
- Your spouse’s brokerage accounts (even when filing separately)
- IRAs and Roth IRAs
- 401(k) and other employer-sponsored retirement accounts
It covers stocks, ETFs, mutual funds, and options on those securities. If you trigger a wash sale, the IRS disallows the loss for the current tax year. For regular taxable accounts, the loss is deferred—not permanently lost. For tax-deferred accounts like IRAs, however, the loss is forfeited entirely and can never be recovered.
Without compliance, your tax-loss harvesting strategy fails completely: no capital gains offset, no ordinary income deduction, no carryforward loss for the year of the wash sale.
The 61-Day Window: Understanding the Timeline
Many investors mistakenly believe the wash sale window is just 30 days after a sale. It is not. The full window spans 61 calendar days:
- Begins 30 calendar days before the sale date
- Includes the sale date itself
- Closes 30 calendar days after the sale date
Any purchase of the same or substantially identical security within this window disqualifies the loss—even purchases you made before you decided to harvest the loss.
Partial Purchases Still Trigger the Rule
If you sell 100 shares at a loss but only repurchase 60 shares within 61 days, the wash sale applies only to the 60 matched shares. The loss on the remaining 40 shares can still be claimed. The IRS applies matching rules on a share-for-share basis when the quantities differ.
What “Substantially Identical” Actually Means
This is where the wash sale rule gets genuinely difficult. The IRS has not published a definitive list of what counts as substantially identical, and there is no bright-line test in the tax code. This ambiguity is a real planning challenge.
Here is how practitioners generally apply the standard:
- Same stock ticker: Clearly substantially identical. Selling 100 shares of Apple and buying Apple back within 61 days always triggers the rule.
- Options on the same security: Treated as substantially identical to the underlying stock. Selling a stock at a loss and then buying call options on the same stock is a wash sale.
- Different fund in the same family, same index: A strong candidate for substantially identical. Selling Vanguard S&P 500 ETF (VOO) and buying iShares S&P 500 ETF (IVV) is a gray area because both track the identical index.
- Same sector, different fund family: Generally acceptable if holdings are materially different. Selling a Vanguard Large-Cap fund and buying a Fidelity Large-Cap fund with different holdings passes for many tax practitioners—but document the overlap.
- Broad-market ETF replacing sector stock: Usually safe. An S&P 500 ETF holds 500 companies; replacing a single tech stock with a total-market ETF is considered not substantially identical by most practitioners.
- Different company in same sector: Generally acceptable. Selling Microsoft stock and buying Alphabet stock is not a wash sale, even if both are large-cap technology companies.
Because the IRS has never issued clear guidance on ETF-to-ETF replacement, BlackRock and other major asset managers explicitly note that investors should not rely on any single interpretation as definitive. When in doubt, document your reasoning and consult a tax advisor.
➤ Free Guide: 5 Ways To Automate Your Retirement
How Disallowed Losses Affect Your Cost Basis
A common misconception: triggering a wash sale doesn’t permanently erase your loss. In a taxable account, the disallowed loss is added to the cost basis of your replacement security. This defers—rather than destroys—the tax benefit.
Example: How Cost Basis Adjustment Works
Suppose you bought 100 shares of XYZ at $10 per share ($1,000 total). The stock drops and you sell at $8 per share, realizing a $200 loss. Three weeks later, XYZ is at $6 per share and you repurchase 100 shares ($600).
- The $200 loss is disallowed for the current tax year.
- Your cost basis in the replacement shares is $600 + $200 = $800 (not $600).
- When you eventually sell those replacement shares, you will have a larger deductible loss (or smaller taxable gain) baked into the basis.
Additionally, the holding period of the original shares carries over to the replacement shares. If you held the original shares for 11 months before selling, those 11 months count toward the replacement’s holding period—which can affect whether any future gain is taxed at long-term or short-term capital gains rates.
The IRA Exception: Losses Are Forfeited, Not Deferred
This deferral mechanism only applies to taxable accounts. If you sell a security at a loss in a taxable account and repurchase the same or substantially identical security in an IRA within 61 days, the disallowed loss cannot be added to the IRA’s cost basis. Per Fidelity’s guidance, the loss is effectively forfeited. You get no benefit, now or later.
Tax-Loss Harvesting and the Wash Sale Rule: How They Collide
Tax-loss harvesting is the deliberate sale of losing positions to generate capital losses that offset capital gains or reduce ordinary income by up to $3,000 per year. Losses exceeding that threshold carry forward indefinitely to future tax years.
The wash sale rule is the primary reason harvesting strategies fail in practice. Here are the most common collision points:
- Year-end rebuys: Investors harvest losses in December but rebuy the same security in early January—within 30 days—disqualifying the loss.
- Automatic dividend reinvestment (DRIP): Selling a fund for a loss while DRIP continues purchasing shares of that same fund every month creates repeated wash sale violations with no manual action required.
- Spousal accounts: One spouse harvests a loss in a joint brokerage account while the other buys the same security in a separate Roth IRA. The wash sale rule applies household-wide.
If you sell a position at a loss on December 31, you cannot rebuy until at least January 31 of the following year (31 days after the sale) without disqualifying the loss.
5 Strategies to Avoid Triggering the Wash Sale Rule
1. Wait 31+ Days Before Rebuying
The simplest and most definitive approach. Sell the losing position, hold cash or a placeholder investment for at least 31 calendar days, and then rebuy. This completely eliminates wash sale risk on that transaction. The tradeoff: you are out of the market during that window and may miss a price recovery.
2. Replace with a Similar (Not Substantially Identical) Security
Sell the loser and immediately reinvest proceeds in a different security in the same asset class or sector. For example:
- Sell Cisco stock → Buy Juniper Networks stock (same sector, different company)
- Sell a short-term bond fund → Buy a different short-term bond fund from a different manager
- Sell an energy sector ETF → Buy a different energy sector ETF with materially different holdings
3. Use Broad-Market ETFs as Replacements
If you sell a single company’s stock, a broad-market ETF (total stock market, S&P 500) is generally not considered substantially identical to any individual stock. This lets you maintain market exposure without waiting 31 days and without wash sale risk. Per Fidelity, ETFs and mutual funds “generally hold enough securities that they pass the test of being not substantially identical to any individual stock.”
4. Switch Fund Families for Mutual Fund Replacements
If you sell a mutual fund at a loss, buy a comparable fund from a different fund family with a meaningfully different set of holdings. A Fidelity large-cap index fund and a Vanguard large-cap index fund may have substantial overlap if they track the same benchmark—document the specific holdings difference. An actively managed fund versus an index fund in the same category tends to be a safer swap.
5. Coordinate Across All Household Accounts
Before executing any loss harvest, review all accounts in your household—including your spouse’s IRA, 401(k), and taxable accounts. Confirm that no automatic purchases (DRIP, recurring contributions, target-date fund rebalancing) will buy the same security within the 61-day window. This step alone prevents a large share of accidental wash sales.
Common Mistakes That Disqualify Tax-Loss Harvesting
- Leaving DRIP active: If your brokerage account automatically reinvests dividends from Fund A, selling Fund A for a loss while DRIP continues is a recurring wash sale trigger. Disable DRIP before harvesting, or redirect it to a different security.
- Buying options on the sold security: Selling XYZ stock at a loss and then purchasing call options on XYZ is treated as a wash sale under IRS rules. Options are considered substantially identical to the underlying security they cover.
- Ignoring spousal accounts: Filing separately does not protect you. The wash sale rule explicitly applies to purchases by your spouse during the 61-day window, regardless of how you file.
- Assuming “similar sector” means safe: Two ETFs tracking the same index in the same sector may be considered substantially identical even if they come from different fund companies. The index tracked matters more than the fund family name.
- Not tracking cost basis adjustments: When a wash sale occurs, you must record the disallowed loss added to the replacement security’s cost basis. Failing to do so leads to overstated losses or understated gains years later when you eventually sell the replacement—a separate IRS problem.
What to Do Next: Your Tax-Loss Harvesting Checklist
Use this checklist before executing any year-end tax-loss harvest:
- Identify loss positions now. Review your portfolio for positions with unrealized losses. Prioritize positions where harvesting would offset meaningful capital gains or reduce ordinary income.
- Map a replacement security for each loser. For each position you plan to sell, identify either (a) a compliant replacement you can buy immediately, or (b) a commitment to wait 31+ days before rebuying. Write this down before executing any trades.
- Disable automatic reinvestment. Turn off DRIP and any recurring purchase plans for securities you intend to harvest. Redirect those contributions to a different security during the 61-day window.
- Check spousal and household accounts. Review your spouse’s brokerage, IRA, and 401(k) activity. Confirm no purchases of your target securities are scheduled within 61 days of your planned sale date.
- Document your “not substantially identical” reasoning. For each replacement security, write a brief note explaining why it is not substantially identical to the sold security (e.g., “Different fund company, tracks Russell 1000 vs. S&P 500, approximately 20% non-overlapping holdings”). This documentation supports your position if the IRS questions it.
- Set a calendar reminder for Day 32. If you are waiting 31+ days to rebuy, set a reminder on Day 32 to re-evaluate and execute the repurchase. Missing this window can mean missing a favorable re-entry price.
- Update your cost basis records. If a wash sale does occur, record the disallowed loss added to the replacement security’s cost basis immediately. Your brokerage may track this automatically—verify it, and keep your own records.
- Consult a CPA or tax advisor. The “substantially identical” standard is fact-specific, and the IRS has not issued definitive guidance on many ETF-to-ETF swaps. A qualified tax professional can review your specific security substitutions and confirm compliance before you file.
Bottom Line
The wash sale rule is not a technicality—it is one of the most commonly violated tax rules among active investors using tax-loss harvesting. The 61-day window, the household-wide scope, and the undefined “substantially identical” standard create real traps for investors who are not paying close attention.
The mechanics are learnable. Sell at a loss, replace with a genuinely different security (or wait 31 days), disable automatic reinvestment, coordinate with your spouse, and document your reasoning. Done correctly, tax-loss harvesting delivers real tax savings that compound over time. Done carelessly, it triggers disallowed losses and—if those losses were harvested inside an IRA—permanently forfeits the tax benefit you were trying to capture.
This article is for informational purposes only and does not constitute personalized tax or legal advice. Consult a qualified CPA or tax attorney before implementing any tax strategy.
