Lesson 4 of 6
The wash sale rule
Sell at a loss and buy back within the window and the loss is disallowed for now. It is not destroyed: it moves into the basis of the replacement.
By Javier Sanz
Founder of ValueScreener. Built Ninety Nine, a securities services provider, and sold it to a tier-one global bank; ran operations and internationalization at Alpaca, the brokerage API.
Who writes thisEditorial processLinkedIn (opens in a new tab)X (opens in a new tab)
In one minute
- A wash sale is selling at a loss and acquiring the same or a substantially identical holding within a window around the sale.
- The loss is disallowed for that year. It is not lost: it is added to the basis of the replacement holding.
- The window runs both before and after the sale, which is the part most descriptions leave out.
An investor sells at a loss, then buys the same company back a week later because nothing about the reasoning changed. That is an ordinary thing to do, and US rules treat the loss differently from one taken and left alone.
What happens to a 2,000 loss inside the window
- 1Sell at a loss of 2,000Realised, and inside the window
- 2Buy the same company backWithin the window around the sale
- 3The 2,000 loss is disallowed this yearIt cannot offset other gains now
- 4The 2,000 is added to the new basisRecovered when the replacement is eventually sold
What triggers it
Three conditions together. A sale. At a loss. And an acquisition of the same or a substantially identical holding within the window around that sale.
A sale at a gain never triggers it. The rule exists to stop a loss being claimed by an investor who never actually gave up the position, so a gain is outside its purpose entirely.
The window runs both ways
This is the detail most summaries drop. The window covers a period before the sale as well as after it. Buying more shares and then selling an older lot at a loss shortly afterwards can trigger the rule just as buying back does, and it catches people who thought they were safe because they did not repurchase.
The loss is deferred, not destroyed
This is the part that gets misreported as a penalty. A disallowed loss is added to the basis of the replacement holding, which raises that basis, which reduces the gain or increases the loss when the replacement is eventually sold.
So the economic effect is timing rather than confiscation. The relief moves to a later year. It is still real, and an investor who does not know the mechanic will both misread their own records and be surprised when a later sale produces a smaller gain than they expected.
Substantially identical is not defined by a formula
Buying the same company's ordinary shares back is clearly caught. Two different companies in the same industry clearly are not. Between those, the phrase does real work and its application to options, to funds tracking the same index, and to related securities is a question of current rules and interpretation.
This lesson does not draw that line, deliberately. Anyone close to it needs a qualified adviser and the current rules, not a paragraph from an academy.
Why it matters even to someone who never trades
Two reasons. A broker's reported figures already have wash sale adjustments in them, so a year's reported gain can differ from what a plain arithmetic of sales minus purchases would give, and knowing why stops that being alarming.
And the disallowed loss sits inside the basis of a holding that is still owned. An investor reading their own position's cost has a number that is not simply what they paid, which is exactly the point of the previous lesson.
Check yourself
You sell at a loss and buy the same company back a week later. What happens to the loss?
- It is permanently lost
- It is disallowed this year and added to the basis of the replacement
- Nothing, because you still hold a position
Show the answer
Answer: B.
The rule defers the loss rather than removing it. Raising the replacement's basis means the relief arrives when that replacement is eventually sold.Which of these can trigger the rule?
- Selling at a gain and buying back immediately
- Buying more shares and then selling an older lot at a loss days later
- Holding through a decline without selling
Show the answer
Answer: B.
The window runs before the sale as well as after it, so a purchase that precedes a loss-making sale can be caught. A gain is outside the rule, and an unrealised loss is not a sale at all.Why can a broker's reported annual gain differ from sales minus purchases?
- Because brokers use a different calendar
- Because wash sale adjustments have already been applied to the reported figures
- Because commissions are excluded
Show the answer
Answer: B.
Disallowed losses are moved into the basis of replacement holdings before the figures are reported, so the reported gain reflects those adjustments rather than raw arithmetic.Sources
- IRS Publication 550, Investment Income and Expenses: the wash sale rule, the substantially identical test, and the addition of a disallowed loss to the basis of the replacement.
What this leaves out
- This is not tax advice. It describes general US mechanics. Rules differ by country, by state, by account type and by individual circumstance, and they change.
- The length of the window and the treatment of options, funds and related securities are deliberately not stated, because a specific number or boundary that later changes would be worse than none. Confirm the current rules, or ask a qualified adviser.
- Every figure in this lesson is illustrative. None is drawn from a filing and none is any reader's position.
- The rule's application to accounts held elsewhere, including retirement accounts, is a further question this course does not enter.
- Nothing here is advice about any security.