Wash sale if buy stock in 401k then sell at loss in taxable account?

I sold shares of a tech ETF in my brokerage account at a loss last month. About two weeks before that sale I had bought the same ETF inside my 401k through my employer's plan contributions. My broker sent a 1099-B showing the loss as allowed, but I've been reading that 401k purchases can trigger a wash sale. Now I'm not sure whether to trust the 1099-B or whether I need to make an adjustment on Form 8949. The loss is not tiny and I don't want to claim something that isn't allowed. Can a 401k purchase of substantially identical stock within the 30-day window actually disallow the loss in my taxable account?

33 comments

Form 8949 is where this matters, so let's start there. The wash sale rules under Publication 550 say the disallowed loss gets triggered if you buy substantially identical stock within 30 days before or after the sale — including through a spouse or a corporation you control. A 401k is neither of those. The rule that extends wash sales to IRAs and Roth IRAs is specific to those account types. A 401k is not an IRA. So a purchase inside a 401k does not trigger a wash sale on a loss in your taxable account.

Sofia F.

Author

Thank you, that's exactly the distinction I needed. I'll leave the 1099-B as-is and not add a code W adjustment on Form 8949.

Agreed on the 401k point. The IRA wash sale extension in Publication 550 covers traditional IRAs and Roth IRAs specifically. It does not mention 401k, 403b, or other employer plans. The IRS has not issued guidance extending the rule to those accounts, so the consensus among practitioners is that a 401k purchase does not disallow the loss. Your broker's 1099-B box 1g should show $0 wash sale disallowed, which sounds right.

This matches what my CPA told me last year. She specifically said the 401k carveout people worry about doesn't exist in the current rules — it's only IRAs in the statute.

I had almost this same situation — sold at a loss in my taxable account, had bought the same fund in my 401k twelve days earlier. I uploaded my 1099-B and my 401k transaction history to taxr.ai and asked it to check whether the 401k purchase date fell inside the 30-day window and whether the wash sale extension reached a 401k. It read both documents, confirmed the dates overlapped, and laid out exactly which account types the IRA rule covers and which it doesn't. Really helped me feel confident before I filed. The loss stayed on my Schedule D as allowed.

Sofia F.

Author

Good to know it held up. The date-checking piece is what worried me most so that's reassuring.

One thing worth flagging: the question of whether the ETF you bought in the 401k is "substantially identical" to what you sold still matters for the analysis even if the 401k itself doesn't trigger a wash sale. If you had also bought the same ETF in a regular brokerage account or IRA within the window, that purchase would create the wash sale. So make sure no other account had a purchase of the same or substantially identical fund in the 30 days before or after your sale.

Sofia F.

Author

Good catch. I checked — no IRA purchases and no other brokerage buys of the same ETF in that window. The only relevant purchase was in the 401k.

Then you should be fine. The 1099-B is correct and no adjustment column (g) entry is needed.

Schedule D picks up the totals from Form 8949 so the wash sale treatment — or lack of it — flows through there. If your 1099-B box 1g is blank or zero and you have no other wash sale triggers, you just report the sale normally in Part I or Part II of Form 8949 depending on how long you held the shares, check box A or D if basis was reported to the IRS, and carry it to Schedule D. No code W, no column (g) adjustment needed.

Does the holding period of the ETF shares affect whether the wash sale rule would even apply if it did get triggered? Like does short-term vs long-term matter for whether a purchase creates a wash sale?

The wash sale rule applies to losses regardless of holding period. What changes is that the disallowed loss gets added to the basis of the new shares and the holding period of the old shares carries over to the new ones — so a short-term holding period can tack onto the new shares. But wash sale eligibility itself doesn't depend on whether the loss was short or long term.

Ah ok that makes sense, I was confusing two different things. Thanks.

For what it's worth I went through a messier version of this — I had the 401k buy, an IRA buy, and a taxable account buy all within the same 30-day stretch. I showed Taxr the three transaction records and my 1099-B and had it walk through Form 8949 line by line for my specific situation. It identified which purchase triggered the actual wash sale (the IRA one) and which didn't (the 401k one), and drafted the column (f) and (g) entries I needed. Saved me from either over-reporting or under-reporting.

Sofia F.

Author

That's a helpful real example. The IRA purchase being the trigger while the 401k one wasn't is exactly the distinction this thread has been making.

The IRA wash sale trap is a real one. Publication 550 is explicit that buying substantially identical stock in your IRA or Roth IRA within the window disallows the loss and — importantly — the disallowed amount does NOT get added back to the IRA's basis. It's just gone. That makes it worse than a regular wash sale.

