Tax Planning & Retirement

The Wash Sale Rule Explained

Published 25 June 2026 · Reviewed & signed by a licensed professional
Wash sale rule explained - Tranzesta guide

You sold a losing stock to claim a tax deduction, then bought it back a week later — and now the IRS says your loss does not count. That is the wash sale rule in action, and it catches more investors than almost any other tax trap.

The wash sale rule disallows a tax loss if you buy a substantially identical security within 30 days before or after selling at a loss — a 61-day window total. The disallowed loss is not erased; it is added to the cost basis of the replacement security.

What is the wash sale rule?

The wash sale rule is an IRS provision that stops investors from claiming an artificial tax loss while staying invested in essentially the same position. Without it, you could sell a stock at a loss on December 31, deduct the loss, and rebuy it on January 2 — harvesting a tax benefit without ever truly exiting the investment.

To close that loophole, the IRS looks at a 61-day window around your sale. If you acquire a substantially identical security inside that window, the loss is disallowed for the current year. You can read the official guidance in IRS Publication 550.

The 61-day window explained

The window is wider than most people assume. It is not just the 30 days after you sell — it also includes the 30 days before. So a purchase you made weeks ago can trigger a wash sale on a later loss.

  • 30 days before the sale date
  • The day of the sale itself
  • 30 days after the sale date

That is 61 calendar days in total. If you repurchase a substantially identical security at any point inside it, the rule applies.

What counts as “substantially identical”?

This is the gray area. The IRS does not publish a checklist, so the term is judged on the facts. A few principles generally hold:

  • Buying back the same stock or bond is clearly substantially identical.
  • Options, warrants, and contracts to acquire the security can also count.
  • A stock and a bond of the same company are usually not substantially identical.
  • Two different companies in the same sector are generally not substantially identical — which is the basis for many tax-loss harvesting strategies.

Index funds and ETFs tracking the same index are a genuine gray zone. Swapping one S&P 500 fund for another that tracks the very same index is risky; swapping into a fund tracking a different index is the more conservative approach.

What happens to the disallowed loss?

Here is the part that surprises people: a wash sale does not destroy your loss. It defers it. The disallowed loss is added to the cost basis of the replacement security, so you recover the benefit later when you eventually sell that replacement (outside any new wash sale window).

The original holding period also carries over to the replacement security. If you held the first lot for eight months, that time counts toward the holding period of the new shares — which can affect whether a future gain is taxed at short-term or long-term rates.

Worked example

Step Action Tax effect
1 Buy 100 shares of XYZ at $50 ($5,000) Cost basis $5,000
2 Sell all 100 at $40 ($4,000) $1,000 loss realized
3 Rebuy 100 shares at $42 within 20 days Wash sale triggered — loss disallowed
4 Basis adjustment New basis = $4,200 + $1,000 = $5,200

The $1,000 loss is not gone — it lives on in the higher $5,200 basis. When you later sell those replacement shares (outside a wash window), the deferred loss reduces your gain or increases your loss at that time.

How to avoid an accidental wash sale

Most wash sales are unintentional. These habits keep you clear:

  • Wait 31 days before rebuying the same security after a loss sale.
  • Buy a similar-but-not-identical alternative — for example, a different fund tracking a different index — to stay invested.
  • Check all your accounts. A purchase in your spouse’s account or your IRA can trigger the rule across accounts.
  • Turn off automatic dividend reinvestment on a position you are harvesting, since a reinvested dividend can be a triggering purchase.
  • Mind the calendar at year-end, when the 61-day window can straddle two tax years.

These rules are central to harvesting losses correctly. Thoughtful tax planning lets you capture deductions without tripping the wash sale rule, and the IRS details the mechanics in the Topic No. 409 capital gains and losses guidance.

The IRA wash sale trap

One of the harshest versions of the rule involves IRAs. If you sell a security at a loss in your taxable account and buy the same security in your IRA within the window, the loss is disallowed — and unlike a normal wash sale, the basis is not added back to the IRA. The loss is permanently lost. Coordinate trades across all your accounts to avoid this.

Crypto and the wash sale rule

Cryptocurrency currently sits in a different position from stocks and securities, and the rules in this space have been the subject of ongoing legislative attention. Treatment can change, so confirm the current rules on IRS.gov and with a tax professional before relying on any crypto loss strategy. Do not assume yesterday’s treatment still applies.

Frequently asked questions about the wash sale rule

How long do I have to wait to avoid a wash sale?

Wait at least 31 days after the loss sale before repurchasing a substantially identical security. Because the wash sale rule also covers the 30 days before the sale, make sure no triggering purchase occurred in that prior window either. The full restricted period spans 61 days.

Does the wash sale rule apply across different accounts?

Yes. The IRS aggregates your activity, so a repurchase in your spouse’s account or your IRA can trigger a wash sale on a loss sold in your taxable account. Always review every account before harvesting a loss to avoid an unexpected disallowance.

Is my loss gone forever after a wash sale?

Usually no. In a standard wash sale, the disallowed loss is added to the cost basis of the replacement security, so you recover the benefit when you eventually sell it. The major exception is a repurchase inside an IRA, where the loss can be permanently lost.

Do ETFs trigger the wash sale rule?

They can. Two ETFs tracking the same index may be treated as substantially identical, which is risky. Swapping into an ETF that tracks a different index is the more conservative way to stay invested while harvesting a loss. The IRS judges this on the facts.

Does the wash sale rule apply to gains?

No. The wash sale rule only applies to losses. If you sell a security at a gain and rebuy it, there is no wash sale — you simply owe tax on the gain. The rule exists solely to prevent artificial loss deductions.

Book a free consultation

The wash sale rule is easy to break and expensive to ignore, especially across multiple accounts and at year-end. Tranzesta’s tax specialists help US and UK clients harvest losses correctly, track basis adjustments, and stay fully compliant with IRS rules. Book a free consultation to protect your deductions.

Disclaimer: This article is for general informational purposes only and does not constitute tax, legal, or accounting advice. Tax rules and figures change and depend on your situation and tax year. Always verify current IRS figures and consult a qualified tax professional before acting.

This article is general information, not personalised tax advice. Tax rules change and depend on your circumstances — speak to a qualified professional in the relevant jurisdiction before acting. Tranzesta serves clients across the US, UK & UAE.

Talk to a real, signing professional

AI precision, human accountability — across the US, UK & UAE.

Book a free consultation