Term

Wash Sale

Published May 7, 2026
Definition

A wash sale is a transaction where a security is sold at a loss and substantially identical securities are repurchased within 30 days before or after — disallowing the loss for the current period under IRC §1091. The disallowed amount is added to the basis of the replacement lot, deferring (not eliminating) the tax benefit.

Wash-sale rules exist to prevent paper-only loss harvesting where the taxpayer claims a tax loss without meaningfully changing economic exposure. The window is 61 days total: 30 days before the sale, the sale day itself, and 30 days after. 'Substantially identical' covers exact ticker matches, options on the same security, and convertible securities of the same issuer; ETFs tracking the same index are usually fine.

The rule applies taxpayer-wide, not account-local. A loss in a taxable brokerage can be disallowed by a purchase in an IRA (IRS Rev. Rul. 2008-5), an HSA, an after-tax 401(k) sub-account, or a spouse's account — and the IRA-side trigger is uniquely punishing because the disallowed loss cannot be added to the IRA basis (§1091(d) excludes IRAs from the basis adjustment), making it permanently lost rather than merely deferred.

The wash-sale flag is also the single largest source of silent reporting errors on broker 1099-Bs. A single-account broker can compute wash sales correctly within their book; multi-account taxpayers and married filers routinely receive 1099s that miss cross-account triggers, and the burden falls on the taxpayer to reconcile.

Why this matters for synthetic data

Test data for a TLH engine has to model wash sales taxpayer-wide and across all linked accounts — IRA, Roth IRA, HSA, 401(k) self-directed sub-accounts, and spouse mirrors. A useful synthetic household carries at least one pre-existing wash-sale disallowance carried into the test window, at least one cross-account trigger, and at least one IRA-side disallowance to exercise the permanent-loss path.

Common pitfalls

  • Treating wash sales as account-local — the most common production bug we see.
  • Missing the 30-day-before window: a purchase three weeks before a sale at a loss can create a wash sale even though the sequence feels intentional.
  • Letting an algorithm sell at a loss while a recurring-buy or DRIP order is active in the same security across any linked account.
  • Failing to track the IRA-side permanent disallowance differently from a basis-adjustment deferral.

Examples

Cross-account trigger (taxable + IRA)

Sell 100 XYZ in taxable for a $1,000 loss on March 1. Buy 100 XYZ in your traditional IRA on March 12 (within 30 days). Result: $1,000 loss disallowed in taxable. Under §1091(d), the disallowed amount cannot be added to the IRA basis, so it is permanently lost.

Spouse trigger

You sell 100 XYZ in your taxable account at a $500 loss on April 5. Your spouse, filing jointly, buys 100 XYZ in their separate brokerage on April 18. Wash sale fires on the joint return — the $500 loss is added to your spouse's lot basis.

Frequently asked questions

Does selling SPY and buying VOO the next day trigger a wash sale?+
No, generally — different issuers (State Street vs. Vanguard), and the IRS has not treated cross-issuer ETFs tracking the same index as substantially identical. Most TLH engines exploit this directly, swapping between same-asset-class ETFs from different issuers to maintain exposure.
Is a 401(k) purchase a wash-sale trigger for a taxable loss?+
No. Section 1091 binds to the taxpayer entity, but qualified plans (401(k), pensions) are not in that entity for §1091 purposes. The IRS extended the rule to IRAs in Rev. Rul. 2008-5 but did not extend to 401(k)s. Synthetic-data engines that flag 401(k)s as wash-sale triggers will produce false positives.
How long is the actual disallowance window?+
61 days: 30 days before, the sale day, 30 days after. Some materials say '30 days' as a shorthand, but the symmetric window is the right answer and is what brokers compute.