Enter the loss on the sale of the original security, the number of replacement shares purchased during the wash sale window (30 days before through 30 days after the sale), and the number of original shares sold into the calculator to determine the loss deferred (disallowed) under the wash sale rule.

Wash Sale Rule Calculator

Enter your trade details to see how much loss the IRS disallows and your new cost basis.

Wash Sale Impact
61-Day Window

Related Calculators

Wash Sale Rule Formula

The following simplified formula is used to estimate the loss deferred (disallowed) under the wash sale rule. The deferred loss cannot exceed the total realized loss.

LD = L \cdot \frac{\min(RS, OS)}{OS}

Variables:

  • LD is the loss deferred / disallowed ($)
  • L is the loss on the sale of the original security ($)
  • RS is the number of replacement shares purchased in the wash sale window
  • OS is the number of original shares sold

To estimate the loss deferred, multiply the total realized loss (L) by the fraction of shares replaced in the wash sale window (matched shares ÷ original shares sold). If RS is greater than or equal to OS, then the entire loss is deferred (LD = L).

What is a Wash Sale Rule?

The wash sale rule is an Internal Revenue Service (IRS) rule that generally disallows a capital loss deduction if you sell a security at a loss and, within 30 days before or 30 days after that sale (a 61‑day window), you buy the same or a “substantially identical” security (or enter into a contract or option to do so). In most taxable-account cases, the disallowed loss is added to the cost basis of the replacement shares and is effectively deferred until the replacement shares are sold.

How to Calculate Wash Sale Rule?

The following steps outline how to estimate the wash sale deferred loss using the formula: LD = L · (min(RS, OS) / OS).


  1. First, determine the total realized loss on the sale of the original security ($), denoted as L.
  2. Next, determine the number of replacement shares purchased in the wash sale window (30 days before through 30 days after the sale), denoted as RS.
  3. Next, determine the number of original shares sold, denoted as OS.
  4. Next, calculate the loss deferred ($), denoted as LD, using the formula LD = L · (min(RS, OS) / OS).
  5. Finally, interpret the result: LD is the amount of loss disallowed now and typically added to the basis of the matched replacement shares (in a taxable account).
  6. After inserting the variables and calculating the result, check your answer with the calculator above.

Example Problem : 

Use the following variables as an example problem to test your knowledge.

loss on the sale of the original security ($) = 500

number of replacement shares purchased in the wash sale window = 100

number of original shares sold = 50

Using the formula: LD = 500 · (min(100, 50) / 50) = 500. The deferred loss cannot exceed the total realized loss.