The wash sale rule trips up investors who sell a security at a loss and quickly repurchase it. Under IRC Section 1091, if you buy back the same or substantially identical security within 30 days before or after the sale, the IRS disallows that capital loss on your current return.
What Triggers the Wash Sale Rule?
Three conditions must all be met for a loss to be disallowed:
- You sell a security at a loss in a taxable account.
- Within the 61-day window (30 days before or after the sale), you purchase a substantially identical security.
- That purchase occurs in any account you own, including an IRA or 401(k).
The window runs from 30 days before the sale date through 30 days after. If you sell on August 7, the window spans July 8 through September 6.
What Counts as "Substantially Identical"?
The IRS has not defined "substantially identical" with bright-line rules, but common examples include:
- The exact same stock or bond you sold
- Preferred and common shares of the same company, under certain conditions
- Mutual funds with essentially identical portfolios
- Call options that obligate purchase of the same stock
By contrast, ETFs tracking the same index from different providers (such as SPY, IVV, and VOO, all tracking the S&P 500) are generally treated as NOT substantially identical. This distinction is the foundation of most tax-loss harvesting strategies.
What Happens to the Disallowed Loss?
The loss is not permanently gone. Under IRC Section 1091(d), the disallowed loss is added to the cost basis of the replacement security. The holding period of the original shares also carries over to the replacement shares.
Example: You buy 100 shares of XYZ at $50 each ($5,000 total). The price falls to $40. You sell for $4,000, a $1,000 loss. Four days later you buy 100 shares of XYZ at $38 ($3,800). The $1,000 loss is disallowed. Your basis in the new shares becomes $4,800 ($3,800 purchase price plus $1,000 disallowed loss). When you eventually sell those shares, the $1,000 will factor into the gain or loss calculation at that time.
The IRA Trap: When the Loss IS Permanently Lost
Buying a substantially identical security in an IRA within the 61-day window creates a permanent loss disallowance, not just a deferral. Because basis cannot be tracked inside a tax-deferred account, the disallowed loss cannot be added to the IRA's cost basis. It disappears.
If you sell XYZ at a $2,000 loss in your brokerage account and buy XYZ in your Roth IRA five days later, the $2,000 loss is permanently disallowed. The IRS confirmed this in Revenue Ruling 2008-5.
Before harvesting a loss, review all accounts you own for purchases of the same security within the 30-day window.
Dividend Reinvestment (DRIP) Warning
Automatic dividend reinvestment can trigger accidental wash sales. If you sell shares at a loss and your account automatically reinvests dividends from the same security within 30 days, those reinvestment purchases count as replacement share purchases. Check your DRIP settings before harvesting losses near dividend payment dates.
Three Strategies to Harvest Losses Without the Wash Sale
Switch to a Comparable ETF
Sell an ETF at a loss and immediately buy a different provider's ETF tracking the same or a similar index. For example, sell SPY (State Street S&P 500 ETF) and buy IVV (iShares S&P 500 ETF). Both track the same benchmark but are issued by different providers and are generally not considered substantially identical. Wait 31 or more days before switching back if you want to return to your original fund.
Wait 31 Calendar Days Before Rebuying
The most straightforward approach: sell at a loss, wait 31 calendar days, then repurchase the identical security. This fully clears the wash sale window with zero ambiguity. The tradeoff is market exposure risk during the 31-day gap. For volatile positions, compare the tax savings to the potential opportunity cost before deciding to wait.
Coordinate Across All Accounts
Before harvesting, check every account you control: brokerage accounts, IRAs, spousal accounts, and any 401(k) with the same holding. Disable automatic dividend reinvestment in those accounts for the 61-day window around your planned sale. Failure to coordinate across accounts is the most common source of accidental wash sales.
How Is a Wash Sale Reported?
Brokers report wash sale disallowances on Form 1099-B in Box 1g. When you transfer that data to Form 8949, enter the disallowed amount in Column (g) and use code "W" in Column (f). The disallowed loss increases your reported gain (or reduces your reported loss) on that row. The adjusted basis in the replacement shares should reflect the deferred loss, though not all brokers track basis adjustments automatically across separate tax lots or accounts.
For related reading on the crypto side of wash sale rules, see our guide on crypto wash sales and Form 1099-DA in 2026.
Questions about tax-loss harvesting strategy or whether a planned sale triggers the wash sale rule? Contact TS CPA for a free consultation. We respond within the same day.