Skip to main content

The Wash-Sale Rule Explained: What Triggers It and How It Works

The wash-sale rule can disallow a loss you claimed if you buy a substantially identical security within 30 days. Here is what triggers it and how it works.

October 13, 2026AAdmin8 min read

Alpha Sentinel is a software platform, not a registered investment adviser. This article is educational, not investment advice. Full disclaimer at the end of this post.

It is the last week of December, and you are going through your holdings looking for positions that have lost value. You sell one, pleased to have a loss to report, and a few days later you buy it back because you still believe in the company. In many cases, that second purchase can turn the loss you thought you claimed into a loss the IRS does not allow for now. This is the wash-sale rule: a loss on a sale is disallowed if you acquire a substantially identical security within 30 days before or after the sale. Understanding how it works can save you an unpleasant surprise at tax time.

Key Takeaways

  • The wash-sale rule disallows a loss when you buy a substantially identical security within a 61-day window centered on the sale date.
  • The loss is generally not erased but deferred, because it is added to the cost basis of the replacement shares.
  • The window includes 30 days before the sale and 30 days after it, so a purchase made earlier can also trigger the rule.
  • The rule can reach across accounts, including accounts held by a spouse and retirement accounts.
  • Because the details are technical and your situation is specific, a qualified tax professional should confirm how the rule applies to you.

What the Rule Says

The wash-sale rule comes from the Internal Revenue Code, and the IRS explains it in its publication on investment income and expenses. The rule exists to stop a simple maneuver: selling a security to claim a tax loss while holding the same economic position by buying it right back. Without the rule, an investor could harvest a loss every year without ever changing what they own.

The rule applies when two things happen close together. You sell or trade a security at a loss, and you buy a substantially identical security within 30 days before or after the sale. The two periods plus the sale date make a 61-day window. If a replacement purchase falls inside that window, the loss on the sale is disallowed for the moment.

The rule applies only to losses. A sale at a gain is unaffected by it, and you cannot be penalized under the rule for selling something at a profit and buying it back.

What Counts as Substantially Identical

This is the part that causes the most confusion, because the IRS has not published a precise list. In general, a security is treated as substantially identical when it is, for practical purposes, the same investment. Shares of the same company are the clearest case. Options and contracts to acquire the same stock can also fall within the rule, as can some convertible instruments.

Where it becomes unclear is with similar but not identical holdings, such as two funds that track different indexes, or two funds from different companies that follow nearly the same index. Whether those are substantially identical depends on the facts, and tax professionals differ on where to draw the line. The cautious reading is to treat investments that are near-copies of each other as potentially covered. If a replacement purchase matters to your tax outcome, ask a professional before you rely on a reading of your own.

The rule also reaches purchases made through other accounts. If you sell at a loss in your taxable account and your spouse buys the same security in theirs, or you buy it in an individual retirement account, the IRS can treat that as a wash sale. The retirement account case is notable because the disallowed loss may not be recoverable at all, since it cannot be added to the basis of an account that is not taxed the same way.

How the Disallowed Loss Is Treated

A wash sale does not usually destroy the loss. It postpones it. The disallowed amount is generally added to the cost basis of the replacement shares, which raises the basis and so lowers the future gain, or increases the future loss, when you eventually sell those shares. The holding period of the original shares is also generally added to the holding period of the new ones.

An example in general terms: you buy shares for a certain amount, sell them for less, and buy the same shares again two weeks later. The loss on the first sale is disallowed, and it is added to the cost basis of the new purchase. When you finally sell the new shares outside any window, the larger basis reduces the taxable gain or enlarges the deductible loss. The tax benefit has moved to a later year instead of disappearing.

Partial purchases work proportionally. If you sell a block of shares at a loss and repurchase only part of that block inside the window, only the loss on the repurchased portion is disallowed. Your broker reports wash sales on Form 1099-B for the shares it can identify, but it generally tracks only the accounts it holds, so the responsibility for catching cross-account wash sales remains yours.

