The Wash Sale Rule The Invisible Tax Trap Every Trader Must Know

Akbar Shah portrait

Akbar Shah

Contributor, StockEducation.com · Editorial Standards

Reviewed by: Manny Farr, B. Comm (UNSW) · Editorial Standards Edited by: Felix La Spina, SEO Lead

Published:  Last updated: 

This article is educational and does not constitute personalized financial advice. Verify all figures against primary sources before making decisions. Read our editorial standards. See how we fact-check.

The Wash Sale Rule The Invisible Tax Trap Every Trader Must Know

You sell a stock at a loss to claim a tax break, then buy it back a week later because you still like it. Without realising it, you may have just thrown the loss away. The wash sale rule is a US tax rule that quietly disallows losses when you rebuy too soon, and it is far easier to trigger than most traders think. This guide explains how it works and how to avoid it, drawing on IRS Publication 550.

What the Wash Sale Rule Is

The wash sale rule is a United States tax rule, set out in Internal Revenue Code Section 1091 and explained in IRS Publication 550, that disallows a tax loss if you sell a security at a loss and buy the same, or a substantially identical, security within 30 days before or after the sale. Because the window runs both ways, the danger zone is 61 days in total. It exists to stop investors from selling purely to book a tax loss while effectively staying in the same position.

It earns the word invisible because it is so easy to trigger by accident. An automatic dividend reinvestment, a purchase in a different account, a buy in your IRA, or even a purchase by your spouse can all spring it without you noticing. The encouraging news, explained below, is that in a normal taxable account the loss is usually only deferred, not destroyed. The serious exception is an IRA. The sections below cover how a wash sale is triggered, what happens to the loss, why it is so easy to fall into, and how to avoid it. This is a US rule and not tax advice. Our dividend reinvestment calculator shows what reinvesting does over a longer period.

How a Wash Sale Is Triggered

The sequence that creates a wash sale is short, and the steps below set it out. You sell a security at a loss, then within 30 days before or after that sale you buy the same or a substantially identical security. The IRS disallows the loss for the current year, and the disallowed loss is added to the cost basis of the replacement. The trigger is the repurchase inside the window, whether or not you meant to create it. Our average price calculator works out your cost base across multiple purchases.

How a wash sale is triggered 61 day rule infographic

Disallowed, but Usually Not Lost

What happens to the loss depends entirely on where you rebuy, and the comparison below sets out the two cases. In a taxable account, the loss is disallowed this year but added to the replacement’s basis, the holding period carries over, and you get the benefit later. In an IRA or Roth, the loss is disallowed this year, the basis cannot be adjusted, the loss is permanent, and you never get it back. The same mistake is recoverable in one place and ruinous in the other.

Why It Is an Invisible Trap

The rule catches people because its triggers are so easy to miss, and the panel below lists them. Dividend reinvestment can rebuy automatically, buying in another account counts, an IRA or Roth purchase counts, a purchase by your spouse counts, and the 30 day window crosses the calendar year. Any of these can create a wash sale you never intended.

Why the wash sale rule is an invisible tax trap infographic

What Counts as Substantially Identical

A lot of the rule turns on the phrase substantially identical, and the panel below clarifies it. The same stock obviously counts, options or contracts to buy it count, and two funds tracking the same index may count. The shares of a different company generally do not, which is why a fund tracking a different index is the common workaround. The test depends on the facts, so close calls deserve professional advice.

What counts as substantially identical under the wash sale rule infographic

How to Avoid the Trap

Staying clear of the wash sale rule comes down to a few habits, and the comparison below sets out the right and wrong ones. The sound habits are to track every loss sale date, wait at least 31 days to rebuy, watch your IRA and spouse accounts, and use a different index fund if you want to stay invested. The habits to avoid are rebuying within 30 days, forgetting dividend reinvestment, rebuying in your IRA, and assuming the broker tracks it all. The difference is whether your loss counts or quietly disappears.

Common Mistakes People Make

These four mistakes are how traders lose the tax loss they were counting on.

Rebuying within 30 days

Why it backfires: Selling at a loss and buying the same stock back within 30 days triggers the rule and disallows the loss this year.

Do this instead: Wait at least 31 days before rebuying the same security, or the loss you were counting on will be disallowed for the current year.

Forgetting dividend reinvestment

Why it backfires: Automatic dividend reinvestment can quietly rebuy the same security within the window and trigger a wash sale.

Do this instead: Pause dividend reinvestment around a loss sale, since an automatic repurchase counts as acquiring a substantially identical security.

Rebuying in an IRA

Why it backfires: Buying the security back in an IRA or Roth IRA does not just defer the loss, it destroys it.

Do this instead: Never rebuy a loss security in your IRA within the window, since the disallowed loss cannot be added to IRA basis and is lost forever.

Assuming your broker tracks everything

Why it backfires: Relying on your broker to flag every wash sale ignores that they only report within one account and one security identifier.

