Skip to content

Wash Sale Rule

The wash sale rule disallows a loss on the sale of stock or securities if you acquire substantially identical holdings within 30 days before or after the sale. It does not destroy the loss in most cases: it moves the amount into the basis of the replacement shares, so the deduction is postponed rather than forfeited.

Last reviewed by Steven Fox, CFP®, EA on

Quick Summary

  • The window is 61 days, not 30. Section 1091(a) reaches purchases in the 30 days before the sale as well as the 30 days after, plus the day of the sale itself.
  • A disallowed loss is added to the basis of the replacement shares and the disallowed holding period is added to theirs, so the tax benefit surfaces when those shares are eventually sold.
  • The exception is a replacement purchase inside an IRA or Roth IRA. There the loss is disallowed and no basis increase is available, so it is permanently gone.
  • "Substantially identical" is not defined anywhere in the statute or the regulations, and no bright-line percentage test exists.
  • The rule reaches a contract or option to acquire the shares, and purchases in accounts other than the one that made the sale, including a spouse's.

Definition

The wash sale rule is the loss-disallowance provision at section 1091 of the Internal Revenue Code, headed "Loss from wash sales of stock or securities." Its operative sentence is precise about timing: no deduction is allowed for a loss where, "within a period beginning 30 days before the date of such sale or disposition and ending 30 days after such date," the taxpayer has acquired, or entered into a contract or option to acquire, substantially identical stock or securities. Counting the day of the sale, that is a 61-day window, and half of it sits in the past.

The rule exists to stop a purely paper loss. Selling a holding and immediately buying it back leaves the investor in the same economic position while producing a deduction, so the code declines to recognize the loss. What it does instead is the part most explanations skip, and it is the difference between a lost deduction and a delayed one.

Advanced Explanation

A wash sale defers the loss; it does not usually destroy it. Section 1091(d) sets the basis of the replacement shares as the basis of the shares that were sold, adjusted "by the difference, if any, between the price at which the property was acquired and the price at which such substantially identical stock or securities were sold." In plain terms the disallowed loss is added to what you paid for the replacement, so the same economic loss is still sitting there waiting to be recognized on a later sale. Section 1223(3) adds the holding period of the sold shares to the replacement's, so a long-term position does not restart its clock. This is why the rule is better understood as a basis and timing rule than as a penalty.

The one case where the loss really is gone. If the replacement purchase is made by your IRA or Roth IRA, Revenue Ruling 2008-5 holds that the loss is disallowed under section 1091 and, in the ruling's own words, the individual's "basis in the individual retirement account or Roth IRA is not increased by virtue of section 1091(d)." A retirement account has no taxable basis capable of carrying the amount forward, so there is nothing for the deferred deduction to attach to. That makes an IRA repurchase the most expensive version of the mistake and the one worth checking automatic contributions against.

"Substantially identical" is genuinely undefined, and pretending otherwise is worse than admitting it. Neither the statute nor the regulations quantify the phrase, and there is no safe-harbor percentage of overlapping holdings. What can be said with confidence is at the ends of the range: the same security bought back is plainly caught, and two funds tracking genuinely different indexes are generally treated as different securities in ordinary practice. Bonds of the same issuer with materially different maturities or coupons, and preferred stock convertible into common, sit in territory where the answer depends on facts. Two index funds tracking the same index is exactly the case people most want a clean answer to and where the least authority exists.

The four ways it is triggered by accident. First, automatic dividend reinvestment: a reinvested distribution in the 30 days around a loss sale is a purchase like any other, and it will typically disallow only the portion of the loss matched by those shares rather than all of it. Second, the 30 days before the sale, which is the half most people forget. Buying more of a falling position and then selling the original lot can create a wash sale running backwards. Third, purchases in a different account, including a retirement account or a spouse's account, since the rule looks at the taxpayer rather than at the brokerage statement. Fourth, an automatic contribution or a model-portfolio rebalance executed by an advisory platform on a schedule nobody is watching.

Scope, and two boundaries worth stating. Section 1091(a) applies to "stock or securities," and subsection (e) extends the rule to certain short sales. It has never applied to a dealer's losses sustained in the ordinary course of that business. And the rule does not apply to gains at all: selling at a profit and immediately repurchasing is a fully taxable event with a fresh basis, which is what makes deliberate gain recognition possible in a way loss recognition is not.

How to Remember

Think 30 days on each side, so 61 days including the sale, and think basis rather than penalty. The loss is not confiscated, it is stapled to the replacement shares. The exception is buying it back inside an IRA, where there is nothing to staple it to.

Used in a Sentence

“Marisol turned off dividend reinvestment before selling her bond fund at a loss, because a single reinvested distribution inside the window would have triggered the wash sale rule on part of it.”

How It Works

A hypothetical example, with round numbers so the deferral is visible.

