The wash sale rule is an IRS rule that quietly cancels the tax benefit of selling a losing US stock if you repurchase a substantially identical security too soon.
Tax loss harvesting realizes paper losses to offset capital gains and lower your tax bill.
Done incorrectly, the IRS 30 day rule disqualifies the loss and rolls it into the cost basis of your replacement shares. This guide explains the mechanics.
What the Wash Sale Rule Is and the IRS 30-Day Window
The wash sale rule blocks a loss claim if you buy the same or substantially identical security within 30 days before or after the sale. The full window is 61 days.
According to IRS Publication 550, a wash sale also occurs if your spouse or a controlled corporation makes the replacement purchase. The rule looks at the household, not just one account.
How the disallowed loss is treated
The disallowed loss does not vanish. It gets added to the cost basis of the replacement shares.
You recover it when you sell those replacement shares, assuming no further wash sale chain. The holding period also tacks onto the new lot.
What counts as the 61-day window
Count 30 calendar days before the loss sale and 30 calendar days after, plus the sale day itself. Weekends and holidays are included.
Brokers track this on Form 1099-B. According to the IRS Form 8949 instructions, wash sale losses are reported with code "W" and the nondeductible amount entered in column (g). Review tax-lot detail at year end.
Substantially Identical Securities: ETFs, Options, and Bonds
The phrase "substantially identical" is the murky part of the rule. The IRS has not published a single bright-line test.
Two share classes of the same company are clearly identical. Two ETFs tracking different indexes are generally not. The grey zone in between is where most disputes happen.
ETF swaps and index overlap
Selling SPY and buying VOO is a common debate. Both track the S&P 500, but they are issued by different sponsors and are different legal securities.
Most practitioners treat them as not substantially identical, though the IRS has never formally ruled. Swapping into a different index, such as IWM for small caps, is safer.
Options and bonds
Buying a call option on a stock you just sold at a loss can trigger the rule. The option is treated as a contract to acquire the same security.
Bonds from the same issuer with different maturities or coupons are usually not substantially identical.
Sector-Swap Strategy to Harvest Losses Without Triggering Wash Sale
The cleanest harvest is to sell the position and buy a different but correlated security. This keeps your market exposure while the 30 day clock runs.
A sector ETF is the most common replacement. Selling a single tech stock and buying XLK keeps you in the sector without holding the same company.
Single stock to sector ETF
If you sold a losing bank stock, rotating into XLF gives broad financial sector exposure. After 31 days, you can reverse the trade if you still want the original name.
This avoids cash drag and keeps you invested while the wash sale window closes.
Sector ETF to different-index ETF
If the loss is in a sector ETF, swap to a non-overlapping index. For example, sell a Nasdaq-heavy fund and buy a broad market fund.
Document the rationale in your records. A short note showing the swap was deliberate helps if the IRS questions the lot.
Wash Sale Rule for Non-US Investors at US Brokers
Non-US investors trading US stocks usually do not file a US tax return on capital gains, and most countries do not tax US stock gains at the US level.
The wash sale rule, a US tax rule, often does not apply to non-US residents in practice. The relevant US rule for non-residents is the 30 percent dividend withholding rule, not the 30 day rule.
When non-US investors should still care
If you become a US tax resident, prior-year wash sale lots can affect your future basis. Anyone planning to relocate to the US should keep clean tax-lot records.
Some home countries also have their own wash sale equivalents. Singapore, Indonesia, and Malaysia generally do not tax foreign capital gains, but rules vary.
What your broker reports
US brokers issue Form 1042-S to non-resident clients, not 1099-B. The 1042-S shows dividends and withholding, not wash sale adjustments.
You can still see lot detail in your broker portal, which helps you plan exits regardless of jurisdiction.
Conclusion
The wash sale rule is procedural, not punitive. Understanding the 30 day window and the substantially identical test lets you harvest losses cleanly.
Sector swaps and different-index ETFs are the standard tools. Non-US investors at US brokers usually face withholding rules, not wash sale rules, but documentation still matters.
This article is general education, not personalized tax advice. Consult a CPA or qualified tax advisor for your specific situation. Want to review your loss positions and tax lots? Open Gotrade and start with US$1, fractional shares, and 24 hours/5 days trading.
FAQ
Does the wash sale rule apply inside an IRA?
Yes, and the disallowed loss is permanently lost because IRA basis cannot be adjusted.
How long should I wait before rebuying the same stock?
Wait at least 31 calendar days after the loss sale to be safely outside the IRS window.
Are SPY and VOO substantially identical?
The IRS has not ruled, but most practitioners treat them as not substantially identical because they are different funds.
Do I need a CPA to do tax loss harvesting?
Not always, but a CPA is recommended if you have multiple accounts, a spouse trading the same names, or large positions.





