Wash sale if selling recent ESPP shares at a loss with no repurchase — does it even apply?

Sold my ESPP shares last month at a loss. Bought them through payroll deductions over the past year, so the most recent lot was purchased about 6 weeks ago. I haven't bought any new company stock since, no open orders, nothing in my IRA either. My broker's 1099-B shows code W in box 1g on the most recent lot, which I did not expect at all since I didn't buy anything after the sale. I went back and checked my ESPP purchase history and I think the "repurchase" the broker flagged is actually an earlier lot purchased within the 30-day window before my sale date — not after. Is that how wash sales work? I always thought it was about buying after you sell. Can a purchase that happened before the sale trigger a wash sale if selling recent ESPP shares at a loss with no repurchase after the fact?

35 comments

Yes, the 30-day window goes both ways. The wash sale rule covers purchases within 30 days before OR after the sale at a loss. So if your ESPP purchased a lot of company stock within 30 days before you sold a different lot at a loss, that prior purchase can be the "substantially identical" stock that triggers it. A lot of people learn this the hard way with ESPP because the payroll purchases keep happening on a schedule you don't fully control.

Victor G.

Author

That explains it. The lot flagged was purchased about 25 days before my sale. So the broker caught it correctly even though I never bought anything after the sale. I feel a little better knowing the code W is right, but it's annoying because I didn't plan this at all.

I ran into almost the same thing last filing season with ESPP lots spread across multiple purchase periods. I uploaded my 1099-B to taxr.ai and it flagged which specific lots were creating wash sale conflicts based on the purchase dates and which losses were being deferred versus added to basis. Helped me see the full picture before I entered anything on Form 8949. Worth checking if you have several lots with different dates.

Victor G.

Author

I do have three separate lots from different purchase periods. I'll try that before I finalize my 8949 entries.

Did it also show the adjusted basis on the new shares? That part always confuses me — where the disallowed loss actually goes.

The disallowed loss doesn't disappear. It gets added to the cost basis of the shares that triggered the wash sale — in your case the lot purchased 25 days before your sale. So when you eventually sell that earlier lot, your basis is higher and your gain (or loss) on that sale is adjusted accordingly. See Publication 550, chapter 4 (Wash Sales), for the mechanics.

Victor G.

Author

So the earlier lot already has a higher adjusted basis now. And my holding period on that lot still runs from its original purchase date, not from my sale date, right?

Correct. The holding period of the replacement shares includes the holding period of the shares sold at a loss. So the earlier lot keeps its original acquisition date for holding period purposes.

I sold ESPP shares at a loss two years ago and had the same W code show up. What tripped me up was that my broker only flagged it on covered securities with the same CUSIP bought in the same account. I had shares in a different brokerage account that also created a wash sale but that one wasn't reflected in box 1g at all — I still had to report it myself on Form 8949 with code W.

Victor G.

Author

Wait, so even if the broker doesn't put it in box 1g, I'm still responsible for catching it myself?

Exactly. The IRS says you can't deduct a wash sale loss even if it's not on the 1099-B. The reporting is on you if the broker misses it.

I had my ESPP 1099-B reviewed through Taxr last year when I had a mix of disallowed losses and qualifying dispositions in the same tax year. It read through the 1099-B and listed each lot, flagged which ones had the W code, and drafted a summary showing what basis adjustments I needed to enter in column (g) of Form 8949 — positive amounts for the disallowed wash sale losses. Saved me from entering them as negatives by mistake.

I always get confused about the sign on column (g). Positive means you're reducing the loss, right?

Right. If your 1099-B shows a $400 loss but the wash sale disallows it, you enter $400 as a positive number in column (g), which zeroes out the loss on that row. The gain/loss in column (h) ends up at zero or close to it.

Something worth checking: are you still enrolled in the ESPP? If payroll deductions are still running and a new purchase period closes within 30 days after your sale, that new lot could also trigger a wash sale on the same loss. The "no repurchase" situation can change fast if the ESPP is still active.

Victor G.

Author

I suspended my enrollment before the sale specifically to avoid this. But I didn't think about the prior purchases. Good reminder for anyone else reading this.

