What Is the 30-Day Rule for Wash Sales?

The 30-day rule for wash sales is an IRS rule that blocks you from deducting a loss on a stock or security if you buy the same investment, or one substantially identical to it, within 30 days before or 30 days after the sale. That gives you a 61-day blackout window around every loss sale. The loss isn’t erased; it gets added to the cost basis of the replacement shares and shows up when you eventually sell those. The exception is when the replacement is bought inside an IRA, where the loss is gone for good.

The rule sits in Section 1091 of the Internal Revenue Code and covers most individual investors across all their taxable brokerage accounts, even at different firms.1Office of the Law Revision Counsel. 26 USC 1091 – Loss From Wash Sales of Stock or Securities “Acquire” is read broadly. Buying shares counts. So does entering into a contract or option to buy them.

How the 61-Day Window Actually Counts

People call it the 30-day rule, but the restricted period runs 61 days: the 30 days before the sale, the sale date itself, and the 30 days after.2eCFR. 26 CFR 1.1091-1 – Losses From Wash Sales of Stock or Securities These are calendar days. Weekends and holidays count.

The pre-sale half of the window is the part most investors overlook. If you buy more shares on December 1 to average down, then sell your original lot at a loss on December 15, that December 1 purchase is inside the 30 days before the sale and triggers a wash sale on its own.

The trade date, not the settlement date, generally controls when the sale happened. That matters at year-end. A loss sale on December 30 stays live through January 29 of the next year, and a repurchase in that window pushes the disallowed loss into the following tax year.

What Counts as Substantially Identical

The IRS uses a facts-and-circumstances test. There’s no bright-line formula, but Publication 550 gives enough guidance to work with in most situations.3Internal Revenue Service. Publication 550 – Investment Income and Expenses

Different Companies and Different Funds

Stock in two different corporations is generally not substantially identical, even if both companies operate in the same industry. Selling one tech stock at a loss and buying a different tech stock the same day is fine.

ETFs and index funds follow similar logic with an important nuance. Selling an S&P 500 fund and buying a total stock market fund tracking a different index is generally treated as different investments. Selling one S&P 500 fund and buying another S&P 500 fund with nearly identical holdings is much riskier, because the underlying portfolios track the same benchmark closely enough that the IRS could treat them as substantially identical.

Options, Preferred Stock, and Bonds

A call option on the stock you just sold triggers the rule, because it gives you the right to reacquire the same security.1Office of the Law Revision Counsel. 26 USC 1091 – Loss From Wash Sales of Stock or Securities Preferred stock and bonds of the same company are usually treated as separate securities from that company’s common stock. The exception is convertible preferred stock trading at prices that closely track its conversion ratio into the common; in that case the IRS treats them as the same investment.3Internal Revenue Service. Publication 550 – Investment Income and Expenses Bonds with meaningfully different interest rates or maturity dates are generally treated as separate securities.

Where the Disallowed Loss Actually Goes

A wash sale defers your loss. It doesn’t destroy it (with one exception, covered below). The disallowed amount is added to the cost basis of the replacement shares.3Internal Revenue Service. Publication 550 – Investment Income and Expenses

An example: you sell 100 shares at a $2,000 loss, then repurchase 100 shares for $10,000 inside the window. Your adjusted basis in the new shares is $12,000. When you eventually sell those, the higher basis produces either a smaller gain or a larger loss.4Internal Revenue Service. Wash Sales – IRS Courseware

The holding period of the original shares also carries over under Section 1223.5Office of the Law Revision Counsel. 26 USC 1223 – Holding Period of Property Eight months on the original shares plus five months on the replacements adds up to a 13-month holding period, which qualifies for the long-term capital gains rate. Without the carryover, you’d be stuck with short-term treatment.

The IRA and Roth IRA Trap

This is the expensive mistake. If you sell a stock at a loss in your taxable brokerage account and buy the same stock in your IRA or Roth IRA within the 61-day window, the loss is disallowed like any other wash sale.3Internal Revenue Service. Publication 550 – Investment Income and Expenses The difference is what happens next. Normally the disallowed loss lifts the basis of the replacement shares, so you recover the tax benefit whenever you sell. An IRA has no individual cost basis to adjust. The IRS ruled in Revenue Ruling 2008-5 that the Section 1091(d) basis increase does not apply to shares held in the IRA or Roth IRA.6IRS.gov. Revenue Ruling 2008-5 – Losses From Wash Sales of Stock or Securities

The result is a loss you can never deduct. Not this year, not later. If you’re harvesting losses at year-end, check any automatic contributions, dividend reinvestment, or rebalancing in your retirement accounts that might quietly buy back a position you just sold in a taxable account.

Common Triggers People Miss

Averaging down before selling. Buying more shares in the 30 days before you sell the losing lot is a wash sale, even though the additional purchase felt like a separate decision.

RSU vesting. When restricted stock units vest, the IRS treats it as an acquisition of stock. If you sell company shares at a loss and another RSU tranche vests within 30 days on either side, that vesting can trigger a wash sale, and the disallowed loss rides onto the basis of the newly vested shares. Employees on quarterly vesting schedules are especially exposed. Selling RSU shares as soon as they vest, before they have time to fall in price, removes the loss that would otherwise be at risk.

Cross-account activity. The rule reaches across all your taxable accounts and into your IRAs. Brokerages only flag wash sales inside their own four walls.

Dividend reinvestment. A DRIP purchase inside the window is an acquisition like any other.

Cryptocurrency Sits Outside the Rule for Now

The wash sale rule doesn’t currently apply to cryptocurrency. The IRS classifies virtual currency as property rather than as stock or securities,7Internal Revenue Service. Notice 2014-21 – IRS Virtual Currency Guidance and Section 1091 reaches only stock or securities. Selling Bitcoin at a loss and buying it back the same hour is not a wash sale under current law. Congress has considered proposals to extend the rule to digital assets, so the exemption is not guaranteed to survive future legislation.

Reporting Wash Sales on Your Tax Return

Wash sales go on Form 8949, one transaction per row. Put Code W in Column (f) to flag the wash sale adjustment, and enter the disallowed loss as a positive number in Column (g).8Internal Revenue Service. Instructions for Form 8949 The Form 8949 totals feed into Schedule D on your Form 1040.

Most brokerages flag wash sales on your 1099-B, but only within a single account at that firm. If you trade the same security at more than one broker, or across a taxable account and an IRA, the tracking is on you. A wash sale reported incorrectly can bring an accuracy-related penalty of 20% of the resulting underpayment.9eCFR. 26 CFR 1.6662-2 – Accuracy-Related Penalty For heavy traders with positions spread across firms, a tax professional often pays for itself just in the cross-account reconciliation.