stocktax.tools
HomeGuides › The wash-sale rule

The wash-sale rule

The wash-sale rule stops you from claiming a tax loss while effectively keeping the same position. Sell at a loss and rebuy too soon, and the loss is disallowed — but it is not lost forever.

Put real numbers on this: Capital Gains Tax Calculator
Open the calculator →

What the wash-sale rule is

A wash sale happens when you sell a security at a loss and buy the same or a substantially identical security within 30 days before or after the sale — a 61-day window in total. When that happens, the IRS disallows the loss for that year, so you cannot use it to offset gains or income right away.

The 30-day window (both directions)

A common misunderstanding is that the rule only looks forward. It looks both ways: 30 days before and 30 days after the loss sale. Buying replacement shares shortly before you sell the losing lot can trigger it just as easily as buying back afterward. The window counts calendar days, not trading days.

The loss is deferred, not destroyed

A disallowed loss is not gone. It is added to the cost basis of the replacement shares and the holding period carries over. So you get the benefit later — when you eventually sell the replacement shares without a wash sale, the higher basis produces a smaller gain or larger loss. The rule changes the timing, not the total.

What counts as substantially identical

The same stock is obviously identical. Options and contracts to buy the same stock count too. Two different companies do not. A common harvesting technique is to sell one fund at a loss and buy a different fund tracking a similar but not identical index — enough to stay invested without being substantially identical. This is a judgment area; when in doubt, wait out the 31 days.

Harvesting losses safely

To claim a loss cleanly: sell the losing position and either stay in cash for 31 days, or buy a genuinely different security to keep market exposure. Also avoid triggering it in a spouse's account or your IRA, which the rule also covers. Done carefully, tax-loss harvesting lets you bank losses to offset gains while keeping your overall allocation.

Does it apply to crypto?

As of 2026, the wash-sale rule as written applies to "stock or securities," and many argue it does not cover cryptocurrency, which is treated as property. Proposals to extend it to crypto have circulated for years. Because the rules can change, confirm current law before relying on crypto loss harvesting.

Frequently asked questions

What is the wash-sale rule?

If you sell a security at a loss and buy the same or a substantially identical one within 30 days before or after, the loss is disallowed for that year and added to the basis of the replacement shares.

Is the wash-sale window 30 or 60 days?

It is 30 days before and 30 days after the loss sale — a 61-day window in total centered on the sale date, counting calendar days.

Do I lose the loss in a wash sale?

No. The disallowed loss is added to the cost basis of the replacement shares and the holding period carries over, so you get the benefit when you later sell without triggering the rule.

Does the wash-sale rule apply to crypto?

As written it applies to stock and securities, and crypto is treated as property, so many take the position it does not apply — but the law could change, so confirm current rules.

Sources & methodology

Based on standard U.S. treatment of wash sales. References: IRS Publication 550, Topic No. 409. Tax year 2026. Last updated 2026-07.

⚠️ Educational content only — not tax advice. Your actual tax depends on your full situation and current law. Confirm with a qualified professional before acting.