TraderXZone

The Wash Sale Rule: When a Realized Loss Gets Disallowed

2026-08-16 · Taxes · By TraderX · Reviewed 2026-08-31
The Wash Sale Rule: When a Realized Loss Gets Disallowed

You sold 100 shares of a beaten-down stock on December 28 at $38, locking in a $1,200 loss you planned to use against gains elsewhere. Six days later the price ticked up and you bought back in, still cheaper than where you started. In February your 1099-B arrives with that loss flagged “W,” disallowed, and the deduction you budgeted for is not on your return.

The wash sale rule did that. It says a loss is not deductible if you buy the same security, or one substantially identical to it, within 30 days before or 30 days after the sale that produced the loss. Counting the sale day itself, that is a 61-day window, and it looks backward as well as forward — a purchase you made three weeks before selling can disallow the loss just as easily as one made after.

Key points

  • The 61-day window runs 30 days before the sale, the sale day, and 30 days after. Both directions count.
  • A disallowed loss is not destroyed. It is added to the basis of the replacement shares, so the deduction moves to a later year instead of disappearing.
  • Your broker flags wash sales by CUSIP within one account. The actual rule reaches across every account you and your spouse hold, including IRAs.
  • Buying the replacement shares inside an IRA is the one version that genuinely destroys the loss, because there is no taxable basis for it to attach to.
  • Intent is irrelevant. An automatic dividend reinvestment inside the window triggers the rule the same as a deliberate repurchase.

Top view of tax documents, calculator, magnifying glass, and calendar on a black surface.

Following the December 28 sale all the way through

Start with the numbers. You bought 100 shares at $50, so your basis was $5,000. On December 28 you sold all 100 at $38, taking in $3,800 and realizing a $1,200 loss. On January 5 — eight days later, well inside the window — you bought 100 shares back at $40, spending $4,000.

High angle view of tax forms, calculator, calendar, and pen for financial planning.

The $1,200 loss is disallowed for that tax year. It does not vanish. It attaches to the shares you just bought: $4,000 paid plus $1,200 disallowed gives those 100 shares a basis of $5,200, not $4,000. Your holding period carries over too, which matters if the original shares were already long-term.

Now push the example forward. Say you sell those replacement shares the following November at $45, and this time you stay out. Proceeds are $4,500 against a $5,200 basis, so you report a $700 loss. Check that against reality: you paid $5,000 originally and ended up with $4,500, a real economic loss of $500 — plus the $3,800 you collected in December and the $4,000 you spent in January, a $200 net outflow. Total: $700. The arithmetic reconciles. The wash sale changed when you could claim the loss, not whether.

That is the whole shape of the rule. It is a timing provision, not a penalty. Congress wrote it so that you cannot generate a deduction while keeping your economic position essentially unchanged.

“Substantially identical” has no bright line

The tax code does not define the phrase with a test you can run. For an individual stock it is straightforward: the same company’s common stock is substantially identical to itself, and buying it in any account you control counts.

A woman in a black shirt holds tax forms and a 'Need Help?' sign, indoors.

Past that, judgment starts. A call option on the same company can count, because it gives you the same upside exposure. So can a convertible bond that converts into the stock. Two different companies in the same industry almost never count, no matter how tightly their charts track — you could sell one refiner at a loss and buy a competing refiner the same afternoon without touching the rule. Preferred shares of the same issuer sit somewhere in between and depend on how closely their terms track the common.

The IRS lays out the mechanics in Publication 550, Investment Income and Expenses, which is the document a preparer reaches for when the answer is not obvious. The SEC’s Investor.gov glossary entry on wash sales gives the plain-language version.

Your broker sees less than the IRS does

Brokers track wash sales by CUSIP, within a single account, and report the adjustment on Form 1099-B, which carries into Form 8949 with adjustment code “W.” That is the mechanical layer, and for most people with one brokerage account it captures everything.

The statutory rule is wider. It applies across all of your accounts. If you file jointly, it applies to your spouse’s accounts too. Sell your losing position at Broker A on December 28, and if your spouse buys the identical stock at Broker B on January 4, that is a wash sale on your joint return — neither broker will flag it, because neither one can see the other side. Nobody sends you a notice. The obligation to catch it sits with you.

Take the same December 28 sale and change one detail: instead of repurchasing in your taxable account, you buy the 100 shares inside your traditional IRA on January 5. The $1,200 loss is still disallowed. But now there is nowhere for it to go. The basis adjustment that normally rescues the deduction requires a taxable account to land in, and IRA basis does not work that way — gains and losses inside the account never hit your return. The $1,200 is gone permanently. This is the single most expensive mistake in the rule, and it is easy to make by accident if a retirement account holds anything resembling your taxable positions.

Options, index funds, and the crypto gap

