What is a Wash Sale?
A wash sale occurs when an investor sells a security at a loss and buys the same or a substantially identical security within 30 days before or after the sale. Under IRS Section 1091 the loss is disallowed in the current tax year and added to the basis of the replacement shares, deferring (not erasing) the deduction until the replacement is sold in a clean transaction.
Detailed definition
The wash sale rule, codified at IRS Code Section 1091, prevents investors from claiming a tax loss without giving up their economic exposure to the security. If you sell stock at a loss and immediately rebuy the same stock, the IRS treats the round trip as if no sale happened for tax purposes: the loss cannot be deducted in the current year. The economic position is unchanged, so the tax benefit is disallowed.
The mechanics are precise. The window is 30 calendar days before the sale plus 30 days after, including the sale date itself, totalling 61 days. If you buy the same or substantially identical security inside that window, the loss is disallowed. The disallowed amount is added to the basis of the replacement shares, and the original holding period carries over. So the deduction is deferred (it shrinks the gain or grows the loss when the replacement is eventually sold), not erased. The exception is a wash inside an IRA: the basis adjustment goes into an account whose basis is never deductible, so the loss is lost forever (Rev. Rul. 2008-5).
"Substantially identical" is not defined in the statute. The IRS provides no bright line. In practice, two ETFs tracking the identical index are usually treated as substantially identical, while two ETFs tracking different indices (S&P 500 vs Total US Market vs Russell 3000) are treated as different securities and used routinely as wash-safe swaps in tax-loss harvesting. Tax preparers warn that buying call options on the security inside the window also triggers a wash.
Formula
Wash sale triggered if = (Loss sale date - 30 days) ≤ replacement purchase date ≤ (Loss sale date + 30 days) Disallowed loss = the entire loss on shares matched to the replacement purchase New basis of replacement = Replacement cost + disallowed loss New holding period = Replacement holding period extended by the original lot's holding period
- 30-day window covers calendar days, not trading days. Holidays and weekends count.
- Accounts in scope = your taxable accounts, your IRA (traditional or Roth), your 401(k) according to most preparer guidance, and your spouse's accounts. Brokers usually only flag washes within the same account, so cross-account washes must be tracked by you.
- Substantially identical = same CUSIP almost always, same-index ETFs almost always, different-index ETFs almost never.
- Partial wash = if you replace only some of the shares, only the proportional loss is disallowed.
Worked example
You bought 100 shares of XYZ at $50 on March 1 (basis $5,000). On November 1 you sell all 100 at $30 (proceeds $3,000), generating a $2,000 short-term loss. On November 20, before 30 days have passed, you rebuy 100 shares of XYZ at $32 (cost $3,200).
- Window check: Loss sale was November 1; replacement on November 20 is 19 days later, inside the 30-day window. Wash sale triggered.
- Loss disallowed for 2026: $2,000 cannot be deducted on your 2026 Schedule D.
- New basis of the November 20 lot: $3,200 cost + $2,000 disallowed loss = $5,200.
- New holding period: March 1 original purchase carries over; for long-term treatment you need to hold the replacement past March 1 of next year.
- Eventual sale (suppose you sell the new lot at $50 in 2028): Proceeds $5,000 minus adjusted basis $5,200 = $200 loss, deductible then. The original $2,000 loss eventually flows through, just two years later.
Common pitfalls
- Buying inside your IRA. Rev. Rul. 2008-5 says this kills the loss permanently. Never tax-loss harvest in a taxable account while running a 401(k) or IRA auto-contribution into the same fund.
- Spouse's account counts. The 30-day window includes purchases by your spouse in any account they control. Sync any sale plan with them.
- Dividend reinvestment (DRIP). A DRIP purchase of even one share of the same security inside the 30-day window triggers a partial wash. Turn off DRIP before harvesting.
- Auto-investment programs. Target-date 401(k) auto-purchases, employer ESPP, and HSA contributions can all silently trigger a wash.
- Same-index ETF swap. Selling VOO (Vanguard S&P 500) and buying IVV (iShares S&P 500) likely counts as substantially identical. Swap to a different index (VTI Total Market or SCHX) for safety.
- Options. Buying a call option on the same security inside the window is treated as a replacement purchase.
- Spousal Roth IRA hidden trap. A loss in your taxable account washed against a spousal Roth IRA purchase loses the deduction forever and adds nothing useful (Roth withdrawals are already tax-free).
Related terms
Related calculators on 3Tej
Plan harvests, model basis adjustments, and project the tax impact in advance:
Frequently asked questions
What is the 30-day wash sale window?
The window is 30 calendar days before and 30 calendar days after the date of the loss sale, a 61-day period in total counting the sale day itself. If you buy the same or a substantially identical security inside that window, in any account you control, IRS Section 1091 disallows the loss. The disallowed loss is added to the basis of the replacement shares so you still get the deduction eventually, but only when the replacement is sold in a non-wash transaction.
Does buying in my spouse's account or my IRA trigger a wash sale?
Yes to both. IRS Rev. Rul. 2008-5 explicitly extends Section 1091 to purchases inside your traditional or Roth IRA, and the IRS treats your spouse's accounts and any account you control as you for wash sale purposes. The worst case is a wash with an IRA purchase: the disallowed loss is added to the IRA basis, which you cannot deduct on sale because IRA gains are tax-deferred or tax-free. The loss is permanently lost.
Is an ETF that tracks the same index a substantially identical security?
The IRS has never given a bright-line test. Two S&P 500 ETFs from different issuers (VOO vs IVV vs SPY) are widely treated as substantially identical by tax preparers because they track the identical index. A common safe-harbor swap is to a fund tracking a different index, for example selling VOO (S&P 500) and buying VTI (Total Market) or SCHX (Dow Jones US Large-Cap). The funds are highly correlated but track different underlying indices.
Does the wash sale rule apply to cryptocurrency?
Not in 2026 under current law. IRS Section 1091 applies to stocks and securities, and the IRS still classifies cryptocurrency as property, not a security. That means crypto loss harvesting can be done by selling and immediately rebuying without disallowance. Multiple legislative proposals (including in 2021 and 2023 reconciliation bills) would close this gap; check current law before relying on it.
How is a wash sale reported on Form 8949?
Brokers report wash sales on Form 1099-B with code W in column (f) and the disallowed loss amount in column (g). On Form 8949 you enter the loss as normal then add back the disallowed amount in the adjustment column. The disallowed loss increases the basis of the replacement shares (broker-reported for covered securities purchased in the same account, manually tracked across accounts).
How can I tax-loss harvest without triggering a wash sale?
Wait at least 31 calendar days before repurchasing the same security in any account you control (including your spouse's and your IRA). Or, sell into a substitute holding tracking a different index (VOO to VTI, IVW to SCHG) and stay there for at least 31 days. Avoid auto-investment programs in the same security during the wait window. Reinvest dividends manually rather than auto if the dividend record date falls in the window.
Sources and further reading
- IRS (2024) Publication 550, Investment Income and Expenses, the canonical IRS treatment of wash sales and basis adjustment.
- IRS (2008) Revenue Ruling 2008-5, the ruling extending wash sale disallowance to IRA purchases.
- Internal Revenue Code Section 1091 (Loss from Wash Sales of Stock or Securities), the statutory source.
- IRS (2024) Instructions for Form 8949, reporting wash sales on Schedule D.
- Bogleheads wiki Wash Sale, practical investor-side guidance and a list of common ETF swaps used to avoid the substantially-identical trap.
