The 30-day wash sale rule disallows your tax deduction for a loss on a stock or security if you buy a substantially identical one within 30 days before or after the sale. The “30-day” label is a little misleading: the restricted period actually spans 61 calendar days — the 30 days before the sale, the sale date, and the 30 days after. In most cases the loss isn’t gone forever; it gets shifted into the cost basis of your replacement shares. But if the replacement purchase happens inside an IRA, the deduction is destroyed permanently.
How the 61-Day Window Actually Works
The rule sits in Section 1091 of the Internal Revenue Code. If you sell stock or securities at a loss and buy back something substantially identical within a period starting 30 days before the sale and ending 30 days after, the IRS disallows the loss for that tax year.1Office of the Law Revision Counsel. 26 USC 1091 – Loss From Wash Sales of Stock or Securities Count calendar days, not trading days. Sell on March 15, and the restricted window runs from February 13 through April 14.
The backward-looking half of the window trips up more people than the forward half. If you bought additional shares of a stock on March 1 and then sold your original lot at a loss on March 20, that earlier purchase triggers the rule even though it came before the sale. The symmetry is deliberate: it stops investors from quietly rebuilding a position and then dumping the loss shares.
The window also crosses calendar years. Sell in late December and repurchase in early January, and the December loss is disallowed on that year’s return. Waiting the full 31 days after the sale is the only clean way to preserve a year-end tax-loss harvest.
What Counts as Substantially Identical
Section 1091 disallows losses when you acquire “substantially identical stock or securities,” but the IRS has never published a bright-line definition. In practice, you’re asking whether two investments give you essentially the same economic exposure.
The easy cases are easy. Selling 100 shares of Apple and buying 100 shares of Apple inside the window is obviously a wash sale. Selling shares and then buying call options on the same stock also triggers the rule, because the statute explicitly covers contracts and options to acquire or sell stock or securities.1Office of the Law Revision Counsel. 26 USC 1091 – Loss From Wash Sales of Stock or Securities
Mutual funds and ETFs are grayer. Two S&P 500 index funds from different providers hold nearly identical portfolios, so swapping one for the other likely triggers the rule. Selling an S&P 500 fund and buying a total-market fund or a fund tracking a meaningfully different index carries much less risk, because the underlying holdings diverge enough to break the identity. Actively managed funds with different strategies and managers are generally considered distinct from index funds, even when they share some holdings.
Bonds add another layer. Two bonds from the same issuer with similar maturities, coupons, and credit ratings can be substantially identical. Change the issuer, the maturity, or the coupon enough and you’re likely safe.
Whose Accounts and Trades Count
The rule follows the taxpayer, not the account. Selling in one brokerage account and buying in another won’t help, and neither will using accounts at different firms. If you control the accounts, they all count.
Two situations catch people off guard. Purchases by your spouse trigger the rule: if you sell stock at a loss and your spouse buys substantially identical shares inside the 61-day window, it’s a wash sale on your return.2Internal Revenue Service. Publication 550 (2025), Investment Income and Expenses A corporation you control buying the same stock also triggers it. The IRS looks at the household and related entities, not just your personal accounts.
The IRA Trap
The most expensive wash-sale mistake is selling a stock at a loss in a taxable account and repurchasing it inside an IRA or Roth IRA within the 61-day window. In an ordinary wash sale between taxable accounts, the disallowed loss gets added to the replacement shares’ basis, so you recover the tax benefit when you eventually sell. IRAs don’t work that way.
The IRS ruled in Revenue Ruling 2008-5 that when an IRA purchase triggers the wash sale, the loss is disallowed and the IRA’s basis does not increase to compensate.3Internal Revenue Service. Rev. Rul. 2008-5 The tax benefit is destroyed permanently. You can’t deduct it now, and no future sale will recover it. For a large loss, that’s a costly error with no undo.
How Basis and Holding Period Adjust
When a wash sale happens between taxable accounts, the disallowed loss is deferred, not lost. You add the disallowed loss to the cost basis of the replacement shares.1Office of the Law Revision Counsel. 26 USC 1091 – Loss From Wash Sales of Stock or Securities
Say you bought 100 shares at $50 ($5,000 total), sold at $40 ($4,000), and repurchased 100 shares at $42 inside the window. The $1,000 loss is disallowed, but the basis of the new shares becomes $42 plus the $10 per-share disallowed loss, or $52 per share. When you eventually sell those replacement shares, the higher basis reduces your taxable gain or increases your deductible loss. The benefit is delayed, not erased.
Your holding period carries over too. The time you held the original shares tacks onto the holding period of the replacement shares.4Office of the Law Revision Counsel. 26 USC 1223 – Holding Period of Property That matters for the long-term versus short-term distinction: if you held the originals for 11 months, the replacements start with 11 months on the clock, and one more month qualifies any gain for long-term capital gains rates.
Reporting Wash Sales on Your Return
Wash sales go on Form 8949 (Sales and Other Dispositions of Capital Assets). For each affected transaction, enter code “W” in column (f) and the nondeductible loss as a positive number in column (g).5Internal Revenue Service. Instructions for Form 8949 (2025) The Form 8949 totals then flow to Schedule D of your Form 1040, where your overall capital gains and losses are calculated.6Internal Revenue Service. About Form 8949, Sales and Other Dispositions of Capital Assets
Your brokerage reports wash sales to you and the IRS on Form 1099-B, but only for transactions within a single account at that firm. A wash sale created by a purchase in your IRA at a different institution, or in your spouse’s account, won’t appear on any 1099-B. Tracking those cross-account triggers is your job. The IRS cross-references what you report against 1099-B data, so discrepancies tend to get flagged.
If the nondeductible loss shown on your 1099-B is wrong because you know about cross-account transactions your broker missed, enter the corrected amount on Form 8949 and attach a statement explaining the difference.
Penalties for Getting It Wrong
Claiming a loss that should have been disallowed understates your tax. The IRS imposes an accuracy-related penalty of 20% of the underpayment when it results from negligence or a substantial understatement of income tax.7Internal Revenue Service. Accuracy-Related Penalty For individuals, a substantial understatement means the tax was understated by at least $5,000 or 10% of the correct tax, whichever is greater. Interest accrues on both the unpaid tax and the penalty until you pay in full.
The defense is straightforward. Keep detailed trade records showing every purchase and sale date, share count, and price. When a wash-sale adjustment is required, document the basis increase on the replacement shares. Those records are what resolves an IRS question quickly rather than expensively.
Cryptocurrency and Digital Assets
As of 2026, the wash-sale rule does not apply to cryptocurrency or other digital assets. Section 1091 covers “shares of stock or securities,” and the IRS treats crypto as property rather than a security for this purpose.1Office of the Law Revision Counsel. 26 USC 1091 – Loss From Wash Sales of Stock or Securities You can sell Bitcoin at a loss and repurchase it immediately without triggering a wash sale, a strategy that remains off the table for stocks and traditional securities. The legal landscape here could shift, and the IRS has broader doctrines to challenge transactions that lack economic substance, so keep clean records.
The Mark-to-Market Election for Active Traders
If you trade often enough to qualify as running a trading business, you can opt out of the wash-sale rule by making a Section 475(f) mark-to-market election. Under that method, all your trading positions are treated as sold at fair market value on the last day of the tax year, and the wash-sale rule stops applying.8Internal Revenue Service. Topic No. 429, Traders in Securities
Qualifying isn’t easy. The IRS requires that you seek to profit from daily price movements rather than dividends or long-term appreciation, that your trading is substantial in both frequency and dollar volume, and that you trade with continuity and regularity.8Internal Revenue Service. Topic No. 429, Traders in Securities Holding stocks for weeks or months, trading only occasionally, or trading primarily for investment income doesn’t meet the standard.
The election also has a hard deadline: you must file it by the due date (without extensions) of the return for the year before the election takes effect.8Internal Revenue Service. Topic No. 429, Traders in Securities Miss it and you’re stuck with the wash-sale rule for another full year. The trade-off is real: mark-to-market turns all gains and losses into ordinary income, which eliminates the favorable long-term capital gains rate. For high-volume traders whose losses regularly get tangled in wash sales, that trade is often worth it. For everyone else, it usually isn’t.