Trading BasicsIntermediate

Wash Sale Rule

The wash sale rule is a US tax rule that blocks deducting a loss on a security if you buy the same or a substantially identical one within 30 days before or after the sale. The loss is not lost forever: it is added to the cost basis of the new shares.

Selling a losing position to cut your tax bill and buying it straight back sounds clever — and the US tax authority thought of it long ago. The wash sale rule stops you claiming a loss when you have not really changed your position. This entry explains the 61-day window, what counts as a repurchase, how the disallowed loss moves into your new cost basis, and how traders avoid tripping it. The rule is American; other countries have their own versions or none at all.

Category
Trading Basics
Reading time
5 min
Also called
Wash sale, Wash sales, 30-day rule
Updated

The wash sale rule in plain words

A wash sale happens when you sell stock or securities at a loss and, within 30 days before or after the sale, buy substantially identical stock or securities, or an option or contract to buy them.1

US tax rules do not allow you to deduct a loss from a wash sale.2

Instead, the disallowed loss is added to the cost basis of the new shares, so you recover it later when you sell them.1

How the wash sale rule works, step by step

  1. You sell at a loss

    A realised loss you would normally deduct. See Capital Gains Tax.

  2. Check the 61-day window

    30 days before the sale, the sale day and 30 days after.

  3. Look for a repurchase

    The same or a substantially identical security, or an option to buy it.

  4. Loss is disallowed

    You cannot deduct it this year.

  5. Basis is adjusted

    The disallowed loss is added to the new shares' cost. See Cost Basis.

  6. Holding period carries over

    The new shares inherit the old shares' holding period.

Worked examples

Example 1 — A classic wash sale

Loss deferred, not lost

You buy 100 shares for $1,000, sell them for $750, and buy 100 again within 30 days for $800.

Example 1 — A classic wash sale — calculation
Loss on the sale$1,000 − $750 = $250
Deductible now$0 (disallowed)
New cost basis$800 + $250 = $1,050

The disallowed loss is added to the cost of the new stock, raising its basis.1

Example 2 — Recovering the loss later

$50 taxable gain

Continuing Example 1, you later sell the new shares for $1,100.

Example 2 — Recovering the loss later — calculation
Sale price$1,100
Adjusted basis$1,050
Taxable gain$1,100 − $1,050 = $50

Without the adjustment the gain would have been $300; the higher basis is how the earlier loss eventually counts.1

Example 3 — Waiting out the window

Loss allowed

You sell at a $400 loss on 1 March and buy the same stock again on 5 April — 35 days later.

Example 3 — Waiting out the window — calculation
Days after the sale35 (more than 30)
Loss deductible$400

Only purchases within 30 days before or after the sale create a wash sale.1 The cost is being out of the stock for a month.

What triggers a wash sale (US)

AspectTriggers itDoes not
Same stock within 30 daysYes—
Call option on the same stockYes—
Purchase in your IRAYes—
Commodity futures or currencies—Not covered

Where the rule matters

  • Tax-loss harvesting

    Selling losers for tax without breaking the rule. See Tax-Loss Harvesting.

  • Active trading

    Frequent in-and-out trades in one stock can defer many losses. See Day Trading.

  • Dividend reinvestment

    An automatic reinvestment within 30 days can count as a repurchase.

  • Year-end planning

    December losses with January buybacks still fall inside the window.

Advantages and disadvantages

Advantages

  • Losses are deferred, not destroyed.
  • Holding period carries over to the new shares.
  • Clear 30-day window is easy to track.

Disadvantages

  • Easy to trigger by accident with reinvestments or other accounts.
  • "Substantially identical" is not precisely defined.
  • A repurchase in an IRA can make the loss permanently unusable.

Going deeper

Read as far as you need. Each level builds on the one before it.

The 61-day window

Beginner

The window runs from 30 days before the sale to 30 days after, so buying first and selling the older lot at a loss also counts.1

Other accounts and people

Intermediate

A wash sale also arises if you buy the shares in a traditional or Roth IRA, and a purchase by your spouse or a corporation you control can count too.1 Brokers only track wash sales within one account, so the investor has to watch the rest.

What it does not cover

Advanced

The rules cover stock, securities and options or contracts to buy them, but not commodity futures or foreign currencies.1 Whether crypto falls under the rule depends on current law, so check the latest guidance. See Crypto Tax.

Common mistakes

  1. Forgetting the 30 days before

    Buying more shortly before selling the loss lot also counts.

  2. Automatic reinvestment

    Dividend reinvestment plans can quietly trigger it.

  3. Buying in an IRA

    That loss may never be recovered.

  4. Assuming other countries work the same

    This is a US rule; local tax law differs. See Taxable Event.

Check your understanding

Test yourself before moving on. Each answer comes with an explanation.

Q1You sell shares bought for $2,000 at $1,600 and buy them back 10 days later for $1,700. What is the new cost basis?
Q2Which purchase would NOT create a wash sale under US rules?

Key points to remember

  1. A wash sale is a loss sale with a repurchase within 30 days either side.
  2. The loss cannot be deducted at that time.
  3. It is added to the new shares' cost basis instead.
  4. IRA, spouse and option purchases can also count.
  5. It is a US rule — check your own country's tax law.

Frequently asked questions

Is a wash sale illegal?

No. It is legal; the loss simply cannot be deducted at that time and is added to the new shares' basis.

Can I buy a similar but different fund?

Often yes, as long as it is not substantially identical — for example a fund tracking a different index. Check with a tax adviser.

Does the rule apply outside the US?

No, it is a US rule. Some countries have similar anti-avoidance rules, others do not.

Further learning

Sources

This article is written in our own words. The sources below support the specific facts, rules and figures marked with a number in the text. Links open the original publisher’s page.

  1. Internal Revenue Service. Publication 550, Investment Income and Expenses (opens in a new tab) Checked .
  2. Investor.gov (SEC). Wash Sales (glossary) (opens in a new tab) Checked .

Educational content, not financial advice. Examples use hypothetical prices and simplified costs; actual fees, margin rules and regulations vary by broker, market and country. We are not affiliated with any publisher linked above. Last reviewed . Report an error or request a source credit.