Options complicate the picture from both directions. Selling stock at a loss and then buying a deep-in-the-money call on the same name within the window can trigger the rule, because that call is close to a stock substitute. The reverse also happens: closing an option position at a loss and reopening a similar one can wash.

Funds are the gray zone that matters most in practice. Swapping one S&P 500 index fund for a different provider’s S&P 500 fund is standard tax-loss-harvesting technique, and it works on the reasoning that two funds from different issuers are separate securities even when their holdings overlap almost completely. Most preparers accept that. It is a judgment, though, not a settled answer — the IRS has never blessed the specific swap, and two funds tracking the same index are a closer call than two funds tracking different ones. If you are doing this at size, the specific pair is worth running past a preparer.

Cryptocurrency sits outside the rule entirely. The wash sale provision applies to stocks and securities, and the IRS treats crypto as property rather than a security, so selling a coin at a loss and rebuying it an hour later leaves the loss intact. Legislative proposals to close that gap have appeared in past sessions without passing. Treat the current treatment as the current treatment, not a permanent feature.

Partial repurchases split the loss

The rule matches shares to shares. Sell 100 at a loss, buy back 40 inside the window, and only 40 shares’ worth of the loss is disallowed — the other 60 shares’ loss is deductible now.

Run it through the same numbers. The $1,200 loss on 100 shares is $12 per share. Repurchase 40 shares on January 5 and $480 of the loss is disallowed and rolled into those 40 shares’ basis; $720 stays deductible this year. If those 40 shares cost $40 each, or $1,600, their adjusted basis becomes $2,080, which is $52 a share.

Buy back more shares than you sold and the disallowance still caps at the number sold. Purchase 150 shares on January 5 after selling 100, and the full $1,200 is disallowed, spread across the first 100 replacement shares under the ordering rules; the extra 50 carry their plain purchase price.

What this does not tell you

This covers federal mechanics. It does not cover state treatment, which departs from the federal rule in a handful of states. It does not resolve the substantially-identical question for any specific pair of funds or any specific option structure, because those turn on facts a general article cannot see.

It also does not handle lot-level accounting. If you own shares bought on four different dates and sell only some of them, which lots you identify to your broker changes the loss you realize and therefore what gets disallowed — and brokers apply different default methods when you do not specify. The reconciliation document is your 1099-B, not this page.

If you hold correlated positions at more than one broker, trade options against stock you also hold outright, or your spouse trades the same names you do, the calculation stops being something you can do in your head. That is the point where the cost of an hour with a preparer is smaller than the cost of a mistake.

FAQ

Does the wash sale rule apply if I buy back after 30 days?

No. Once you are outside the window on both sides — no purchase in the 30 days before the sale, none in the 30 days after — the loss is deductible as reported. Count calendar days, not trading days, and count from the trade date rather than the settlement date.

Can I sell at a loss and buy a similar but different stock?

Yes, as long as it is not the same issuer or a security convertible into it. Selling one bank and buying a competing bank the same day keeps your sector exposure and does not trigger the rule. The risk is not tax — it is that the substitute does not move the way you expected.

What happens if I sell at a loss and only buy back part of the position?

Only the matching portion is disallowed. Sell 100 shares at a $1,200 loss, buy back 40 within the window, and $480 is deferred into the new shares’ basis while $720 is deductible this year. The split is per share, not all-or-nothing.

Do wash sale rules apply to trades inside my 401(k) or IRA?

Trades entirely inside a tax-deferred account produce no reportable gain or loss, so there is nothing to disallow. The trap is the crossover: a loss sale in your taxable account plus a repurchase inside the IRA within the window kills the loss with no basis adjustment to recover it later.

How do I tell whether my broker flagged a wash sale?

Look at your Form 1099-B for adjustment code “W” and the corresponding disallowed amount; the adjusted basis appears alongside it. Remember the broker only sees one account, so a clean 1099-B does not prove you had no wash sale.

Does a dividend reinvestment count as a repurchase?

Yes. Automatic reinvestment buys shares, and the rule does not care that you did not click anything. A quarterly DRIP that lands three days after you sell the rest of the position at a loss disallows the portion of the loss matching the reinvested shares — usually a small amount, but it will show up coded “W” and it will confuse you in February if you forgot the plan was on.

Before you harvest a loss

Check every account you and your spouse hold, not just the one you are selling from, for purchases in the 30 days before the sale and any purchase you intend in the 30 days after. Turn off dividend reinvestment on a position you are about to sell at a loss. And when the 1099-B arrives, read the adjustment column — that is the number the IRS receives, and reconciling it while the trades are still fresh in your memory is far easier than reconstructing them in April.

This article is general information, not financial advice. See our disclaimer.

Sources

Primary documents behind the rules and thresholds used above. Every link is checked for a live response before publication.

Related articles

More in Taxes · all topics · calculators · how this was checked