Wash Sale Rule: Maximizing Tax Deductible Losses when Investing

Are you an investor that plans to re-purchase an asset after selling it in the past? If so, the wash sale rule, as defined by the IRS, might have serious implications on how losses can be reported on your taxes!
wash sale rules banner alpharithms

Wash sales are defined as the purchase of a “substantially identical” asset or security within 30 days before or after sale resulting in a loss.  A wash sale can also occur if a “substantially identical” purchase is made by a spouse of the original holder or by a company of which they control1.

The wash sale rule is defined within publication 550 by the U.S. Internal Revenue Service (IRS) and avoids some types of tax fraud. For example, the wash sale rule prevents a loss resulting from a sale of an asset from offsetting gains from the sale of that same asset within a certain period of time.


The wash sale rule prevents cases where someone might sell an asset for a loss, then immediately re-purchase that asset; essentially allowing for tax deductions of unrealized losses (given the “loss” of the asset was immediately remedied.) The intent of the wash sale rule is to “frustrate” the practice of tax-loss harvesting.

In such cases, one would be able to claim a loss on taxes without actually losing anything. The wash sale rule covers a range of assets and a fairly wide time period, but an exaggerated case for the motivation of the wash sale rule is as follows:

  • Pat purchases 100 shares of XYZ at $100 per share for a total cost basis of $1,000.
  • The price of XYZ falls to $50 per share and Pat sells the entire position, realizing a $500 loss.
  • Pat immediately re-purchases 100 shares of XYZ at $50 per share for a total cost basis of $500.
  • Pat now has a realized capital loss of $500 but still holds 100 shares of XYZ.

In this scenario, without a wash sale rule, Pat would be able to claim a $500 tax-deductible capital loss. However, if the price of XYZ were to return to $100 per share, Pat would not have actually lost any capital — essentially providing a phantom capital loss.

Wash Sale Qualifications

The wash sale rule affects a number of different asset types including stocks, securities, Exchange Traded Funds (ETFs), options, futures contracts, and even straddle purchases of real property. All these asset classes are subject to wash sale trading in the following cases:

  1. A “substantially identical” purchase is made;
  2. A “substantially identical” position is acquired in a fully-taxable trade;
  3. A contract or option to acquire a “substantially identical” asset is purchased;
  4. A “substantially identical” asset is acquired for one’s individual retirement arrangement (IRA) or Roth IRA.

Notice the term “substantially identical” having been copiously highlighted via quotation marks. This term is somewhat ambiguous, but is described in IRS publication 550 as follows:

In determining whether stock or securities are substantially identical, you must consider all the facts and circumstances in your particular case. Ordinarily, stocks or securities of one corporation are not considered substantially identical to stocks or securities of another corporation. However, they may be substantially identical in some cases.

This is obvious for the repurchasing of stock of the same company, or even for ETF funds related to the same assets sold by different brokers. However, some possible edge cases where one stock or asset might be substantially similar include the following:

  • A sale of Stock XYZ just before XYZ is acquired by ABC. In this case, the purchase of ABC might constitute a wash sale if made within 30 days of the sale of XYZ.
  • Bonds or preferred stock may be subject to the wash sale rule in cases where common stock was sold and those bonds or preferred stock are convertible into common stock of that same company.

It is also worth noting that the wash sale rule only applies to the same number of assets that were sold. For example, if 100 shares of ABC were sold on day 1, and 150 shares were purchased on day 15, only the first 100 shares would be subject to the wash-sale rule (taken as an extension to the initial 100-share holding period). The additional 50 shares would be regarded as a newly-established position.

Wash Sale Period

wash sale rule window alpharithms 1
Figure 1: Illustration of the 30-days previous, 30-days following, and day-of segments of the wash-sale qualification window — amounting to 61 days total (plus the remainder of the trade day)

The wash sale rule defines qualifying periods as being 30-days prior and 30-days after a sale, resulting in a total window of 60 days in which one cannot make a “substantially identical” purchase of an asset or security. However, the day a sale is made does not constitute being either before or after. This results in a 61-day waiting period total, such that one can make a substantially identical trade on the 61st day after the initial.

Example Wash Trade Window Calculation

Consider the sale of 100 shares of XYZ on September 1st. To repurchase 100 shares of XYZ without being subject to the wash sale rule, one would have to wait the rest of September 1st, then the 30-days beginning September 2nd running through October 1st, such that subsequent purchase could be made on October 2nd without being subject to the wash trade rule.

