Is it a wash sale if I sell all shares at a loss?

Trying to figure out if selling my entire position triggers the wash sale rule. I bought 100 shares of a tech ETF across three different lots over a few months, now I'm down on all of them and want to sell everything to harvest the loss before year end. I'm not planning to buy back the same ETF but I do want to buy a similar (not identical) one right away to stay invested. My broker's platform flagged a potential wash sale warning when I tried to preview the trade, which confused me because I'm selling ALL my shares, not just some. Does selling your entire position still count as a wash sale if you rebuy within 30 days?

30 comments

Selling all your shares doesn't get you out of the wash sale rule on its own. What matters is whether you buy substantially identical stock or securities within 30 days before or after the sale — not how many shares you sold. If you sell your entire position at a loss and buy back the same ETF within that 61-day window, the loss is disallowed.

Nina V.

Author

So the "all shares" part is irrelevant? I thought selling everything meant you couldn't be "replenishing" a position. Guess that logic doesn't apply to the tax rule.

The key word in your plan is "similar." If you're buying a *different* ETF that tracks a different index or uses a different strategy, it probably isn't substantially identical. But if the two funds track nearly the same index, that's where it gets complicated and there's no bright-line IRS rule defining exactly when two ETFs are substantially identical.

This is where people get into trouble. S&P 500 ETF from one provider sold and immediately buying S&P 500 ETF from another provider — many tax pros consider that a wash sale because the underlying holdings are essentially identical. Tracking the same index is a real risk factor.

Nina V.

Author

That's the part I was most unsure about. I was planning to swap from one broad market ETF to a different one with a slightly different index. Probably safe but I'll double-check the indexes first.

Publication 550 on the IRS site lays this out clearly: a wash sale happens when you sell at a loss AND within 30 days before or after you buy substantially identical stock or securities. It applies equally whether you sold 10 shares or 10,000. Selling your whole position doesn't create a special exemption.

Went through this same harvest-and-swap situation last December. I uploaded my 1099-B to taxr.ai and asked it to walk through which of my lots were flagged as wash sales and why — it laid out the 61-day window for each lot and showed which replacement purchases fell inside it. Helped me see exactly where the disallowed losses ended up and that they'd been added to the cost basis of the shares I bought back. If you're unsure whether your broker flagged it correctly, that kind of review before filing saves a headache.

Nina V.

Author

Good to know. My broker's 1099-B should have box 1g filled in if there's a disallowed loss, right? I want to make sure the adjustment actually shows up before I file.

Box 1g on Form 1099-B shows the wash sale loss disallowed — but only if the securities sold were covered and the replacement shares had the same CUSIP and were bought in the same account. If you swap to a truly different ETF with a different CUSIP, box 1g won't show anything because the broker can't track cross-fund wash sales.

Right, and the IRS is clear that you can't deduct a wash sale loss even if it doesn't appear on your 1099-B. The burden is on you to catch cross-account or cross-fund situations the broker doesn't see.

Nina V.

Author

That's a bit unsettling. So I have to self-police the wash sale rule even when my 1099-B looks clean?

Yes, you self-police. Your broker only sees what happens inside your account with the same CUSIP. If your spouse buys the same fund in a joint account, or you buy it in an IRA, those also trigger the wash sale rule and your broker almost certainly won't report it.

The IRA one trips people up constantly. Buying back a substantially identical fund in your Roth within 30 days disallows the loss — and unlike regular wash sales, the disallowed loss doesn't even get added back to your basis in the IRA shares. It's just gone.

When you do report on Form 8949, a wash sale loss gets code W in column (f) and the disallowed amount as a positive number in column (g). The loss isn't taken; it shifts to the basis of the replacement shares instead.

Had a similar question about whether my losses were actually disallowed or just flagged incorrectly. I ran my 1099-B through Taxr and it checked each transaction against the purchase dates I gave it, identified which ones fell in the 30-day window, and drafted a summary showing the adjusted basis on the replacement lots. Saved me from mistakenly deducting a loss I couldn't take. Really useful before you file Form 8949.

Nina V.

Author

Did it handle multiple lots with different dates cleanly? I have three separate purchase dates for my ETF so the window calculation is different for each one.

Each lot has its own 61-day window (30 days before the sale through 30 days after). So yes, you calculate separately for each lot. A replacement purchase might fall inside the window for one lot and outside the window for another, disallowing only the loss on the lot(s) where it lands.

Exactly. The lot-by-lot math is where manual tracking gets tedious, especially if you used dollar-cost averaging and have purchases spread out.

Don't overlook the holding period piece either. When a wash sale is disallowed, the holding period of the shares you sold gets tacked onto the holding period of the replacement shares. So your replacement shares might qualify as long-term sooner than you'd expect based only on when you bought them.

That's actually a benefit in some situations. If the original shares had a long holding period already, the tacked-on time could push the replacement lot into long-term territory faster.

A lot of ETF swap strategies work fine for tax-loss harvesting. The question is always whether the replacement fund is *substantially identical* — same index, same sector exposure, same provider. Moving from a total market fund to an S&P 500 fund introduces enough difference that most practitioners don't treat it as substantially identical, though there's no IRS ruling that draws the exact line.

The IRS hasn't formally defined substantially identical for ETFs the way it has for bonds. So you're in judgment territory. The more differences in index methodology, sector weights, and holdings, the safer you are. Swapping two funds that track literally the same benchmark is risky even if the ticker symbols differ.

Nina V.

Author

This is probably the most useful framing I've seen. I'll compare the index methodology specifically, not just the name.

Before I filed last year I pasted my broker's wash sale summary into Taxr and it cross-checked the disallowed amounts against what ended up in column (g) of my Form 8949 draft, then flagged one lot where the adjusted basis on the replacement shares hadn't been updated correctly. Caught a real error. If you have multiple lots and a same-day repurchase it's worth verifying the basis carry-forward on each one.

Nina V.

Author

The basis carry-forward is the part I keep forgetting. The disallowed loss doesn't disappear — it's deferred into the new shares' cost basis and you get it when you eventually sell those without triggering another wash sale.

One correction to something floating around: selling ALL your shares doesn't reset the clock differently than selling a partial lot. The 61-day window runs from 30 days before your sale date to 30 days after. Total liquidation just means no existing position to tack onto — but a *new* purchase in that window is still a replacement purchase and still disallows the loss.

If your situation involves a large harvested loss, an IRA repurchase, or a spouse's account, it might be worth a conversation with a CPA or enrolled agent before filing. The IRA disallowance with no basis recovery is a permanent loss of deduction and not intuitive.

Agreed. The IRA trap in particular isn't something most people expect, and by the time the return is filed it's too late to unwind it.

For the actual filing: short-term wash sale losses go in Part I of Form 8949 with the appropriate box checked (A for covered securities with basis reported to the IRS, B if basis isn't reported). Long-term losses go in Part II with box D or E. Code W in column (f) and the disallowed amount as a positive number in column (g) in both cases. Schedule D picks up the net from Form 8949.

Nina V.

Author

That's the clearest walkthrough of where it lands on the actual forms. My ETF shares are all covered securities so it'll be box A for the short-term lots.