The wash-sale rule is one of the most common surprises at tax time for people who trade stocks and ETFs. You sell at a loss, buy back in soon after, and the loss you expected to deduct doesn't show up the way you thought. This guide explains the rule in plain English, with fictional examples, based on IRS Publication 550 and the tax code. It's educational record-keeping help, not tax advice. Confirm your situation with a CPA or other qualified tax professional.
The rule in plain English
If you sell a stock or security at a loss and, within 30 days before or after the sale, you buy the same stock or one that is "substantially identical," the loss is generally disallowed for now (Internal Revenue Code §1091; IRS Publication 550). The window covers 61 days in total: the 30 days before the sale, the sale day and the 30 days after it.
Two details matter:
- Buying before the sale counts. If you buy more shares and then sell your older shares at a loss within 30 days, that can be a wash sale too.
- The calendar doesn't reset in January. A buy on January 8 can wash a loss from December 18. The window crosses tax years.
The loss usually isn't gone, it's moved
For an ordinary wash sale in a taxable account, the disallowed loss is added to the cost basis of the replacement shares, and the holding period of the shares you sold carries over to them. You generally get the benefit later, when you sell the replacement shares.
Fictional example: you buy 100 shares of AAA for $5,001 including fees and sell them for $4,499, a $502 loss. Fifteen days later you buy 100 shares again for $4,601. That's a full wash sale. The $502 is disallowed now and added to the new shares, so their basis becomes $5,103. If you later sell them for $5,199, your gain is $96, not $598.
Partial wash sales
If you buy back fewer shares than you sold, only part of the loss is disallowed. Sell 200 shares at a $400 loss and buy back 50 within the window, and 50/200 of the loss ($100) is disallowed. The other $300 is allowed now.
The IRA trap
This is the costly one. If you sell at a loss in a taxable account and buy the replacement shares in your IRA or Roth IRA within the window, the IRS treats it as a wash sale, and under Revenue Ruling 2008-5 the disallowed loss is not added to the basis of the IRA shares. In practice the loss can be lost for good. Automatic purchases count too, such as dividend reinvestment in the IRA.
In the partial example above, if the 50 replacement shares were bought in an IRA, the $100 disallowed would not move to any basis.
Why your 1099-B may not show it
Brokers report wash sales on Form 1099-B (box 1g, "wash sale loss disallowed"). But under the IRS instructions for Form 1099-B, a broker has to report wash sales only when the purchase and sale are of identical securities (same CUSIP) in the same account. Your broker doesn't see:
- purchases in your IRA or another brokerage account,
- purchases in a spouse's account,
- a different security you and your tax pro treat as substantially identical.
So the 1099-B can show no wash sale where the rule still applies. Adjustments to what the broker reported are generally made on Form 8949, where wash sales use code W. How to report is a question for your tax professional.
"Substantially identical" is a judgment call
Shares of the same company's stock are identical. Shares of two different companies generally aren't. Between those, it gets harder: two funds tracking the same index from different issuers is a question the IRS hasn't answered with a bright line. A careful record notes what you bought and why, so you and your CPA can decide.
A simple year-end routine
- List every sale at a loss this year, in every account.
- For each one, list every purchase of the same or a similar security 30 days before and after, in every account, including IRAs, a spouse's accounts and dividend reinvestments.
- Work out full or partial, the disallowed amount and where the basis adjustment goes.
- Compare with the broker's 1099-B, line by line, and note every difference and why.
- Take the list to your tax professional.
You can check a single sale against up to four buys in our free wash-sale window checker. For a whole year across accounts, with a 1099-B reconcile and a summary for your CPA, see the Wash-Sale & 1099-B Year-End Workbook.
Sources
- IRS Publication 550, Investment Income and Expenses, "Wash Sales": irs.gov/publications/p550
- Internal Revenue Code §1091
- Revenue Ruling 2008-5 (IRA purchases)
- IRS Instructions for Form 1099-B (box 1g) and Instructions for Form 8949 (code W): irs.gov/forms-pubs/about-form-8949
Simplified summary as of October 2026, for US stocks and ETFs. Options, short sales and other situations have more rules. Educational record-keeping, not tax advice.
Check a wash-sale windowFree, in your browser. Nothing is saved.
Open the checkerMore on this topic: the Tax & Records category lists every related tool, including what’s coming soon. Or browse all 7 categories.
FAQ
What is the wash-sale window?
30 days before and 30 days after the sale date, 61 days in total including the sale day (IRS Publication 550).
Is the disallowed loss lost forever?
Usually not. In a taxable account it's generally added to the cost basis of the replacement shares. The big exception is a replacement bought in an IRA, where Rev. Rul. 2008-5 says the loss isn't added to basis.
Can buying in my IRA trigger a wash sale?
Yes. A purchase in your IRA or Roth IRA within the window can make a taxable-account loss a wash sale, and that loss is generally not recoverable through the IRA shares' basis.
Why doesn't my 1099-B show the wash sale?
Brokers are only required to report wash sales for identical securities (same CUSIP) in the same account. Purchases in other accounts, IRAs or similar funds won't appear.
Does a January purchase affect a December loss?
It can. The window runs 30 days after the sale even if that crosses into the next year.
Is this tax advice?
No. It's educational record-keeping information. Confirm your situation with a CPA or qualified tax professional.