Wash Sale Rule: The 30-Day Window, What Is Substantially Identical, and a Checker

If you sell a stock or fund at a loss and buy the same thing, or something substantially identical, within 30 days before or after the sale, the tax law will not let you deduct that loss this year. The loss is postponed, not lost (unless the purchase was in your IRA): it moves into the cost of the shares you bought. Here is how the window works, what counts, and a checker for your own dates.

Updated November 19, 2026

The window: 61 days around the sale

The statute disallows the loss when, "within a period beginning 30 days before the date of such sale or disposition and ending 30 days after such date," you acquired substantially identical stock or securities, or a contract or option to acquire them (26 U.S.C. 1091(a)). Counting the day of the sale, that is 61 days. IRS Publication 550 lists the ways to have a wash sale: you buy substantially identical stock or securities, acquire them in a fully taxable trade, acquire a contract or option to buy them, or acquire substantially identical stock for your IRA or Roth IRA.

Two things surprise people. The window looks backwards as well as forwards, so a purchase made 30 days before you sell can disallow the loss. And it is not limited to the account you sold in: purchases in your IRA or Roth IRA count, and so do purchases by your spouse.

Check your own dates

The checker opens on the example in Publication 550. Replace it with your sale and the purchases you made around it. List only purchases you judge to be substantially identical to what you sold.

The sale at a loss

Purchases of the same or a substantially identical security

Purchase 1
Purchase 2

$750.00 of the $1,000.00 loss is disallowed; $250.00 is allowed.

The window runs from 2024-12-04 to 2025-02-02 (30 days either side of the sale, both ends counted). A purchase on or after 2025-02-03 is outside it.

BoughtDays from saleIn windowShares matchedAdded to basisNew basisHolding period
2024-12-13-21Yes50$500.00$3,250.00Adds the 105 days you held the sold shares
2024-12-20-14Yes25$250.00$1,375.00Adds the 105 days you held the sold shares

The checker treats every purchase you list as substantially identical to what you sold; whether a purchase is, is your call and, if it is close, a tax professional's. It handles one sale at a time and does not model dealers, short sales or options.

What is "substantially identical"?

The statute does not define it. Publication 550 says you must "consider all the facts and circumstances in your particular case." Ordinarily, stocks or securities of one corporation are not substantially identical to those of another, though in a reorganization the predecessor and successor corporations can be. Bonds or preferred stock of a corporation are not ordinarily identical to its common stock, but they can be where they are convertible into the common stock and the relative values, price changes and other circumstances line up. Publication 550's test for preferred stock: it is substantially identical to the common stock if it is convertible into it, has the same voting rights, is subject to the same dividend restrictions, trades at prices that do not vary significantly from the conversion ratio and is unrestricted as to convertibility.

The publication does not say how this applies to funds that hold similar baskets of stocks, and no IRS list says which funds are safe to swap. That judgement is yours and your tax professional's. Do not treat a replacement as safe because it has a different ticker.

Where the disallowed loss goes

Publication 550: "add the disallowed loss to the cost of the new stock or securities," and the new shares' holding period "includes the holding period of the stock or securities sold." The deduction is postponed until you sell the new shares.

The Publication 550 example: 100 shares bought on September 20, 2024 for $5,000 and sold on January 3, 2025 for $4,000, a $1,000 loss. You bought 50 shares on December 13, 2024 for $2,750 and 25 shares on December 20, 2024 for $1,125, both inside the window. Only 75 of the 100 shares sold have a matching purchase, so $750 is disallowed and $250 is allowed. The disallowed loss is spread over the shares bought, in the order you bought them:

BoughtSharesCostLoss addedNew basis
2024-12-1350$2,750$500$3,250
2024-12-2025$1,125$250$1,375

When you buy more or fewer shares than you sold, the rule applies to the shares you can match one for one, matched in the order bought, earliest first (Publication 550, "More or less stock bought than sold").

IRAs, your spouse, and accounts you forget

  • Your IRA or Roth IRA. A purchase there is a wash sale. Publication 550 adds the disallowed loss to the cost of the new shares "except" for IRA purchases, so there is no basis in the IRA to carry the loss.
  • Your spouse. If you sell and your spouse or a corporation you control buys substantially identical stock, you have a wash sale.
  • Purchases before the sale. The window includes the 30 days before, so check what you bought recently, including purchases that happen automatically, before you sell.
  • Options and contracts. The rules apply to contracts and options to acquire or sell stock or securities. Publication 550 says they do not apply to commodity futures contracts or foreign currencies.
  • Dealers. The rule does not apply to a dealer in stock or securities for a loss in the ordinary course of that business.

How the wash sale rule meets tax-loss harvesting

Harvesting a loss only works if the loss is allowed. The usual ways to keep it allowed are to wait until the window has closed (the checker shows the first day outside it) or to put the money in something that is not substantially identical. If you want to keep your position in the market during the wait, that second choice is the one that needs the judgement above. To see what a harvested loss is worth against your gains, income and the Net Investment Income Tax, use the tax-loss harvesting calculator on the capital gains calculator page. A disallowed loss is not a harvested loss: take it out of the figures you enter there.

Reporting a wash sale

Report it in Part I or Part II of Form 8949 with the appropriate box checked, enter "W" in column (f) and the loss not allowed as a positive number in column (g) (Publication 550). Form 1099-B box 1g will show the disallowed loss if the securities sold were covered securities and the replacement had the same CUSIP and was bought in the same account. Publication 550 is explicit that you cannot deduct the loss even when the form does not show it, so a broker's statement can miss a wash sale across your accounts, your IRA or your spouse's.

The sources behind this guide

Related: capital gains tax calculator and its methodology.

Frequently asked questions

What is the wash sale rule?

If you sell stock or securities at a loss and, within 30 days before or after the sale, buy substantially identical stock or securities, you cannot deduct the loss (26 U.S.C. 1091(a); IRS Publication 550). The loss is not erased: it is added to the cost of the new shares, unless the purchase was for your IRA or Roth IRA.

How long is the wash sale window?

61 days: the 30 days before the sale, the day of the sale and the 30 days after it. A purchase on day 30 after the sale is inside it; one on day 31 is not.

Does the wash sale rule apply to gains?

No. The rule disallows a loss (1091(a)). A sale at a gain is taxed as usual whatever you buy afterwards.

Does buying in my IRA trigger a wash sale?

Yes. IRS Publication 550 lists acquiring substantially identical stock for your IRA or Roth IRA as a wash sale. It also says the disallowed loss is added to the cost of the new shares "except" in that case, so nothing in the IRA postpones the loss to a later sale.

Does my spouse's purchase count?

Yes. Publication 550: if you sell stock and your spouse or a corporation you control buys substantially identical stock, you also have a wash sale.

What happens to the loss that is disallowed?

Unless the purchase was for your IRA or Roth IRA, it is added to the cost of the new shares, which postpones the deduction until you sell them. The new shares’ holding period includes the holding period of the ones you sold (Publication 550).

What counts as substantially identical?

There is no list. Publication 550 says to consider all the facts and circumstances; stock of one corporation is ordinarily not substantially identical to stock of another, and bonds or preferred stock are not ordinarily identical to the same company’s common stock unless, for example, they are convertible into it and trade closely with it.

How do I report a wash sale?

On Form 8949 with the right box checked, with "W" in column (f) and the disallowed loss as a positive number in column (g). Form 1099-B box 1g shows it only in some cases, and the loss is disallowed even when the form does not show it (Publication 550).

Last updated: November 2026Report an error

This guide is for educational purposes only and does not constitute financial advice. Rules and figures change. Check with a licensed professional before you act on it. Full disclaimer →