AlphaTeak
Get the app

What is the wash sale rule and how does it affect value investors?

AlphaTeak Research Team··6 min read
The wash sale rule prevents US investors from claiming a tax loss if they buy the same or substantially identical security within 30 days before or after the sale. The disallowed loss is added to the replacement shares' cost basis, deferring rather than eliminating the deduction.
Diagram explaining the IRS wash sale rule 30 day window for US stock investors

The wash sale rule is one of the most misunderstood parts of US tax law, especially for value investors who deliberately sell a stock and plan to buy it back later at a better price. Here is how it works, why it exists, and how to stay within the rules without abandoning your value discipline.

Here are the key points to remember:

  1. The wash sale rule applies when you sell a security at a loss and buy a "substantially identical" security within 30 days before or after the sale.
  2. The 30-day window is not just after the sale. It also covers purchases made in the 30 days before the sale. That means a loss can be disallowed even if you bought first and sold later.
  3. The disallowed loss is not lost forever. It is added to the cost basis of the replacement shares, so you may get the benefit when you eventually sell those shares.
  4. The rule applies to stocks, bonds, mutual funds, ETFs, and options, but not to most ordinary income assets.
  5. If the wash sale happens inside a traditional IRA or Roth IRA, the loss is permanently disallowed, because you cannot add the loss to the basis of the replacement shares.
  6. Value investors are especially prone to wash sales because they often sell a stock that has fallen below intrinsic value, expecting to repurchase it once the short-term noise passes.

What is the wash sale rule?

The wash sale rule is an IRS rule that denies a tax deduction for a capital loss if you buy a substantially identical security within 30 days before or after the sale. The rule is meant to stop investors from selling a losing position to lock in a tax deduction while continuing to hold the same economic exposure.

The rule is found in Section 1091 of the Internal Revenue Code. It applies to both long-term and short-term capital losses. When a wash sale occurs, the loss is disallowed for that tax year and is instead added to the cost basis of the replacement shares. This preserves your ability to claim the loss later, but only when you sell the replacement shares.

How the 30-day window works

The window is a 61-day period. It includes:

  • The day of the sale (day 0)
  • The 30 days before the sale
  • The 30 days after the sale

So if you sell shares on March 15 at a loss, the rule looks back to any purchase of substantially identical shares from February 13 through April 14. Even if you bought the replacement shares before the sale, the loss on the sale may be disallowed.

The most precise way to understand the timing is to identify the date of the sale and then look at all purchases within that 61-day range. If any purchase matches, the loss is disallowed to the extent of the number of shares purchased.

What counts as a "substantially identical" security?

"Substantially identical" is not precisely defined in the tax code, but the IRS and courts have offered guidance. For stocks, the rule generally applies to shares of the same company in the same type of entity. For example, common stock of Apple is substantially identical to other common stock of Apple, but not to Apple preferred stock or Apple bonds.

For funds and ETFs, the rule is tricky. Two index funds that track the same index may be considered substantially identical if they have the same manager, same investment objective, and nearly identical holdings. The IRS has not given a bright-line test, so investors should be conservative. To avoid unintentional wash sales, use a different fund that tracks a materially different index, or wait 31 days before buying.

The rule also applies to options and contracts to acquire substantially identical securities. Selling a stock at a loss and buying a call option to repurchase it can trigger the rule.

How value investors trigger wash sales

Value investing often involves buying stocks that are out of favor. A common value strategy is to sell a stock that has declined in price, take the tax loss, and then repurchase the same stock after 31 days to maintain your position. That is perfectly legal, but it requires careful timing.

The danger is when you sell a losing position and buy back the same stock too quickly. For example, if you sell a stock on December 20 to realize a loss for the tax year and then repurchase it on January 5 because the price looks attractive, that purchase is within the 30-day window, so the loss is disallowed. The disallowed loss gets added to the cost basis of the January 5 purchase, but the benefit is deferred until you sell those new shares.

Another typical value scenario: you own a stock that has fallen below your estimate of intrinsic value. You decide to sell it to reallocate capital, but then a week later you see an even better margin of safety and want to buy it back. The wash sale rule will not let you claim the loss on the original sale.

The rule also matters when you sell a losing position in one account and buy the same stock in another account, including your spouse's account, an IRA, or a 401(k). The IRS treats those purchases as if they were made in your own account for wash sale purposes.

Wash sales in IRAs and 401(k)s

If a wash sale occurs inside a traditional IRA or Roth IRA, the consequences are much harsher. Because the IRA is tax-advantaged, there is no cost basis to adjust for the replacement shares. The loss is permanently disallowed, and you cannot use it to reduce taxable income anywhere.

For example, if you sell a stock at a loss in your taxable brokerage account and buy the same stock in your Roth IRA within 30 days, the loss in your taxable account is disallowed, and the cost basis of the Roth IRA shares is not increased. The tax benefit is gone forever.

The same logic applies to 401(k) plans and other employer retirement plans, although most plans do not allow frequent trading of individual stocks.

To avoid this, never repurchase a security you sold at a loss in a taxable account within 30 days in a retirement account. If you want to keep exposure, consider a separate but not substantially identical fund during the waiting period.

How to manage wash sales without abandoning value discipline

The wash sale rule does not prevent you from being a value investor. It only requires you to be deliberate about timing and to keep clear records. Here are some practical approaches:

  • Wait 31 days before repurchasing the same stock. This is the simplest way to keep the tax loss and your position.
  • Sell the losing stock and immediately buy a similar but not substantially identical stock that still fits your value criteria. For example, swap one bank stock for another, or one energy stock for another, as long as they are not too similar in terms of management and holdings.
  • Use a different ETF or mutual fund if you are selling a fund at a loss. Pick one with a different index or a different provider to reduce the risk of a substantially identical determination.
  • Keep a wash sale log. Track every sale at a loss and the 61-day window around it. This will help you avoid accidental violations and also help you calculate adjusted cost basis when a loss is disallowed.

Note that the wash sale rule applies only to losses. If you sell a position at a gain and buy it back the next day, the gain is fully taxable, but you do not face the wash sale rule. Some investors mistakenly think the rule applies to gains. It does not.

The bottom line

The wash sale rule is a tax rule that defers or denies capital loss deductions when you repurchase a substantially identical security within 30 days. For value investors, it is a practical constraint on the urge to buy back a fallen stock too soon. Understanding the 61-day window and the substantially identical test lets you manage your tax loss harvesting and your value strategy together. This guide is for educational purposes only and is not personalized financial advice.

See what a company is really worth.

AlphaTeak scores any stock across eight pillars, estimates fair value, and keeps an honest, public track record. Analysis and education, not advice.

Get AlphaTeak
Keep reading