Common Ways Investors Trigger It Without Realizing

  • Automatic investing, such as a dividend reinvestment plan or a recurring purchase, that buys the same security during the window.
  • A spouse or another account purchasing the same security, or a retirement account purchase.
  • Selling part of a position at a loss while continuing to add to it on a schedule.
  • A purchase made in the 30 days before the sale, which many investors forget counts.

The dividend reinvestment case is the one that surprises people most, because the purchase is not a decision you made that week. If you are planning a loss sale, it is worth checking which automatic purchases are scheduled to occur near it.

An Illustrative Year-End Routine (Hypothetical)

This walk-through is an illustration of a routine, not a recommendation, and it names no securities and uses no figures.

Imagine a surgeon who reviews his taxable account in early December. On the first evening he lists each position that is below its purchase price. On the second he checks every account in the household, including his spouse's and his retirement accounts, for purchases of the same holdings in the last 30 days and for automatic purchases scheduled in the next 30. On the third he decides whether to sell anything at all, writing down the reason, since a tax loss is rarely a reason by itself to change what he owns. If he sells, he marks the date and sets a reminder for the 31st day afterward. He keeps the records in one place for his accountant. The routine is built to keep the rule from being a surprise, not to produce a particular result.

Frequently Asked Questions

What is the wash-sale rule?

It is a tax rule that disallows a loss on a sale if you buy a substantially identical security within 30 days before or after the sale. The disallowed loss is generally added to the cost basis of the replacement shares instead of being lost.

How long do I have to wait before buying the same stock back?

You generally need to wait more than 30 days after the sale, and you also need to have avoided purchases in the 30 days before it. Your tax professional can confirm the exact dates for your situation.

Does the wash-sale rule apply to my IRA?

It can. If you sell at a loss in a taxable account and buy the same security in an individual retirement account, the IRS can treat it as a wash sale, and the loss may not be recoverable through basis. Check before you make the purchase.

Does the wash-sale rule apply to gains?

No. The rule applies only to losses. If you sell at a profit and buy the same security back, the gain is taxable as usual and the rule has no effect on it.

How The Shield works

On weekdays from 4:00 AM to 8:00 PM ET, The Shield checks the stocks on your watchlist every few minutes, using prices delayed about 15 minutes. When one of them moves into downward momentum below its moving average, it emails you what changed and the price. Alerts are informational, not recommendations, and may be delayed or missed.

If your attention is pulled away from your holdings by a full day of work, The Shield from Alpha Sentinel is where to begin. We watch. We alert. You decide.

The ShieldYour watchlist, watched during market hoursStart your 7-day pass$29 today. Your subscription renews automatically at $249/month after the 7-day trial unless canceled before renewal. Cancel in account settings.

FULL DISCLAIMER: Alpha Sentinel is a software platform that provides informational tools, including market scans and position-monitoring outputs. Alpha Sentinel is not a registered investment adviser, broker-dealer, certified public accountant, financial planner, or law firm. Nothing on this page or produced by the platform constitutes investment, tax, legal, or accounting advice; an offer or solicitation to buy or sell any security; or a personalized recommendation of any kind. The platform is not a substitute for the services of qualified professionals, and nothing in this article should be read as a recommendation that any reader manage their portfolio without professional guidance. All investments involve risk, including the risk of total loss of principal. Tax treatment depends on the user's individual circumstances and applicable law; consult a qualified tax professional regarding any tax-related question. The output of any software filtering or monitoring rule is not a prediction of future market behavior, and no software tool can be relied upon to warn users in advance of losses or to prevent losses. Past performance, whether of any security, strategy, or software signal, does not guarantee future results. Alpha Sentinel does not publish or warrant any hit rate, win rate, or similar performance metric, and users should not infer any such metric from the platform's outputs.

Frameworks, examples, schedules, and references to user types in this article are illustrative only and are not representations of typical results. Notification delivery times and service availability depend on third-party systems and may be subject to delays, errors, or failures.

SharePost on X