Wash Sale Rule Calculator
Determine if your security trades trigger the IRS wash sale rule and disallow tax-loss deductions.
Wash Sale Rule Input
Date you bought the security.
Price paid for one share.
Number of shares purchased.
Date you sold the security.
Price received for one share.
Number of shares sold.
Date of a substantially identical security purchase within 30 days before or after the sale date. Leave blank if none.
Price paid per share for the substantially identical security. Leave blank if none.
Number of shares purchased for the substantially identical security. Leave blank if none.
Wash Sale Rule Explained
What is the Wash Sale Rule?
The wash sale rule is an IRS regulation designed to prevent taxpayers from generating artificial tax losses by selling a security and then repurchasing it (or a substantially identical one) shortly thereafter. If you sell a security for less than you paid for it (incurring a capital loss) and then buy the same or a substantially identical security within 30 days before or after the sale date, the loss deduction from that sale is disallowed for the current tax year. Instead, the disallowed loss is added to the cost basis of the replacement security, effectively deferring the loss recognition until the replacement security is eventually sold without triggering another wash sale.
Who should use this calculator: Investors, traders, and financial advisors who want to understand the tax implications of their selling decisions, particularly when they plan to re-enter a position or have engaged in rapid trading strategies. It’s crucial for anyone looking to claim capital losses on their tax returns.
Common misconceptions:
- Thinking it only applies to the exact same security: The rule applies to “substantially identical” securities, which can include different share classes or options on the same underlying asset.
- Ignoring the 61-day window: The wash sale rule has a 61-day period: 30 days before the sale, the sale day itself, and 30 days after the sale. Any “tainted” purchase within this period can trigger it.
- Believing losses are lost forever: The loss isn’t lost; it’s deferred. The disallowed loss is added to the cost basis of the replacement security, adjusting its tax profile.
- Focusing only on buying after selling: The rule also applies if you bought a substantially identical security *before* selling the original one at a loss, within the 61-day window.
Wash Sale Rule Formula and Mathematical Explanation
The core of the wash sale rule involves comparing dates and determining if a “substantially identical” security was acquired within the 61-day window (30 days prior to sale, the sale day, and 30 days after sale) relative to a sale at a loss.
Step-by-Step Derivation:
- Calculate Realized Gain or Loss:
Realized Gain/Loss = (Sale Price Per Share * Sale Quantity) - (Purchase Price Per Share * Purchase Quantity) - Determine if Loss Exists: The wash sale rule is only relevant if the result from Step 1 is negative (a capital loss).
- Check for Substantially Identical Security Acquisition: Identify if a purchase of a substantially identical security occurred. This includes:
- A purchase of the same security.
- A purchase of a different security deemed substantially identical by the IRS (e.g., different classes of stock in the same company, certain ETFs that track the same index).
- Acquisition of a contract or option to buy such a security.
- Check the 61-Day Window: Verify if the acquisition date(s) of the substantially identical security fall within the 61-day period around the sale date. This period includes:
- The 30 days *before* the sale date.
- The sale date itself.
- The 30 days *after* the sale date.
- Determine Wash Sale Status:
- If Step 2 shows a loss AND Step 4 confirms a substantially identical security was acquired within the 61-day window, then a Wash Sale has occurred.
- If either condition is not met, no Wash Sale has occurred.
- Calculate Wash Sale Impact (if applicable):
Wash Sale Loss Disallowance = Realized Loss (from Step 1)This amount becomes part of the cost basis of the replacement security.
Variable Explanations:
| Variable | Meaning | Unit | Typical Range |
|---|---|---|---|
| Purchase Date | Date shares were originally bought. | Date | Past Dates |
| Purchase Price Per Share | Cost paid per share at original purchase. | Currency (e.g., USD) | ≥ 0 |
| Purchase Quantity | Number of shares bought at original purchase. | Count | ≥ 1 |
| Sale Date | Date shares were sold. | Date | Future of Purchase Date |
| Sale Price Per Share | Proceeds received per share at sale. | Currency (e.g., USD) | ≥ 0 |
| Sale Quantity | Number of shares sold. | Count | ≥ 1 |
| Substitute Purchase Date | Date a substantially identical security was bought within the 61-day window. | Date | Within 30 days before/after Sale Date |
| Substitute Purchase Price Per Share | Cost paid per share for the substantially identical security. | Currency (e.g., USD) | ≥ 0 |
| Substitute Purchase Quantity | Number of shares bought of the substantially identical security. | Count | ≥ 1 |
| Net Sale Proceeds | Total cash received from the sale. | Currency (e.g., USD) | Calculated |
| Total Purchase Cost | Total cost of the originally purchased shares. | Currency (e.g., USD) | Calculated |
| Realized Gain/Loss | Profit or loss from the sale before wash sale adjustments. | Currency (e.g., USD) | Calculated |
| Wash Sale Impact | The amount of loss disallowed due to the wash sale rule. | Currency (e.g., USD) | Calculated (≥ 0 if loss disallowed) |
Practical Examples (Real-World Use Cases)
Example 1: Loss Disallowed Due to Wash Sale
An investor sells 100 shares of XYZ Corp. at a loss, then buys shares of XYZ Corp. again shortly after.
Inputs:
- Purchase Date: 2023-01-15
- Purchase Price Per Share: $50
- Purchase Quantity: 100
- Sale Date: 2023-02-10 (Loss)
- Sale Price Per Share: $40
- Sale Quantity: 100
- Substantially Identical Property Purchase Date: 2023-02-20 (within 30 days of sale)
- Substantially Identical Property Purchase Price Per Share: $42
- Substantially Identical Property Purchase Quantity: 100
Calculation Breakdown:
- Total Purchase Cost: 100 shares * $50/share = $5,000
- Net Sale Proceeds: 100 shares * $40/share = $4,000
- Realized Gain/Loss: $4,000 – $5,000 = -$1,000 (a loss)
- Wash Sale Check: A loss was realized. A substantially identical security (XYZ Corp.) was purchased on 2023-02-20. This date is within 30 days *after* the sale date of 2023-02-10.
- Result: Wash Sale Occurs.
- Wash Sale Impact: $1,000
Financial Interpretation: The investor cannot claim the $1,000 capital loss on their taxes for 2023. This $1,000 loss is added to the cost basis of the newly purchased 100 shares of XYZ Corp. The new cost basis for these shares becomes $4,200 (purchase price) + $1,000 (disallowed loss) = $5,200. The investor effectively deferred the tax benefit of the loss.
Example 2: No Wash Sale Triggered
An investor sells a stock at a loss but waits more than 30 days to repurchase it.
Inputs:
- Purchase Date: 2023-03-01
- Purchase Price Per Share: $100
- Purchase Quantity: 50
- Sale Date: 2023-04-15 (Loss)
- Sale Price Per Share: $80
- Sale Quantity: 50
- Substantially Identical Property Purchase Date: 2023-06-01 (More than 30 days after sale)
- Substantially Identical Property Purchase Price Per Share: $85
- Substantially Identical Property Purchase Quantity: 50
Calculation Breakdown:
- Total Purchase Cost: 50 shares * $100/share = $5,000
- Net Sale Proceeds: 50 shares * $80/share = $4,000
- Realized Gain/Loss: $4,000 – $5,000 = -$1,000 (a loss)
- Wash Sale Check: A loss was realized. However, the repurchase date (2023-06-01) is more than 30 days after the sale date (2023-04-15).
- Result: No Wash Sale Occurs.
- Wash Sale Impact: $0
Financial Interpretation: The investor can claim the $1,000 capital loss on their taxes for 2023, subject to capital loss limitations. The repurchase of the shares on 2023-06-01 establishes a new, independent cost basis of $85 per share ($4,250 total).
How to Use This Wash Sale Rule Calculator
Our Wash Sale Rule Calculator simplifies the complex IRS regulations. Follow these steps to use it effectively:
- Enter Original Purchase Details: Input the exact Purchase Date, Purchase Price Per Share, and Purchase Quantity for the security you are analyzing.
- Enter Sale Details: Provide the Sale Date, Sale Price Per Share, and Sale Quantity for the transaction that resulted in a loss.
- Enter Substitute Purchase Details (if applicable): If you purchased a security that is “substantially identical” to the one you sold at a loss within the 61-day window (30 days before, the sale day, or 30 days after), enter the Substantially Identical Property Purchase Date, Price Per Share, and Quantity. If no such purchase occurred, leave these fields blank.
- Click “Calculate”: The calculator will process your inputs.
How to Read Results:
- Wash Sale Status: This clearly states “Wash Sale Occurs” or “No Wash Sale Occurs”.
- Net Sale Proceeds: The total amount received from selling the shares.
- Total Purchase Cost: The total amount paid for the shares that were sold.
- Realized Gain/Loss: The profit or loss from the sale before considering the wash sale rule. A negative number indicates a loss.
- Wash Sale Impact: If a wash sale occurred, this shows the amount of capital loss that is disallowed for the current tax year.
Decision-Making Guidance:
- If the calculator indicates “Wash Sale Occurs”, understand that your capital loss deduction is deferred. The disallowed loss gets added to the cost basis of your replacement, substantially identical security.
- If “No Wash Sale Occurs”, you can generally claim the realized capital loss, subject to other tax rules and limitations (like the $3,000 per year limit for net capital losses against ordinary income).
- Use this tool before making a sale if you plan to repurchase a similar security quickly, allowing you to structure your trades to manage tax implications effectively. Consider consulting a tax professional for personalized advice.
Key Factors That Affect Wash Sale Results
Several factors influence whether a wash sale is triggered and its impact:
- Timing of Transactions: This is the most critical factor. The 61-day window (30 days before, day of, and 30 days after the sale) is paramount. Even a one-day overlap can trigger the rule if a loss is involved.
- Definition of “Substantially Identical”: This is not always clear-cut. While the exact same stock ticker is the most obvious case, the IRS may consider securities like different share classes of the same company, or ETFs tracking very similar indices, as substantially identical. Options on the same underlying stock can also trigger it.
- Realizing a Loss: The wash sale rule only applies if you sell a security at a capital loss. If you sell at a gain, the rule is irrelevant for that specific transaction, regardless of subsequent purchases.
- Acquisition Method: The rule applies whether you buy the replacement security directly, through a broker, in an IRA/retirement account (though the tax impact differs), or if a spouse or controlled entity buys it.
- Quantity of Shares: While the rule can be triggered by a partial sale and repurchase, the quantities involved in both the sale and the subsequent repurchase matter for calculating the exact amount of disallowed loss. Purchasing more shares than were sold at a loss won’t negate the wash sale if the *type* of security is substantially identical and within the window.
- Cost Basis of Replacement Security: When a wash sale occurs, the disallowed loss is added to the cost basis of the replacement shares. This increases the cost basis, which in turn reduces any future capital gains or increases future capital losses when the replacement shares are eventually sold.
- Record Keeping: Meticulous records of all purchase and sale dates, prices, quantities, and details of any “substantially identical” securities are essential for correctly applying the wash sale rule and for audit purposes.
Frequently Asked Questions (FAQ)
A: The wash sale rule only applies to sales resulting in a capital loss. If you sell at a gain, there is no wash sale consequence, and you can repurchase the security immediately without affecting your current tax situation. You simply recognize the capital gain.
A: Yes, it can apply. If you sell shares of a mutual fund or ETF at a loss and then purchase shares of the *same* fund or ETF within the 61-day window, it’s a wash sale. It can also apply if you purchase shares of another fund or ETF that is considered “substantially identical” (e.g., two ETFs tracking the exact same index).
A: Selling a security at a loss in a taxable account and then buying a substantially identical security in an IRA or retirement account *does* trigger the wash sale rule. The loss in the taxable account is disallowed. However, the disallowed loss is not added to the cost basis of the replacement security within the tax-advantaged account, as gains/losses within IRAs are generally not taxed.
A: Yes. The IRS considers purchases made by your spouse (or a dependent) within the 61-day window as potentially triggering the wash sale rule for your sale at a loss.
A: The IRS doesn’t provide an exhaustive list. Generally, it means securities with very similar risk, return, and characteristics. The same stock, a successor corporation’s stock (e.g., after a merger), or certain options or convertible securities might qualify. Tax professionals often rely on IRS guidance and court cases for interpretation.
A: You must calculate the gain or loss on each lot of shares sold. The wash sale rule applies specifically to the lots sold at a loss. If you sell 200 shares, 100 at a $10 gain and 100 at a $15 loss, and then repurchase substantially identical shares within the window, only the $15 loss is subject to the wash sale rule. The $10 gain is recognized.
A: Yes. The IRS guidance treats cryptocurrency as property, and the wash sale rules generally apply to crypto transactions where a taxpayer sells a cryptocurrency at a loss and then buys the same or a substantially identical cryptocurrency within the 61-day window.
A: To completely avoid triggering the wash sale rule on a specific sale at a loss, you must wait *more than* 30 days after the sale date before purchasing the substantially identical security. This means the purchase date must be on the 31st day or later following the sale date.
Related Tools and Internal Resources
Chart showing the gain/loss calculation and wash sale impact.
| Detail | Original Purchase | Sale Transaction | Substantially Identical Purchase | Result |
|---|---|---|---|---|
| Date | N/A | N/A | N/A | |
| Price Per Share | N/A | N/A | N/A | |
| Quantity | N/A | N/A | N/A | |
| Total Value | N/A | N/A | N/A | |
| Calculated | ||||
| Net Sale Proceeds | N/A | |||
| Total Purchase Cost | N/A | |||
| Realized Gain/Loss | N/A | |||
| Wash Sale Status | N/A | |||
| Wash Sale Impact (Disallowed Loss) | N/A | |||