What Is the Wash Sale Rule?

The wash sale rule, codified in U.S. Internal Revenue Code Section 1091, disallows a tax deduction for a loss on the sale of a security if you purchase a 'substantially identical' security within 30 days before or after the sale. The rule creates a 61-day window: 30 days before the sale, the sale date itself, and 30 days after. If you sell 100 shares of an S&P 500 ETF at a $5,000 loss on December 15 and repurchase the same ETF on January 5 (21 days later), the $5,000 loss is disallowed. The disallowed loss is not permanently lost; it is added to the cost basis of the replacement shares, deferring the tax benefit until you eventually sell those shares.

The Relationship with Tax-Loss Harvesting

Tax-loss harvesting is the strategy of deliberately selling losing positions to realize capital losses that offset capital gains. The wash sale rule is the primary constraint on this strategy. Without the rule, an investor could sell a losing position, immediately repurchase it, claim the tax loss, and maintain the same market exposure indefinitely. The IRS created the wash sale rule specifically to prevent this. However, the rule only applies to 'substantially identical' securities, which creates a legitimate workaround: you can sell one fund and immediately buy a different but similar fund, maintaining your market exposure while harvesting the loss.

The Substantially Identical Workaround

The IRS has never precisely defined 'substantially identical,' but established practice provides clear guidance. Selling an S&P 500 ETF (like SPY) and buying a total U.S. stock market ETF (like VTI) is generally considered acceptable because the two funds track different indices with different compositions, even though their returns are highly correlated (0.99 correlation). Selling one S&P 500 ETF and buying another S&P 500 ETF from a different provider (SPY to IVV) is riskier, as both track the identical index. Selling individual stocks is clearer: selling Apple and buying Microsoft is not a wash sale because they are different companies, even though both are large-cap tech stocks. Tax planning guides cover wash sale rules and harvesting strategies

International Comparison

The wash sale rule is not universal. Canada has a similar 'superficial loss' rule with a 61-day window (30 days before and after), and it applies to the taxpayer, their spouse, and corporations they control, making it broader than the U.S. version. The United Kingdom has a 'bed and breakfasting' rule with a 30-day window that applies to shares of the same company. Japan, notably, has no wash sale rule at all. Japanese investors can sell a losing position and repurchase the identical security the same day, claiming the tax loss without restriction. This makes tax-loss harvesting significantly simpler for Japanese investors, though the average cost method for calculating cost basis reduces some of the benefit.

Practical Tips for Compliance

First, be aware that the wash sale rule applies across all your accounts, including IRAs and 401(k)s. If you sell a stock at a loss in your taxable account and your 401(k) automatically purchases the same stock through a scheduled contribution within 30 days, the loss is disallowed, and worse, the basis adjustment does not transfer to the retirement account, meaning the loss is permanently lost. Second, maintain a list of 'swap pairs' for tax-loss harvesting: for each fund you hold, identify a similar but not identical replacement fund. Third, set calendar reminders for the 31-day waiting period if you plan to repurchase the original security. Fourth, use your brokerage's tax lot reporting to track wash sales automatically; most major brokerages flag wash sales on Form 1099-B.