Wash Sale Rule Calculator
Calculate Your Wash Sale Impact
Adjusted Cost Basis per Share (New)
Total Disallowed Loss
Initial Capital Loss
Allowable Capital Loss
| Metric | Calculation | Value |
|---|---|---|
| Initial Investment Cost | Original Cost/Share × Shares Sold | $5,000.00 |
| Total Sale Proceeds | Sale Price/Share × Shares Sold | $4,500.00 |
| Initial Capital Loss | Initial Cost – Sale Proceeds | $500.00 |
| Disallowed Loss | Initial Loss × (Min(Sold, Replaced) / Sold) | $500.00 |
| Cost of Replacement Shares | Replacement Price/Share × Shares Replaced | $4,200.00 |
| New Total Adjusted Cost Basis | Cost of Replacement + Disallowed Loss | $4,700.00 |
| New Adjusted Basis Per Share | New Total Basis / Shares Replaced | $47.00 |
This table breaks down how the wash sale rule calculator determines the disallowed loss and new cost basis.
Comparison of original vs. adjusted cost basis for the replacement shares.
What is the Wash Sale Rule?
The wash sale rule is an IRS regulation that prevents taxpayers from claiming a capital loss on the sale of a security if they acquire a “substantially identical” security within 30 days before or after the sale. This 61-day window (30 days before, the day of the sale, and 30 days after) is designed to stop investors from generating artificial tax deductions without truly changing their investment position. A specialized **wash sale rule calculator** is an essential tool for investors to understand the tax implications of their trades.
Anyone who actively trades stocks, bonds, options, or other securities in a taxable brokerage account should be aware of this rule. It most commonly affects traders who use tax-loss harvesting strategies. A common misconception is that the loss is permanently lost. In reality, the wash sale rule defers the loss by adding it to the cost basis of the replacement shares. This means the tax benefit is realized when the new shares are eventually sold.
Wash Sale Rule Formula and Mathematical Explanation
Calculating the impact of a wash sale involves a few key steps. While a **wash sale rule calculator** automates this, understanding the math is crucial for any serious investor.
- Calculate Initial Capital Loss: This is the straightforward loss from the sale.
Initial Loss = (Original Cost per Share - Sale Price per Share) × Shares Sold - Determine the Disallowed Portion: The amount of the loss that is disallowed depends on the number of shares repurchased. If you repurchase fewer shares than you sold, the loss is disallowed on a pro-rata basis.
Disallowed Loss = Initial Loss × (Number of Replacement Shares / Number of Shares Sold)
*(Note: This applies when replacement shares are less than or equal to shares sold. If more shares are repurchased, only the loss corresponding to the original number of shares sold is disallowed and applied to an equal number of new shares).* - Calculate the New Adjusted Cost Basis: The disallowed loss is added to the purchase price of the new shares.
New Total Cost Basis = (Replacement Price per Share × Number of Replacement Shares) + Disallowed Loss - Determine the New Basis Per Share:
New Adjusted Basis per Share = New Total Cost Basis / Number of Replacement Shares
Variables Table
| Variable | Meaning | Unit | Typical Range |
|---|---|---|---|
| Sale Price | The price per share you sold the security at. | USD ($) | $0.01 – $10,000+ |
| Shares Sold | Quantity of shares sold in the transaction. | Shares (count) | 1 – 1,000,000+ |
| Original Cost | The price per share you originally paid for the security. | USD ($) | $0.01 – $10,000+ |
| Replacement Price | The price per share you paid for the new, identical security. | USD ($) | $0.01 – $10,000+ |
| Replacement Shares | Quantity of identical shares purchased within the 61-day window. | Shares (count) | 1 – 1,000,000+ |
Practical Examples (Real-World Use Cases)
Example 1: Full Wash Sale
An investor buys 100 shares of XYZ Corp at $50 per share. The stock drops, and they sell all 100 shares at $45 per share, realizing a loss of $500. Just one week later, they buy back 100 shares of XYZ Corp at $42 per share.
- Initial Loss: ($50 – $45) * 100 = $500
- Disallowed Loss: The entire $500 is disallowed because they repurchased the same number of shares.
- New Cost Basis: The cost of the new shares is (100 * $42) + $500 = $4,700.
- Adjusted Basis Per Share: $4,700 / 100 = $47. The investor can only claim the original $500 loss (plus or minus any new gain/loss) when they sell these new shares. Using a **wash sale rule calculator** confirms this adjusted basis.
Example 2: Partial Wash Sale
An investor owns 200 shares of ABC Inc. purchased at $30/share. They sell all 200 shares at $20/share for a total loss of $2,000. Within 30 days, they decide to re-enter the position but only buy 50 shares at $22/share.
- Initial Loss: ($30 – $20) * 200 = $2,000
- Disallowed Portion: Since only 50 of the 200 shares were replaced, only a portion of the loss is disallowed. Disallowed Loss = ($2,000 / 200 shares) * 50 shares = $500.
- Allowable Loss: The investor can still claim a $1,500 capital loss ($2,000 – $500) on their taxes for the current year.
- New Cost Basis: The cost of the new 50 shares is (50 * $22) + $500 = $1,600.
- Adjusted Basis Per Share: $1,600 / 50 = $32.
How to Use This Wash Sale Rule Calculator
This **wash sale rule calculator** is designed for simplicity and accuracy. Follow these steps:
- Enter Sale Details: Input the price per share at which you sold your security and the number of shares sold.
- Enter Original Cost: Provide the purchase price per share for the securities you sold. The calculator will automatically show the initial capital loss.
- Enter Replacement Details: Input the purchase price and number of shares for the “substantially identical” security bought within the 61-day window.
- Review the Results: The calculator instantly displays the **Total Disallowed Loss**, the **Allowable Capital Loss** you can claim now, and the **Adjusted Cost Basis** for your new shares. The chart and table provide a visual breakdown.
- Plan Your Next Move: Understanding the new cost basis is crucial for future sell decisions. This adjusted basis is what you’ll use to calculate capital gains or losses when you eventually dispose of the replacement shares.
Key Factors That Affect Wash Sale Results
- Timing of Repurchase: The most critical factor. A repurchase within 30 days before or after the loss sale triggers the rule. Waiting at least 31 days is the simplest way to avoid it.
- “Substantially Identical”: This is a key IRS term. Stock in the same company is identical. Options or convertible bonds for that same company are also considered substantially identical. However, stock in a different company in the same sector (e.g., selling Ford and buying GM) is generally not.
- Number of Shares Repurchased: As seen in the examples, repurchasing fewer shares than you sold leads to a partial wash sale, allowing you to deduct a portion of your loss.
- Transactions in Different Accounts: The rule applies across all your accounts, including IRAs. If you sell a stock at a loss in your brokerage account and buy it back in your Roth IRA, it’s a wash sale. Worse, you cannot add the disallowed loss to the IRA’s cost basis, meaning the loss is effectively lost forever for tax purposes.
- Spouses and Controlled Corporations: The rule also applies if your spouse or a corporation you control makes the replacement purchase. You cannot simply have your spouse buy the stock to circumvent the rule.
- Automated Investing/DRIPs: Dividend Reinvestment Plans (DRIPs) can unknowingly trigger a wash sale if a dividend is reinvested within the 61-day window of selling shares of the same stock at a loss. It is important to be mindful of these automatic transactions, which a good **wash sale rule calculator** can help analyze.
Frequently Asked Questions (FAQ)
This refers to securities that are the same in all important respects. Common stock and call options of the same company are substantially identical. Stock of two different companies in the same industry are not.
No, the rule only applies to losses. You are free to sell a security for a gain and buy it back immediately with no penalty.
You must wait 31 calendar days after the date of the sale at a loss before repurchasing the same or a substantially identical security.
This is a costly mistake. The loss in your taxable account is disallowed, but you cannot adjust the cost basis of the shares in the tax-advantaged IRA. The tax loss is permanently lost.
Currently, the IRS classifies cryptocurrency as property, not a security. Therefore, the wash sale rule does not apply to crypto trades, though this could change with future legislation.
Yes, the principle is the same. Buying a call option on a stock is considered acquiring a substantially identical security. Our calculator can be adapted by treating the option purchase as the replacement security.
You report the transaction on IRS Form 8949. You’ll enter the sale, and in column (g), you’ll enter the amount of the disallowed loss with code “W”. Your broker’s 1099-B statement will typically identify wash sales for you.
The rule applies 30 days *before* as well as after the sale. For example, if you buy 100 shares on January 15th, then sell another 100 shares of the same stock (that you owned previously) at a loss on January 25th, it is still a wash sale.
Related Tools and Internal Resources
- Capital Gains Calculator – A tool to estimate the taxes on your investment profits, which is often used alongside tax-loss harvesting strategies.
- Tax-Loss Harvesting Guide – Our in-depth guide on how to strategically sell losing investments to offset gains and lower your tax bill.
- Adjusted Cost Basis Explained – Learn more about how cost basis is calculated and adjusted for events like wash sales, stock splits, and dividends.
- Investment Portfolio Tracker – Keep track of all your holdings and their cost basis to make informed decisions and avoid accidental wash sales.
- Stock Holding Period Calculator – Determine whether your gains or losses are short-term or long-term, which has significant tax implications.
- Dividend Reinvestment (DRIP) Calculator – See how reinvesting your dividends can impact your portfolio’s growth and cost basis over time.