Home › Wash Sale Rule

Guide toForm 8949, code W

The Wash Sale Rule

Sell a stock at a loss and buy the same or a substantially identical one within 30 days before or after, and the IRS won’t let you deduct the loss — yet. The loss isn’t gone; it’s added to the cost of the new shares.

2026

Checked against IRS Publication 550: Wash sales and 1 more official source on November 25, 2026. How we check

The 61-day window

A wash sale happens when you sell stock or securities at a loss and, within 30 days before or 30 days after the sale, you:

That’s a 61-day window: 30 days before, the sale date and 30 days after.

What happens to the loss

The disallowed loss is added to the cost basis of the replacement shares, and your holding period for the new shares includes the time you held the old ones. You get the loss later, when you sell the replacement shares without triggering another wash sale.

Example. You buy 100 shares at $50 ($5,000), sell them on November 3 for $3,800 (a $1,200 loss), then buy 100 shares back on November 20 for $3,900. The $1,200 loss is disallowed. Your new basis is $3,900 + $1,200 = $5,100. Sell later for $5,300 and your gain is only $200.

The IRA trap

Buying the same stock in your IRA or Roth IRA within the window also triggers a wash sale — and in that case the loss isn’t added to the IRA basis, so it’s effectively lost for good. Watch automatic dividend reinvestment and recurring IRA purchases when you harvest losses in a taxable account.

What is “substantially identical”?

It depends on the facts. Shares of the same company are identical; shares of different companies normally aren’t. Two index funds that track the same index from different fund companies are a gray area the IRS hasn’t settled. Many investors swap into a fund that tracks a different index to stay clearly outside the rule.

How it shows up on your tax forms

Brokers report wash sales on Form 1099-B (box 1g, “wash sale loss disallowed”) for the same security in the same account. On Form 8949 the adjustment uses code W. Brokers don’t track purchases in other accounts — including your spouse’s or your IRA — so those are your responsibility.

Harvesting losses safely

Frequently asked questions

What is the wash sale rule?

If you sell stock or securities at a loss and buy substantially identical ones within 30 days before or after, the loss is disallowed and added to the basis of the new shares.

Does the wash sale rule apply to an IRA purchase?

Yes. Buying the same security in your IRA or Roth IRA within the window triggers a wash sale, and the loss is not added to the IRA’s basis.

Is a wash sale loss lost forever?

Usually not. It is added to the cost of the replacement shares and recognized when you sell them — except when the replacement was bought in an IRA.

Sources

Last updated: . Figures reflect IRS, SSA and CMS guidance published as of this date.