How do I avoid a wash sale when I sell at a loss?
By Wash-Sale Guardian (who's behind it) · Published 2026-11-12 · Last updated 2026-11-12 · How the checker works
Don't acquire the same stock, or anything substantially identical to it, in any of your accounts from 30 days before the loss sale through 30 days after it. That leaves three ways the IRS text supports: wait until day 31 after the sale to buy back, buy the new shares first and sell the old ones more than 30 days later, or buy something that isn't substantially identical. Buying back at another broker, in your IRA or through your spouse doesn't avoid it.
What makes a wash sale
IRS Publication 550 says a wash sale occurs when you sell or trade stock or securities at a loss and within 30 days before or after the sale you:
- "Buy substantially identical stock or securities,"
- "Acquire substantially identical stock or securities in a fully taxable trade,"
- "Acquire a contract or option to buy substantially identical stock or securities, or"
- "Acquire substantially identical stock for your individual retirement arrangement (IRA) or Roth IRA."
It adds: "If you sell stock and your spouse or a corporation you control buys substantially identical stock, you also have a wash sale." Everything below follows from that list and from the 61-day window in IRC §1091.
1. Wait out the window before you buy back
The statute's period begins "30 days before the date of such sale or disposition" and ends "30 days after such date", so day 31 after the sale is the first clean re-buy date for that loss. For a sale on Monday, December 14, 2026, the window runs from November 14, 2026 through January 13, 2027, and the first clean re-buy date is Thursday, January 14, 2027. The wash sale calculator gives the date for any sale.
The look-back half matters as much as the wait. A purchase in the 30 days before the sale, in any account of yours or your spouse's, washes the loss on that many shares just as a later one would, however long you wait afterwards. A scheduled buy is a purchase. This site also treats a reinvested dividend as one: Pub 550 describes a reinvestment plan as using your dividends "to buy" more shares, but no IRS text we found names reinvestment in the wash-sale rules, so ask a CPA or EA if a large amount turns on it (dividend reinvestment and wash sales). A December loss bought back in January is covered in a December loss and a January re-buy.
2. Buy first, then sell the old shares more than 30 days later
Some investors buy the new shares first and sell the old, higher-cost shares later. That works only if the purchase is outside the sale's window, so the sale has to come more than 30 days after the purchase. Treas. Reg. §1.1091-1 has the failing case: 100 shares bought on December 1, 1954, 100 more on December 15, 1954, and the December 1 shares sold at a loss on January 3, 1955. "Because of the provisions of section 1091, no loss from the sale is allowable as a deduction." For a loss sold on Thursday, December 31, 2026, the last trading day of 2026, the window opens on December 1, so the new shares have to be bought on or before Monday, November 30, 2026 (the 2026 deadline guide).
The sale also has to be of the older shares. If you don't identify which shares you sell, the Form 1099-B instructions (2026) have the broker report them in this order: "Any shares for which the acquisition date is unknown", then "The shares that were purchased or acquired first". If your account is set to another method, check which shares the sale used. You hold both sets of shares for at least 31 days, and a purchase of that stock in any account, yours or your spouse's, before the sale's own window closes would wash the loss.
A worked example
Made-up trades in a made-up ticker, all in one taxable account:
- Monday, March 2, 2026: you buy 100 shares of BIRCHWOOD at $60, for $6,000.
- Monday, November 30, 2026: you buy 100 more at $45, for $4,500.
- Thursday, December 31, 2026: you sell the 100 shares bought in March at $44, for $4,400. That's a $1,600 loss.
The window for a December 31 sale runs from December 1, 2026 through January 30, 2027, both days included. November 30 is outside it, so as long as no account of yours or your spouse's buys BIRCHWOOD in that window, the whole $1,600 loss stays on your 2026 return, and the November shares keep their $4,500 basis. Had the second purchase been on Tuesday, December 1 instead, it would be inside the window: all $1,600 disallowed, and those shares' basis $4,500 + $1,600 = $6,100. With this account's trades imported, the checker gives the same answers for both dates.
3. Buy something that isn't substantially identical
Pub 550 says: "Ordinarily, stocks or securities of one corporation are not considered substantially identical to stocks or securities of another corporation." The same paragraph warns that "they may be substantially identical in some cases", for example "in a reorganization", and that you "must consider all the facts and circumstances in your particular case." Two funds on the same index are a gray zone: we found no IRS ruling on such a pair, and Pub 550 names no fund pairs. A fund on a meaningfully different index is a commonly used lower-risk choice but not an exemption. Where the line is covers both, with the bond and preferred-stock cases. For common fund pairs such as VOO and IVV or VTI and VTSAX, the fund pair pages set out each fund's issuer and index from the issuer's own page. Review a fund pair with a CPA or EA before you rely on it.
What doesn't avoid a wash sale
- Buying back at another broker, or in another account. §1091 looks at what "the taxpayer has acquired", with no word about accounts. A broker has to report a wash sale only "if both the sale and purchase transactions occur in the same account" (Form 1099-B instructions, 2026), so the other purchase may not show on your 1099-B, but Pub 550 says "you cannot deduct a loss from a wash sale even if it is not reported on Form 1099-B" (the cross-account trap).
- Buying back in your IRA or Roth IRA. It is on Pub 550's list, and it is worse than an ordinary wash sale: Rev. Rul. 2008-5 says the IRA's basis "is not increased by virtue of § 1091(d)", which we read as permanent (the IRA guide).
- Having your spouse buy it. Pub 550's spouse sentence covers it, and states no filing-status condition (the spouse guide).
- Buying a call option instead. §1091(a) reaches a taxpayer who "has entered into a contract or option so to acquire" substantially identical stock.
- Letting scheduled buys or dividend reinvestment run. A scheduled buy is a purchase. A reinvested dividend buys shares, and this site treats it as a purchase too, though no IRS text we found names reinvestment in the wash-sale rules; ask a CPA or EA if a large amount turns on it (dividend reinvestment and wash sales).
- A purchase in your 401(k) is unsettled: we found no IRS ruling on it (the 401(k) guide), so ask a CPA or EA before relying on one.
If it has already happened
An ordinary wash sale defers the loss rather than ending it. Pub 550 has you add the disallowed loss to the cost of the new shares and says: "This adjustment postpones the loss deduction until the disposition of the new stock or securities." You report it on the sale's row of Form 8949 with code W (how code W works). The exception is a purchase in your own IRA, covered above.
Check your accounts before you buy back
The free checker reads your brokers' CSV exports in your browser, with nothing uploaded. Import every account, yours and your spouse's, tag the IRAs, and it shows the wash sales it finds and the open windows with the first clean re-buy date. "Can I buy it?" tests a planned purchase against those files.
- It checks; it doesn't block trades. It can't pause an automatic buy or stop an order.
- It only knows what your files show. A vest, a 401(k) purchase or a reinvestment that isn't in a file isn't seen, and neither is an account you haven't imported.
- It compares the same ticker and options on it, so it doesn't judge whether two funds are substantially identical.
- It doesn't model Section 475 mark-to-market accounting. Its methodology lists the rest.
Not tax advice. Sources, read on 2026-11-12: IRS Publication 550 (2025, the current edition) · IRC §1091 · Treas. Reg. §1.1091-1 · Rev. Rul. 2008-5 · Form 1099-B instructions (2026). Confirm your own situation with a CPA or EA.
Frequently asked questions
How do I avoid a wash sale when I sell at a loss?
To avoid a wash sale under IRC §1091, don’t acquire the same stock, or anything substantially identical to it, in any of your accounts from 30 days before the loss sale through 30 days after it. In practice that means waiting until day 31 after the sale to buy back, buying the new shares first and selling the old ones more than 30 days later, or buying something that isn’t substantially identical. A purchase by your spouse or in your IRA counts too.
Can I buy the stock back right away in a different brokerage account?
No. IRC §1091 looks at what "the taxpayer has acquired", not at which account bought it, so a re-buy at another broker, or in your other account at the same firm, still washes the loss. Brokers have to report only washes inside one account, so it may not show on your 1099-B, but Pub 550 says "you cannot deduct a loss from a wash sale even if it is not reported on Form 1099-B."
Can I buy it back in my IRA, or have my spouse buy it?
Neither avoids a wash sale. IRS Publication 550 lists acquiring substantially identical stock "for your individual retirement arrangement (IRA) or Roth IRA" as a wash sale, and Rev. Rul. 2008-5 allows no basis increase for it, which we read as permanent. Pub 550 also says: "If you sell stock and your spouse or a corporation you control buys substantially identical stock, you also have a wash sale."
Can I sell one fund at a loss and buy a similar fund?
Sometimes, but there is no bright line for when two funds are substantially identical under the wash-sale rule. IRS Publication 550 says you "must consider all the facts and circumstances", and that stocks of one corporation are ordinarily not substantially identical to another’s. We found no IRS ruling on two funds that track the same index, such as two S&P 500 funds. A fund on a meaningfully different index is a commonly used lower-risk choice, but we found no ruling that covers that either, so review the pair with a CPA or EA.
Can I buy more shares first and sell my old shares later?
Buying more first avoids a wash sale only if the purchase is more than 30 days before the sale, because the wash-sale window looks back too. Treas. Reg. §1.1091-1 has an example of shares bought on December 15 and older shares sold at a loss on January 3: "no loss from the sale is allowable as a deduction." For a sale on December 31, 2026, the purchase has to be on or before November 30, 2026, and the sale has to be of the older shares.
Does buying a call option instead avoid the wash sale?
No. IRC §1091(a) covers a taxpayer who "has entered into a contract or option so to acquire" substantially identical stock, and Pub 550 lists "Acquire a contract or option to buy substantially identical stock or securities." A call bought within 30 days before or after the loss sale can wash the loss. IRC §1091(b) compares the stock "covered by the contract or option to acquire" with the stock sold, and leaves which shares are washed to the regulations.