Note: The 61-day wash sale period is accounted for in calendar days, not business or trading days.

IRA Accounts & Wash Sales

Per the IRS Rev. Rul 2008-5 related to 26 CFR 1.1091-1 Losses from wash sales of stock or securities, wash sale rulings apply to stocks or securities purchased by Roth IRA accounts2. This rule outlines the case where an individual has recently sold a stock or security for a loss, and would then be subject to a wash trade rule should a Roth IRA trust account under the direction of that individual also intend to purchase the same asset.

Example Wash Sale Trading

Consider a stock trader Pat. Pat purchases 100 shares of ABC on June 1st at a price of $10 per share for a total cost basis of 100 * $10 = $1,000 USD. Now consider the scenario where the market sees a substantial downturn such that, on August 1st of that same year, the price of ABC is trading at $6.

Pat, in an attempt to limit further loss, sells all 100 shares of ABC at $6 per share for a total of 100 * $6 = $600USD resulting in a $400 USD loss (40%). At this point, a re-purchase of ABC might be considered a wash sale, depending on when the next purchase is made.

Case 1: Wash Sale Trade

Pat repurchases 100 shares of ABC on August 15th which is firmly within the 30-day window. As such, Pat cannot include a $400 capital loss deduction on that year’s taxes. That loss will simply be added to Pat’s cost basis for the original position.  Also, the holding period of the initial period is extended to the holding period of the second purchase position.

Case 2: Non-Wash Sale Trade

Pat repurchases 100 shares of ABC on September 15th which is firmly outside the 30-day wash sale window. As such, Pat is able to include a $400 capital loss deduction on that same year’s taxes, consider the holding period of the new position to start from September 15th, and overall not be subjected to the wash-sale rule.

Avoiding Wash Sale Rules

There is no way to “avoid” a wash sale rule directly for a specific asset. If one repurchases a “substantially identical” position it will be subject to wash sale rules unless, perhaps, during the 30 days following the sale, the purchaser obtains their broker license and the following purchase was a result of a broker-related activity.

In a more functional sense, market exposure can still be repositioned within the wash sale window. For example, consider XYZ as a tech company and a sale of XYZ having occurred on day 1. To maintain market exposure, the purchase of a tech ETF could be made without being subject to the wash sale rule. Read this article for more information on that type of consideration.


How does a wash sale affect the holding period of the initial asset?

Per IRS publication 5501; “Your holding period for substantially identical stock or securities you acquire in a wash sale includes the period you held the old stock or securities.”

 What Type of Assets Are Subject to Wash Sale Rule

The Wash Sale rule encompasses stocks, securities, futures contracts, options, a Straddle,

Are there any exceptions or exemptions for the wash sale rule?

Yes. Dealers in stocks are excluded from the wash sale rule.

Does my broker handle wash sale calculations?

Yes. Form 1099-B will report the amount of wash sale losses that are disallowed in box 1-G. However — as noted by the IRS in publication 5501, losses from wash sales cannot be deducted even if they are not included in this box.

Where/how do I report wash sales?

Per IRS publication 550, wash sale transactions are reported in PartI or PartII of Form 8949 such that the appropriate box is ticked to indicate relevancy.

Final Thoughts

The wash sale rule, annoying as it might be for some activities such as day trading, serves an important role in the prevention of tax evasion. The 61-day window during which a sale and subsequent repurchase of an asset should be carefully considered by investors that seek to maximize tax benefits of realized capital losses for a particular taxable period.

It is important to realize that the wash trade rule doesn’t prevent one from making trades and is only related to how losses from the sale of purchases are taxed. For example, day traders often trade the same asset many times over a given period, including same-day sales and purchases. The wash sale rule doesn’t prevent these types of trading activities but does have implications on how the losses are taxed.


  1. Internal Revenue Service. “Publication 550: Investment Income and Expenses (Including Capital Gains and Losses).” Accessed: 6/22/2022. Available: https://web.archive.org/web/20220617185626/https://www.irs.gov/publications/p550 https://www.irs.gov/publications/p550
  2. Internal Revenue Service. “Rev. Rul. 2008-5.”  Accessed: 6/22/2022. Available: https://web.archive.org/web/20220421155139/https://www.irs.gov/pub/irs-drop/rr-08-05.pdf
Zαck West
Full-Stack Software Engineer with 10+ years of experience. Expertise in developing distributed systems, implementing object-oriented models with a focus on semantic clarity, driving development with TDD, enhancing interfaces through thoughtful visual design, and developing deep learning agents.