The wash sale rule: when a loss does not count and what happens to it
The wash sale rule stops investors from claiming a tax loss while keeping the same investment. If you sell stock or securities at a loss and buy substantially identical ones within 30 days before or after the sale, the loss is disallowed for now. In a taxable account it is usually only postponed, but a repurchase in an IRA can destroy it for good. This article walks through the rule, the basis adjustment, partial and accidental wash sales, and practical ways to harvest losses without triggering it.
What the rule says
The rule is in section 1091 of the Internal Revenue Code. A loss on the sale of stock or securities is not deductible if, during a 61-day period that begins 30 days before the sale and ends 30 days after it, you acquire substantially identical stock or securities (26 U.S.C. § 1091 1954). The IRS lists four ways to trigger it: you buy substantially identical stock or securities, acquire them in a fully taxable trade, enter into a contract or option to acquire them, or acquire them for your IRA or Roth IRA (IRS, Schedule D instructions 2025). Purchases by your spouse or by a corporation you control count as your own (IRS Publication 550 2025).
The 30 days are calendar days, not trading days, and the window runs in both directions. Buying first and selling the old lot at a loss three weeks later is just as much a wash sale as selling first and buying back. The rule only covers losses. Selling at a gain and buying back immediately is allowed, which is the basis of tax-gain harvesting in the 0% bracket. Dealers in securities whose losses arise in the ordinary course of their business are exempt (26 U.S.C. § 1091 1954).
- the part of the loss that falls under the rule; it is added to the basis instead of being deducted
- the new shares also inherit the holding period of the shares sold
What happens to the disallowed loss
In a regular taxable account the loss is postponed, not forfeited. It is added to the cost basis of the replacement shares, so a later sale shows a smaller gain or a larger loss (IRS, Schedule D instructions 2025). The holding period of the old shares is added to that of the new ones, which can turn a later sale into a long-term transaction sooner (IRS Publication 550 2025).
The postponement matters most at year end. A loss sale on December 28 followed by a repurchase on January 5 is a wash sale, and the loss moves into whatever year the new shares are sold. If those shares are held until death, the step-up in basis erases the built-in loss along with the adjustment.
Partial wash sales and the IRA trap
If you buy back fewer shares than you sold, only the loss on the number of shares bought back is disallowed. Small purchases therefore cause small wash sales: a quarterly dividend reinvested into the fund you just sold at a loss disallows the loss on the few shares it buys, and the rest of the loss stays deductible (IRS Publication 550 2025).
Buying the same security in an IRA or Roth IRA within the window is the costly case. The loss is disallowed, but the basis adjustment does not apply to the IRA (IRS, Schedule D instructions 2025). The deduction is lost permanently, because there is no basis inside an IRA that could carry it. Automatic contributions to a retirement account that buy the same fund are an easy way to fall into this trap.
Shares sold at a $10 loss each. The IRA case gives neither a deduction nor a basis increase, so the loss is gone.
What counts as substantially identical
The law does not define the term, and the answer depends on the facts. Stock or securities of one corporation are generally not substantially identical to those of another, and bonds or preferred stock of a company are usually not substantially identical to its common stock (IRS Publication 550 2025). Shares of the same company and contracts or options to buy them clearly count (26 U.S.C. § 1091 1954).
Funds are the gray zone. Two ETFs that track the same index from different providers hold the same securities in nearly the same weights, and many advisers treat such a switch as risky. Switching to a fund that tracks a different index, for example from an S&P 500 fund to a total market fund or from one developed-markets index to another, changes the holdings enough that it is widely used. Whatever pair you choose, keep a record of why you consider the funds different.
| Replacement after a loss sale | Wash sale risk |
|---|---|
| The same stock, ETF or mutual fund within 30 days | Wash sale |
| Call options on the same stock within 30 days | Wash sale |
| The same fund bought in your IRA, Roth IRA or by your spouse | Wash sale |
| Another fund on the same index from a different provider | Unclear, often avoided |
| A fund on a different but similar index | Generally used as a replacement |
| Stock of a different company in the same industry | Generally not substantially identical |
Reporting and broker statements
Wash sales are reported on Form 8949 with code W in column (f) and the disallowed loss as a positive adjustment in column (g) (IRS, Schedule D instructions 2025). Brokers adjust the basis on Form 1099-B when the sale and the repurchase are the same security in the same account. They do not see purchases in your other accounts, your IRA or your spouse's account, so those wash sales are your job to find and report.
If you use several brokers, a robo-adviser that harvests losses automatically, or regular contributions to an IRA with overlapping funds, a simple rule helps: hold different funds for the same asset class in different accounts. Then a loss sale in one account cannot be matched by a routine purchase in another.
Staying invested without breaking the rule
- Swap to a similar fund: sell the loser and buy a fund on a different index at once; switch back after 31 days if you want.
- Wait 31 days: simple, but the money is out of the market for a month, which can cost more than the tax saving.
- Double up: buy a second lot of the same fund, wait 31 days, then sell the original lot by specific identification.
- Turn off dividend reinvestment: in the fund you plan to harvest, at least around the sale date.
- Check every account: IRA contributions, 401(k) purchases and your spouse's trades within the window all count.
Research on tax-loss harvesting shows why the rule matters. Chaudhuri et al. (2020) found that respecting the wash sale rule lowers the measured benefit of harvesting, but leaves it positive, because a similar replacement keeps the portfolio close to the original. Constantinides (1983) had shown much earlier that, in theory, losses should be realized as soon as they occur, which is exactly what the rule makes harder for investors who want to keep the same holding.
Common mistakes
- Counting trading days: the window is 30 calendar days before and after the sale.
- Buying first: a purchase in the 30 days before the loss sale counts too.
- Forgetting the IRA: a repurchase there makes the loss permanently nondeductible.
- Relying on the 1099-B: brokers only catch identical purchases in the same account.
- Assuming the rule applies to gains: it does not; gains are taxed whenever you sell.
This article explains general federal rules as of 2026 and is not tax advice. Whether two funds are substantially identical depends on the facts; check current IRS guidance or ask a tax professional.
Frequently asked questions
What is the wash sale rule in simple terms?
If you sell a stock or fund at a loss and buy the same or a substantially identical one within 30 days before or after the sale, you cannot deduct the loss now. It is added to the cost basis of the new shares instead.
Does the wash sale rule apply to my IRA?
Yes, in one direction. Buying the same security in your IRA or Roth IRA within 30 days of a loss sale in a taxable account makes it a wash sale, and the loss is lost permanently because the basis adjustment does not apply to the IRA.
Is it a wash sale if I buy back after 31 days?
No. The window is 30 calendar days before and after the sale, so a purchase on day 31 or later does not trigger the rule, as long as no other purchase falls inside the window.
Are two S&P 500 ETFs substantially identical?
The IRS has not said. Because they hold the same stocks in nearly the same weights, many investors avoid swapping between them and use a fund on a different index as the replacement instead.
Does the wash sale rule apply to gains?
No. It only disallows losses. You can sell at a gain and buy back immediately, for example to raise your cost basis while your long-term gains are taxed at 0%.
What happens to a wash sale loss at the end of the year?
It moves into the cost basis of the replacement shares and is deducted when those shares are sold, possibly years later. A December sale with a January repurchase within 30 days is still a wash sale.
Literature
- Chaudhuri, Shomesh E.; Burnham, Terence C.; Lo, Andrew W. (2020): An Empirical Evaluation of Tax-Loss-Harvesting Alpha. Financial Analysts Journal 76 (3), pp. 99–108. doi:10.1080/0015198X.2020.1760064
- Constantinides, George M. (1983): Capital Market Equilibrium with Personal Tax. Econometrica 51 (3). doi:10.2307/1912150
- Internal Revenue Service (2025): Instructions for Schedule D (Form 1040) (2025), Capital Gains and Losses. Internal Revenue Service; accessed November 10, 2026. Source
- Internal Revenue Service (2025): Publication 550 (2025), Investment Income and Expenses. Internal Revenue Service; accessed November 2, 2026. Source
- United States Congress (1954): United States Code, Title 26 (Internal Revenue Code), § 1091 Loss from wash sales of stock or securities. Legal Information Institute, Cornell Law School. Source
This article explains a method; it is not investment or tax advice. Worked examples are simplified and rounded. All terms in the glossary.