HomePersonal FinanceTaxes › Wash Sale Rule

Wash Sale Rule: What It Is, How It Works & How to Avoid It

The wash sale rule (IRS Section 1091) prevents you from claiming a tax loss on a security if you purchase the same or a “substantially identical” security within 30 days before or after the sale. The disallowed loss gets added to the cost basis of the replacement shares — it’s deferred, not permanently lost.

How the Wash Sale Rule Works

The rule exists to prevent investors from selling at a loss purely for the tax deduction, then immediately buying back the same position. The IRS created a 61-day window: 30 days before the sale, the sale date, and 30 days after. If you acquire substantially identical securities anywhere in that window, the loss is disallowed.

Example

You own 100 shares of XYZ stock bought at $50/share. The price drops to $35, so you sell all 100 shares, realizing a $1,500 loss. But 10 days later, you buy 100 shares of XYZ again at $33. The wash sale rule triggers: your $1,500 loss is disallowed, and your cost basis in the new shares becomes $33 + $15 = $48 per share.

What Triggers a Wash Sale

Triggers a Wash SaleDoes NOT Trigger a Wash Sale
Buying the same stock within 30 daysBuying a different company’s stock in the same sector
Buying a substantially identical ETFBuying a different index ETF (e.g., S&P 500 → Total Market)
Buying call options on the same stockWaiting 31+ days to repurchase
Spouse buys the same security in their accountBuying in a different sector or asset class entirely
Buying in an IRA within the 61-day windowSelling at a gain (rule only applies to losses)

The Wash Sale Rule and Tax-Loss Harvesting

Tax-loss harvesting is one of the most effective tax strategies for investors — but the wash sale rule is the main constraint. To harvest losses without triggering a wash sale:

Wash Sales Across Accounts

This is where many investors get caught. The wash sale rule applies across all your accounts — taxable brokerage, IRAs, and even your spouse’s accounts. If you sell a stock at a loss in your brokerage account and your 401(k) auto-purchases the same stock within 30 days, that’s a wash sale.

Watch Out
Wash sales involving IRAs are especially dangerous. If you sell at a loss in a taxable account and buy the same security in an IRA within 30 days, the loss is permanently disallowed — it doesn’t get added to the IRA’s cost basis. This is the one scenario where the loss truly disappears.

Cost Basis Adjustment

When a wash sale is triggered, the disallowed loss isn’t permanently gone (except for the IRA scenario above). It gets added to the cost basis of the replacement shares, which means you’ll realize a smaller gain (or larger loss) when you eventually sell those replacement shares.

Adjusted Cost Basis New Cost Basis = Purchase Price of New Shares + Disallowed Loss per Share
Analyst Tip
If you use automated tax-loss harvesting through a robo-advisor, make sure the algorithm accounts for holdings in your other accounts. A dividend reinvestment in your IRA could unknowingly trigger a wash sale on a loss you harvested in your taxable account. Coordinate across all accounts or use a single platform.

Key Takeaways

  • The wash sale rule disallows losses if you buy the same or substantially identical security within a 61-day window
  • Disallowed losses get added to the replacement shares’ cost basis — they’re deferred, not lost
  • Exception: wash sales involving IRAs can permanently destroy the tax benefit
  • The rule applies across all your accounts, including your spouse’s
  • Swap into similar (but not identical) funds to harvest losses while staying compliant

Frequently Asked Questions

Does the wash sale rule apply to cryptocurrency?

As of 2024, the wash sale rule technically doesn’t apply to cryptocurrency because the IRS classifies crypto as property, not a security. However, legislation has been proposed to close this loophole. Check current rules on cryptocurrency taxes before relying on this exemption.

What does “substantially identical” mean?

The IRS hasn’t given a precise definition, which creates a gray area. The same stock or mutual fund clearly qualifies. Different ETFs tracking the exact same index are risky. ETFs tracking different indexes (like S&P 500 vs. Total Stock Market) are generally considered safe, but there’s no bright-line rule.

Do I need to report wash sales on my tax return?

Your broker reports wash sales on Form 1099-B and adjusts the cost basis on your statement. However, brokers only track wash sales within the same account. Cross-account wash sales are your responsibility to track and report.

Can I sell and buy back the same day to trigger a wash sale intentionally?

Some investors intentionally trigger wash sales to carry forward losses (via higher cost basis) while maintaining their position. This can be useful if you want to stay invested but plan to realize the deferred loss later. Just ensure the math works in your favor.

How long is the wash sale window exactly?

The window is 61 days total: 30 calendar days before the sale, the day of the sale itself, and 30 calendar days after. To be safe, wait a full 31 days after selling before repurchasing the same or substantially identical security.