How the Wash Sale Rule Applies to Your 401(k)

The wash sale rule applies to your 401(k), and when it catches you the damage is worse than a standard wash sale. If you sell a security at a loss in a taxable brokerage account and your 401(k) buys substantially identical shares within 30 days before or after that sale, the IRS disallows the loss under Internal Revenue Code Section 1091.1Office of the Law Revision Counsel. 26 U.S. Code 1091 – Loss From Wash Sales of Stock or Securities In an ordinary wash sale between taxable accounts, the disallowed loss gets added to the replacement shares’ cost basis, so you recover it later. When the replacement purchase happens inside a 401(k), there is no basis to adjust and the loss vanishes for good.

Why a 401(k) Repurchase Destroys the Loss

A 401(k) is a tax-advantaged account. You don’t report capital gains or losses on trades inside the plan, and eventual withdrawals are taxed as ordinary income regardless of what any individual holding did along the way.2Internal Revenue Service. What if My 401(k) Drops in Value? Cost basis on a specific fund inside the plan is not something you can ever use. So the normal wash sale remedy, bumping the replacement shares’ basis by the disallowed amount, has nothing to attach to.

The IRS made this explicit for IRAs in Revenue Ruling 2008-5. When a taxpayer sold stock at a loss and then had their IRA buy substantially identical shares inside the 61-day window, the ruling disallowed the loss and specifically held that the basis of the IRA shares does not increase.3Internal Revenue Service. Rev. Rul. 2008-5 The ruling addresses IRAs and Roth IRAs rather than 401(k) plans, but the statutory logic is the same and tax practitioners broadly apply the same result to 401(k) accounts. Roth 401(k) balances get the same treatment as traditional 401(k) balances here; the account is tax-advantaged, so no basis fix is available.2Internal Revenue Service. What if My 401(k) Drops in Value?

A concrete example. You hold 100 shares of Company X in your brokerage account with a basis of $10,000. You sell for $8,000, realizing a $2,000 loss. Two weeks later, your biweekly 401(k) contribution buys shares of the same company. That $2,000 is permanently disallowed. You took a real economic loss and you will never deduct it.

How the Cross-Account Trap Actually Springs

This almost never happens because someone timed a trade badly on purpose. It happens because 401(k) contributions run on autopilot. Your paycheck hits, the plan buys whatever funds you selected months ago, and if one of them overlaps with a position you just sold at a loss, the wash sale is triggered. Dividend reinvestment inside the plan works the same way. The purchase doesn’t need to be intentional to count as an acquisition.

The usual overlap is a broad market index fund. You sell an S&P 500 ETF at a loss in your brokerage account while your 401(k) keeps buying an S&P 500 index fund every pay period. Same underlying basket, same result.

What “Substantially Identical” Covers

The IRS has never published a precise definition, which leaves gray area. The clearest cases are the same stock, or the same mutual fund. Options and warrants on the same stock count too.

Two S&P 500 index funds from different providers hold essentially the same 500 stocks and perform almost identically. The IRS has not issued a definitive ruling on whether these are substantially identical, but conservative advisors treat them as if they are. Two funds tracking different indexes are generally considered safe. Selling an S&P 500 fund in your brokerage account while your 401(k) buys a total stock market fund or a Russell 1000 fund introduces enough difference that most practitioners would not flag it.

Your Spouse’s Retirement Accounts Count

The rule doesn’t stop at your own accounts. If you sell at a loss and your spouse’s 401(k) or IRA buys substantially identical shares within the 61-day window, the IRS can treat that as a wash sale. Section 267 coordinates loss disallowance between related parties, including spouses, and cross-references Section 1091.4Office of the Law Revision Counsel. 26 U.S. Code 267 – Losses, Expenses, and Interest With Respect to Transactions Between Related Taxpayers If you’re harvesting losses, check what your spouse’s plan is buying too.

Trades Entirely Inside the 401(k) Don’t Matter

Sell a fund at a loss inside your 401(k) and buy it back a week later in the same account, and the mechanical definition of a wash sale is met. It doesn’t matter. Since you could never deduct that loss, there is nothing for the rule to disallow.2Internal Revenue Service. What if My 401(k) Drops in Value? Rebalance freely. The rule only bites when a taxable account loss meets a retirement account purchase.

How to Avoid Losing the Deduction

Before selling any losing position in a taxable account, check what your 401(k) has bought in the last 30 days and what it is scheduled to buy in the next 30. If there’s overlap, you have options.

  • Change your 401(k) allocation away from the overlapping fund at least 31 days before you plan to sell in your taxable account. After the 61-day window closes, switch back.
  • Replace with something that isn’t substantially identical. Sell the S&P 500 ETF in your brokerage account and buy a total market fund or a large-cap value fund instead. You stay invested and the rule doesn’t apply.
  • Wait out the window. If your 401(k) already purchased the overlapping fund, delay your taxable sale by at least 31 days from the most recent 401(k) purchase, then keep the 401(k) off that fund for another 30 days after the sale.

The replacement approach is what most active tax-loss harvesters use. Selling an S&P 500 fund and buying a Russell 1000 fund keeps your market exposure close while creating enough distinction to sidestep the substantially identical problem.

Reporting a Cross-Account Wash Sale on Your Return

Your brokerage firm has no visibility into your 401(k). The 1099-B will show the full loss. You are responsible for the adjustment, and it goes on Form 8949.

Enter the sale in Part I (short-term) or Part II (long-term) depending on the holding period. Put the proceeds in column (d) and the basis in column (e). Enter code “W” in column (f), and enter the disallowed loss as a positive number in column (g). That zeros out the loss in column (h). If your 1099-B already shows a wash sale adjustment in box 1g but the broker missed the cross-account component, enter the correct disallowed amount in column (g) and attach a statement explaining the difference.5Internal Revenue Service. Instructions for Form 8949 (2025)

Keep the 401(k) statement or transaction history showing the purchase date and the security. If the IRS ever questions the adjustment, that’s what proves the repurchase happened inside the 61-day window.

What Happens If You Skip the Adjustment

Failing to disallow a wash sale loss understates your tax. The IRS can assess a 20% accuracy-related penalty on the underpaid tax when the understatement results from negligence or disregard of the rules, plus interest from the original due date. The substantial understatement threshold for an individual is the greater of 10% of the correct tax or $5,000.6Internal Revenue Service. Accuracy-Related Penalty

A single small missed adjustment probably won’t cross that line on its own. But if you’re harvesting across several positions while a 401(k) keeps buying overlapping funds, the unreported adjustments accumulate. The IRS matches 1099-B data against returns and can flag losses that were not properly adjusted. Reporting it correctly the first time costs less than answering the notice later.