Marisol buys 100 shares of a fund for $6,000. A year later the position is worth $4,000 and she sells, expecting to report a $2,000 loss. Nine days after the sale she buys 100 shares of the same fund for $4,200, having decided she wants the exposure back.

Because the repurchase falls inside the 61-day window and the shares are identical, section 1091 disallows the $2,000 loss for the current year. Under section 1091(d) the basis of the new shares becomes their $4,200 cost plus the $2,000 disallowed loss, or $6,200, and under section 1223(3) they inherit the holding period of the shares she sold.

Three years later she sells the replacement shares for $7,000. Her gain is $7,000 less the $6,200 basis, or $800.

Now compare what would have happened with no wash sale, if she had waited 31 days to repurchase. She would have reported a $2,000 loss in the first year, taken a $4,200 basis in the new shares, and reported a $2,800 gain on the later sale. Netted across the two years that is $2,800 less $2,000, which is $800: the identical figure. The wash sale changed nothing about her total taxable result and everything about the year it landed in. That is the whole substance of the rule, and it is why the practical cost of tripping it is the timing rather than the money.

Change one fact and the outcome does change. If the repurchase had been made by her Roth IRA rather than her taxable account, the $2,000 would have been disallowed with no basis increase anywhere, and the deduction would simply have ceased to exist.

Pros and Cons

What is manageable about it

  • It is a timing rule, so tripping it in a taxable account usually postpones a deduction rather than destroying it, and the replacement shares keep the original holding period.
  • The trigger is mechanical and knowable in advance, unlike most tax traps: a calendar and a look at scheduled purchases is enough to avoid it.
  • Turning off automatic dividend reinvestment for the surrounding period, or buying a fund that tracks a different index, addresses the common cases without leaving the market.
  • It does not reach gains, so recognizing a gain and immediately repurchasing is unaffected.

Where it bites

  • The 30 days before the sale catch people who were averaging down and then decided to harvest the original lot.
  • Automatic dividend reinvestment and automatic contributions run without anyone's attention, and either can disallow part of a loss weeks after the decision was made.
  • A purchase in an IRA or Roth IRA disallows the loss with no basis increase available, so that version is permanent.
  • The rule follows the taxpayer rather than the account, so a spouse's purchase or a purchase in a different institution can trigger it, and no single brokerage statement will show it.
  • "Substantially identical" has no numerical test, so the most common real question, whether two funds tracking the same index are the same security, has no authoritative answer.

People Also Asked

Answers to the most frequently asked questions.

How long do I have to wait to buy back a security I sold at a loss?
More than 30 days after the sale, and you must also not have bought substantially identical shares in the 30 days before it. Counting the day of the sale, the whole window is 61 days. Waiting 31 days after the sale is the usual practical answer, but it only works if the earlier half of the window is also clear, and if no purchase happens in another account you control or in a spouse's account during the period.
Is the disallowed loss gone forever?
Usually not. Section 1091(d) adds the disallowed amount to the basis of the replacement shares, and section 1223(3) adds the old holding period to theirs, so the loss is recognized when those shares are eventually sold. The result across both years is the same total as if no wash sale had occurred; only the timing moved. The exception is a replacement purchase inside an IRA or Roth IRA, where Revenue Ruling 2008-5 holds that no basis increase is available and the loss is permanently lost.
What counts as a substantially identical security?
The statute uses the phrase and never defines it, and no regulation supplies a percentage test, so the honest answer is that the middle of the range is unsettled. Buying back the same stock or the same fund is clearly caught. Two funds tracking genuinely different indexes are generally treated as different securities in practice. Bonds of one issuer with different maturities or coupons, and a preferred share convertible into the common stock, are facts-and-circumstances questions. Two funds tracking the same index is the case with the most demand for a clean answer and the least authority behind one.
Does a purchase in my IRA trigger a wash sale on a taxable account loss?
Yes, and it is the worst version. Revenue Ruling 2008-5 addresses exactly this pattern, an individual selling shares at a loss in a taxable account while causing their IRA or Roth IRA to buy substantially identical shares within the window, and holds that the loss is disallowed under section 1091. Because a retirement account has no taxable basis to receive the amount, the ruling also states that the account's basis is not increased, so unlike an ordinary wash sale the deduction is not deferred. It is lost.
Can dividend reinvestment cause a wash sale?
Yes. A reinvested dividend is a purchase, so a distribution reinvested in the 30 days before or after a loss sale falls inside the window like any other buy. The usual effect is partial rather than total, disallowing the portion of the loss corresponding to the reinvested shares rather than the whole thing, which is why the amount reported can look arbitrary. Switching reinvestment off for the surrounding period is the simple preventive step, and it applies to automatic contribution plans for the same reason.

Have a question a definition can't answer?

Advice-only advisors answer questions like this for a transparent flat fee — no products, no commissions, no asset management.

Find an Advisor