The wash sale rule is one of the most important and most misunderstood tax provisions that investors face. If you sell an investment at a loss to offset capital gains, then repurchase the same or a substantially identical security too quickly, the IRS will disallow your loss deduction entirely. Understanding how this rule works, and how to work around it legally, can save you thousands of dollars at tax time.
Tax loss harvesting is a popular year-end strategy. You sell investments that have declined in value to generate losses, which then offset any gains you realized during the year. The result is a lower tax bill. But the wash sale rule puts a critical limit on this approach, and violating it, even accidentally, means losing the tax benefit you were counting on.
What is the wash sale rule?
The wash sale rule, defined under IRS Section 1091, prevents you from claiming a capital loss on a security if you purchase a substantially identical security within 30 days before or after the sale. The rule covers stocks, bonds, mutual funds, ETFs, and options. If a wash sale is triggered, the disallowed loss gets added to the cost basis of the replacement security, which means you can only recognize that loss when you eventually sell the replacement.
This 30-day window runs in both directions, creating a total 61-day window you need to watch. If you sell a stock at a loss on June 15, any purchase of that same stock between May 16 and July 15 triggers the wash sale rule. Many investors focus only on the 30 days after a sale and forget that buying before the sale counts too.
The IRS designed this rule to prevent investors from manufacturing tax losses without actually changing their investment position. Without it, you could sell a losing stock on Monday, buy it back on Tuesday, claim the loss on your return, and continue holding the same investment as if nothing happened. The IRS addresses the rule directly in Publication 550, which governs investment income and expenses.
How the 61-day wash sale window works
The wash sale 61-day rule creates a broader restriction than many investors realize. The window includes the day of the sale itself, plus 30 calendar days before and 30 calendar days after. Calendar days, not trading days, are what matter, so weekends and holidays count toward the total.
Here is a wash sale example to illustrate. Suppose you own 200 shares of a tech stock that has dropped $5,000 below your purchase price. On October 10, you sell all 200 shares to harvest the loss. If you repurchase those same shares any time between September 10 and November 9, the $5,000 loss is disallowed. The disallowed loss is not gone permanently, since it gets added to the cost basis of the new shares, but you cannot use it to offset gains on your current-year return.
The rule also applies if you buy an option to acquire the substantially identical security, or if you acquire it in a different account. This means purchasing the same stock in your spouse’s account, your traditional IRA, or your Roth IRA still triggers a wash sale.
Does the wash sale rule apply to IRAs?
Yes, and this is a costly mistake many investors make. The wash sale rule applies even when you repurchase the security inside a tax-advantaged retirement account such as a traditional IRA or Roth IRA. If you sell a stock at a loss in your taxable brokerage account and then buy the same stock in your IRA within the 61-day window, the loss is disallowed.
What makes this scenario especially painful is the cost basis adjustment. In a taxable account, the disallowed loss at least increases the basis of the replacement shares, giving you a larger loss (or smaller gain) when you sell later. But when the replacement purchase happens inside an IRA, that basis adjustment is lost forever because IRA transactions do not track cost basis for tax purposes. The loss effectively disappears.
Investors who hold the same securities across both taxable and retirement accounts need to coordinate their trades carefully. Selling a position in one account while a standing dividend reinvestment plan (DRIP) buys the same security in another account is enough to trigger the rule. A coordinated approach with experienced tax advisory services helps you map out trades across every account before you execute them.
What are substantially identical securities?
The IRS has never published a precise definition of “substantially identical securities,” which creates a gray area that investors should approach carefully. In general, the following are considered substantially identical:
- Shares of the same company’s stock (buying and selling the exact same ticker)
- Options or contracts to acquire that stock
- Mutual funds or ETFs that track the same index, though this is debated
Securities that are generally not considered substantially identical include:
- Stocks of different companies in the same industry (selling shares of one bank and buying shares of another)
- Bonds from different issuers, even if they have similar terms and credit quality
- Index funds that track different indexes (selling an S&P 500 fund and buying a total market fund)
Because the IRS has left this definition vague, conservative investors tend to err on the side of caution. If you are unsure whether two securities qualify as substantially identical, consult a tax advisor before executing the trade.
How to avoid the wash sale rule
There are several legal strategies to avoid triggering a wash sale while still maintaining your desired portfolio exposure. Each approach lets you harvest the tax loss without running afoul of the IRS.
Buy a similar but not identical security immediately. You can sell your losing position and immediately purchase a different investment in the same sector or asset class. For example, if you sell shares of one large-cap technology company at a loss, you could buy shares of a different large-cap technology company or a broad technology sector ETF. The investments are not substantially identical, so the wash sale rule does not apply, and your portfolio stays positioned in the sector you want.
Wait 31 days to repurchase. The simplest approach is to sell the investment, wait at least 31 calendar days, and then buy it back. The risk is that the price may rise during the waiting period, and you miss out on potential gains. This method works best when you are not strongly bullish on the investment’s short-term performance.
Double up before selling. If you want to lock in a specific number of shares, you can buy additional shares equal to the amount you plan to sell, wait 31 days, and then sell the original lot. This keeps your total position size consistent, though it requires additional capital during the overlap period. You must use specific lot identification when selling to ensure you are disposing of the original (higher-cost) shares.
Use a bond swap. For fixed-income investors, bond swaps offer a clean workaround. Sell a bond at a loss and immediately buy another bond with similar credit quality, maturity, and yield from a different issuer. Because bonds from different issuers are not considered substantially identical, the wash sale rule typically does not apply. You take the tax loss while maintaining nearly the same economic position in your portfolio.
Tax loss harvesting and the wash sale rule
Tax loss harvesting is the strategy of deliberately selling investments at a loss to offset capital gains, and it remains one of the most effective year-end tax planning moves for investors. The wash sale rule is the primary constraint on this strategy, so understanding both concepts together is essential.
When harvesting losses, the gains you offset can come from any capital asset, including stocks, real estate, or other investments. If your losses exceed your gains, you can deduct up to $3,000 of net capital losses against ordinary income per year (or $1,500 if married filing separately). Losses beyond that carry forward to future tax years indefinitely.
The key to effective tax loss harvesting is planning your replacement purchases in advance. Before selling a losing position, identify a substitute investment that gives you similar market exposure without being substantially identical to the one you are selling. Execute both trades on the same day to minimize market timing risk. This approach lets you stay fully invested while capturing the tax benefit.
Automated tax loss harvesting, offered by many robo-advisors and brokerage platforms, handles much of this process for you. These systems monitor your portfolio daily for loss-harvesting opportunities and automatically swap into similar (but not identical) funds when a tax loss is available. They also track the 61-day window to prevent wash sale violations. If you use an automated service, make sure it coordinates across all your accounts, including any IRAs, to avoid inadvertent wash sales.
Year-end planning tips for investors
As year-end approaches, review your portfolio for unrealized losses that could offset gains you have already realized. Here are practical steps to take:
1. Tally your realized gains. Review your brokerage statements for all capital gains taken during the year, including gains from mutual fund distributions.
2. Identify harvesting candidates. Look for positions trading below your cost basis. Prioritize short-term losses, which offset short-term gains taxed at your ordinary income rate.
3. Check all accounts. Remember that the wash sale rule applies across accounts, including IRAs and your spouse’s accounts. Make sure a DRIP or automatic rebalance will not trigger an unintended repurchase.
4. Execute before December 31. Trades must settle by year-end to count. Stock trades typically settle in one business day (T+1), so plan accordingly.
5. Document your transactions. Keep records of what you sold, when you sold it, and what you purchased as a replacement. Your broker will report wash sales on Form 1099-B, but tracking them yourself helps avoid surprises at filing time.
Working with a tax advisor can help you identify the most valuable harvesting opportunities and ensure your trades comply with the wash sale rule. The potential savings are significant, and even a single well-timed loss harvest can reduce your tax bill by hundreds or thousands of dollars. Pease Bell CPAs offers a full range of accounting services to help investors and business owners plan transactions with tax consequences in mind.
Frequently Asked Questions
What is the wash sale rule?
The wash sale rule is an IRS regulation that disallows a tax deduction for a capital loss if you buy a substantially identical security within 30 days before or after the sale. The disallowed loss is added to the cost basis of the replacement security, deferring the tax benefit until that replacement is eventually sold.
How long do you have to wait to avoid a wash sale?
You must wait at least 31 calendar days after selling a security at a loss before repurchasing it to avoid triggering the wash sale rule. The 30-day window also applies to purchases made before the sale, creating a total 61-day restricted period centered on the sale date.
Does the wash sale rule apply to bond swaps?
Bond swaps are generally not subject to the wash sale rule because bonds from different issuers are not considered substantially identical securities, even if they have similar credit quality, maturity, and yield. You can sell a bond at a loss and immediately buy a comparable bond from a different issuer to capture the tax loss while maintaining a similar position in your portfolio.
Can a wash sale occur across different accounts?
Yes. The wash sale rule applies across all of your accounts, including taxable brokerage accounts, traditional IRAs, Roth IRAs, and even your spouse’s accounts if you file jointly. Buying the same security in any of these accounts within the 61-day window triggers the rule.
What happens to a disallowed wash sale loss?
A disallowed wash sale loss is not permanently lost. The disallowed amount is added to the cost basis of the replacement shares, which reduces your taxable gain (or increases your loss) when you eventually sell those replacement shares. The exception is when the replacement purchase occurs in an IRA, where the basis adjustment may be permanently lost.
How do you report a wash sale on your tax return?
Your broker will report wash sales on Form 1099-B using Box 1g for the amount of loss disallowed. You report the adjusted figures on Form 8949 and Schedule D. If your broker does not track a wash sale, for example because the replacement purchase occurred at a different brokerage, you are responsible for making the adjustment yourself.