Do this instead: Track loss sales across all your accounts yourself, including a spouse’s, since the rule applies across accounts but broker reporting does not.

The Honest Bottom Line

The honest reality is that the wash sale rule is one of the most easily triggered traps in investing, which is exactly why every trader should know it. It is a US tax rule that disallows your loss if you buy the same or a substantially identical security within 30 days before or after selling at a loss, a 61 day window in total. It earns the word invisible because dividend reinvestments, purchases in other accounts, IRA buys and even a spouse’s trades can all spring it without you noticing.

The saving grace is that, in a taxable account, the disallowed loss is usually only deferred, added to the basis of your replacement shares with the holding period carried over, so you get the benefit later. The unforgiving exception is an IRA, where the loss simply vanishes. So track your loss sales across every account, wait at least 31 days before rebuying, pause dividend reinvestment, and if you want to stay invested, move to a fund that is not substantially identical. This is the US system; other countries differ, and none of this is tax advice. For your own situation, talk to a tax professional. This article is educational information, not tax or financial advice.

The simplest way to stay clear of the wash sale rule is to wait 31 days, or change the horse. If you sell a stock at a loss and genuinely want that loss to count this year, do not buy the same or a substantially identical security for at least 31 days around the sale, in any of your accounts. If you would rather stay invested, switch to something that is not substantially identical, such as a fund tracking a different index, which is exactly how disciplined investors harvest losses without tripping the rule. Watch for the quiet triggers, dividend reinvestment, an IRA purchase, a spouse’s trade, and remember the loss is only deferred in a taxable account but destroyed in an IRA. It is a US rule, it is not tax advice, and for anything close, a tax professional is worth far more than the loss you are trying to save.

Frequently asked questions

What is the wash sale rule?

The wash sale rule is a US tax rule that disallows a loss on your current tax return if you sell a security at a loss and buy the same or a substantially identical security within 30 days before or after the sale. Because the window runs both directions, the full danger period is 61 days. It is set out in IRS Publication 550.

What happens to the disallowed loss?

In most cases it is not lost, only deferred. The disallowed loss is added to the cost basis of the replacement security, and the original holding period carries over, so you typically receive the benefit when you eventually sell the replacement. The important exception is a purchase in an IRA, where the loss is lost permanently.

Why is it called an invisible trap?

Because it is so easy to trigger without realising. An automatic dividend reinvestment, a purchase in another of your accounts, a buy in your IRA, or even a purchase by your spouse can all create a wash sale. Brokers generally only flag wash sales for the same security within the same account, so cross account triggers can go unnoticed.

Does the wash sale rule apply to my IRA?

Yes, and it is harsher there. If you sell at a loss and buy a substantially identical security in your IRA or Roth IRA within the window, the loss is disallowed and, because IRA basis cannot be adjusted, it is permanently lost. You also cannot avoid the rule by selling in a taxable account and rebuying in a tax advantaged account.

What counts as substantially identical?

It depends on the facts. The same stock clearly counts, as do options or contracts to buy it. Two funds tracking the same index may be treated as substantially identical, while the shares of a different company generally are not. This is why investors harvesting losses often replace a fund with a different one tracking a different index.

How do I avoid a wash sale?

Track the date of every loss sale, and avoid buying the same or a substantially identical security for at least 31 days before and after. Watch your IRA and your spouse’s accounts as part of the same picture, pause dividend reinvestment around the sale, and consider a different index fund if you want to stay invested. For close calls, ask a tax professional.

Sources

All claims in this article are supported by the sources listed below. Verify details against the originals before making investment decisions.

  1. Internal Revenue Service. Publication 550, Investment Income and Expenses. Accessed 10 June 2026.
  2. Charles Schwab. Wash Sale Rule: How It Works and What to Know. Accessed 10 June 2026.

Before you act on this

This article explains how something works. It is general education, not advice about your situation. It does not consider your goals, income, tax position or how much risk you can afford.

Investing involves risk, including losing money. Before you act, speak to a licensed professional. You can check whether someone is licensed at Investor.gov and FINRA BrokerCheck.

Options Flow Reading The Big Bets Of The Smart Money

Capital Gains Tax Short Term Vs Long Term And Why It Matters

Sector Rotation How To Follow The Money Flow

The Wheel Strategy Explained

You might also like

AI Robot

Ask Our AI Stock
Learning Assistant

Get instant educational answers about
stocks, investing, and StockEducation.com.

Instant Answers Built With Learners

Educational support only. Not personal financial advice. AI responses may contain errors.

Powered by AI ●

The Ultimate Investing Starter Guide

Free Stock Market
Investing Guide

A beginner friendly guide that covers the essential lessons and concepts every new investor should understand.

Subscription Form

Inside You'll Learn

Stocks & How They Work
Valuation Basics
Compound Interest
Index Funds & Diversification
Warren Buffett Principles
AI Stock Research & More
20+ Pages
of Value
Instant
Download
100% Free
No Strings