Worth mentioning: even when a wash sale does apply, the loss isn't permanently lost (unless the IRA situation above). It gets added to the cost basis of the replacement shares. So when you eventually sell those shares without triggering another wash sale, you recover it. The holding period of the disallowed shares also tacks onto the new ones per Publication 550.

This is why tracking adjusted cost basis carefully matters so much. If you don't record the basis bump when the wash sale happens you'll double-pay when you sell the replacement shares.

Form 1099-B box 1g is the number to look at first. If your broker shows $0 there, they didn't flag a wash sale. That could be because there wasn't one, or it could be because the 1099-B wash sale reporting only covers situations where the substantially identical shares were bought in the same account with the same CUSIP. Cross-account wash sales — including the IRA scenario — may not appear on the 1099-B at all even when they legally apply.

Sofia F.

Author

So the 1099-B being clean doesn't fully protect me if I had an IRA purchase. Got it. In my case I didn't, so I think I'm fine, but good to know that for the future.

The same-CUSIP same-account limitation on 1099-B reporting is exactly why people get caught. They see no box 1g amount and assume they're clear, but the legal obligation to apply the wash sale rule exists regardless of whether it appears on the form. Publication 550 is clear that you can't deduct a wash sale loss even if it's not reported on the 1099-B.

How does the substantially identical test work for ETFs anyway? Like if you sold an S&P 500 ETF from one provider and bought a different S&P 500 ETF from another provider within 30 days, is that a wash sale?

The IRS hasn't given a bright-line rule for ETFs tracking the same index. The "substantially identical" standard was developed for stocks and bonds. Many practitioners take the position that two different ETFs tracking the same index from different providers are not substantially identical because they have different holdings, expense ratios, and structures. But there's no IRS ruling or regulation that definitively settles it. It's a gray area.

So basically proceed carefully and maybe ask a CPA before doing that intentionally as a tax-loss harvesting strategy.

Exactly. If you're doing tax-loss harvesting with index ETFs, the common approach is to swap into a fund tracking a different but correlated index to get clearly outside the substantially identical question.

I dealt with a complicated year where I had RSU vesting, automatic reinvestment buys, and a taxable sale all landing in the same 30-day window. I uploaded everything to Taxr and asked it to check the dates on each transaction against the wash sale window. It flagged two purchases I hadn't caught, compared the CUSIPs, and put together a summary showing which lots were affected and what the adjusted basis on the replacement shares should be. I used that to fill in columns (f) and (g) on Form 8949 correctly.

Sofia F.

Author

RSU automatic vesting creating wash sale triggers is something I hadn't thought about at all. That's a whole other layer.

It caught me off guard too. The vesting event creates an acquisition at fair market value, and if you sold the same stock at a loss within 30 days before that vest date, that vesting purchase can disallow the loss. The IRS instructions for Form 8949 and Publication 550 both treat it as an acquisition.

To confirm the core answer for OP: a 401k purchase does not trigger the wash sale rule. The IRA and Roth IRA extension in Publication 550 is explicit about those account types and does not reach employer-sponsored plans like 401k or 403b. Your 1099-B is correct. Report the sale in the appropriate Part of Form 8949, check box A (short-term) or D (long-term) if basis was reported to the IRS, or box B or E if it wasn't, and carry the loss to Schedule D normally.

Publication 550 on the IRS site has the full wash sale chapter including the IRA extension language if you want to read the primary source. The instructions for Form 8949 also walk through the code W reporting requirements and how column (g) adjustments work for wash sales. Worth reading both before you finalize.

One scenario worth ruling out: did your employer's 401k contributions get invested automatically in the ETF as part of a payroll cycle, or did you actively direct that purchase? Either way the answer is the same — 401k is not an IRA — but if contributions are auto-invested on a schedule you might have more purchase dates inside various 30-day windows than you think across a full year.

Sofia F.

Author

It was an automatic contribution. Good point that there could be multiple dates throughout the year. I'll keep that in mind for tax-loss harvesting timing going forward even though for this specific sale it doesn't change the outcome.

Final check before you file: make sure the holding period on the shares you sold is correctly shown on the 1099-B. For stocks traded on an established market the holding period starts the day after the trade date you bought, and ends on the trade date you sold. That determines whether this goes in Part I (short-term, one year or less) or Part II (long-term, more than one year) of Form 8949, which then flows to the right line on Schedule D.