On Form 8949, the wash sale loss you can't take goes in column (g) as a positive number, and you check the box for Part I or Part II depending on whether the shares were short-term or long-term. For most ESPP shares sold within a year of purchase it's Part I, box A if basis was reported to the IRS.

The rule also applies if your spouse bought substantially identical stock in the 30-day window, or if a corporation you control made the purchase. Worth knowing for anyone with a jointly held brokerage or a small business.

I didn't know the spouse rule extended it. My spouse holds shares in the same company through their own ESPP at the same employer. That could be a problem.

It could be. If the shares are substantially identical and the purchase fell in the 30-day window around your loss sale, the wash sale rules would apply even though it's a separate account and a separate person.

My situation last year had a wrinkle: the ESPP purchase price was at a 15% discount to market, so my cost basis on the purchased lot was already below market. When the disallowed loss got added to that basis it pushed the adjusted basis above what I thought. I'd double-check your numbers on the replacement lot's adjusted basis once you know the disallowed amount.

Victor G.

Author

That's a good point. My ESPP also has a discount, so the basis on the earlier lot before the adjustment was already the discounted price. I'll recalculate with the disallowed amount added in.

Does the wash sale issue affect whether the ESPP sale is a qualifying or disqualifying disposition? Those are separate questions — the qualifying/disqualifying analysis depends on how long you held the shares relative to the grant date and offering date, not on whether a wash sale occurs.

Correct. The wash sale just affects the deductibility of the capital loss. The compensation income piece from a disqualifying disposition is a separate calculation based on the holding period rules under section 423, not the wash sale rules.

Victor G.

Author

Mine are all disqualifying dispositions already since I held them less than two years from grant. So the compensation income was already included in my W-2. The wash sale is only affecting the capital loss portion.

For the holding period on the replacement shares — the lot that absorbed your disallowed loss — that lot's holding period now includes the holding period of the shares you sold. So it's not just the adjusted basis that carries over, the tacking of the holding period could push that lot into long-term territory sooner than you'd expect.

I sold a lot at a loss and then my regular 401k purchased a company stock fund within the window. That apparently doesn't count — the wash sale rules apply to stock and securities, not to interests in a diversified fund that happens to hold the same stock. But if the 401k had bought the actual company stock directly, that would be a different story and the disallowed loss would be permanently lost rather than deferred.

That's an important distinction. And the permanently lost part is key — when the IRA or Roth IRA buys substantially identical stock and the wash sale triggers, you can't add the disallowed loss to the IRA's basis the way you can with a taxable account. It's just gone.

Right, that's specifically how the rule works for retirement accounts. The basis tack doesn't apply there, so the loss is disallowed with no offset anywhere.

My broker flagged a wash sale on a lot I sold in December and the replacement purchase was in January of the next year. The wash sale still applied even though it crossed the tax year. The disallowed loss moved into the following year's cost basis, which was confusing when I got the next year's 1099-B and the basis looked different from what I paid.

Cross-year wash sales are brutal to reconcile. I had one and the adjusted basis on the January lot didn't match anything I had written down. Took me a while to trace it back.

To confirm what others said about reporting: even where the broker correctly shows code W and the disallowed amount in box 1g, you still have to carry that through on Form 8949. Enter the proceeds from column (d) and the original basis in column (e), put W in column (f), and the disallowed loss as a positive number in column (g). The instructions for Form 8949 at irs.gov walk through the column (g) adjustment logic in detail.

One thing I confirmed when I had this question: if the wash sale is on a covered security and the same CUSIP was repurchased in the same account, the broker is required to track and report it. But cross-account wash sales, IRA wash sales, and spouse purchases are your responsibility to catch. The 1099-B won't show those.

Victor G.

Author

This is the part I was most unclear on. My situation is all in one account with the same CUSIP so the broker got it, but I'll be more careful going forward about the IRA and spouse scenarios.

Publication 550 on the IRS site has a full section on wash sales including the 30-day before-and-after window, the basis adjustment rule, the holding period tacking, and what happens with IRA purchases. It's the clearest single reference for all the pieces in one place.