Wash Sale Calculator
Easily calculate your disallowed loss from a wash sale and determine the adjusted cost basis for your replacement shares. This tool helps you stay compliant with IRS rules for tax-loss harvesting.
Wash Sale Details
The price at which you sold each share at a loss.
The total number of shares sold in the transaction that resulted in a loss.
The original price you paid for each share you sold.
The price you paid for the new, substantially identical shares.
The number of new shares purchased within the 61-day wash sale window.
Disallowed Loss
Initial Total Loss
Recognized (Deductible) Loss
New Cost Basis per Share
Loss Breakdown: Recognized vs. Disallowed
Transaction Summary Table
| Transaction | Shares | Price per Share | Total Value | Adjustments |
|---|---|---|---|---|
| Initial Purchase | 100 | $50.00 | $5,000.00 | – |
| Sale Event | 100 | $45.00 | $4,500.00 | ($500.00 Loss) |
| Repurchase | 100 | $42.00 | $4,200.00 | – |
| New Position | 100 | $47.00 | $4,700.00 | (Adjusted Basis) |
What is a Wash Sale?
A wash sale occurs when you sell a security (like a stock, bond, or option) at a loss and, within 30 days before or after the sale (a 61-day window in total), you acquire a “substantially identical” security. The IRS wash sale rule prevents investors from creating an artificial tax deduction by selling a losing investment and immediately buying it back. Essentially, you can’t claim a tax loss if you haven’t truly changed your economic position. This rule is a critical component of tax-loss harvesting and requires careful attention. Using a wash sale calculator is the best way to ensure your calculations are accurate.
Anyone who invests in a taxable brokerage account should be aware of this rule. It applies to individual investors, traders, and even some retirement accounts if a sale in a taxable account is followed by a purchase in an IRA. A common misconception is that the rule only applies if you buy back the exact same stock; however, it also applies to “substantially identical” securities, such as options on the stock or certain convertible bonds of the same company. This is why a reliable wash sale calculator is an indispensable tool for active investors.
Wash Sale Formula and Mathematical Explanation
The calculation for a wash sale isn’t a single formula but a multi-step process to determine the disallowed loss and the new cost basis. Our wash sale calculator automates these steps for you.
- Calculate the Initial Loss: This is the straightforward loss from your sale.
Formula: (Sale Price per Share – Original Cost per Share) * Number of Shares Sold - Determine the Per-Share Loss: To apply the wash sale rule correctly, you need the loss on a per-share basis.
Formula: Initial Total Loss / Number of Shares Sold - Calculate the Disallowed Loss: This is the core of the wash sale rule. The loss is disallowed for the number of shares you replaced.
Formula: Per-Share Loss * Number of Repurchased Shares (up to the number sold) - Determine the Recognized Loss: This is the portion of the loss, if any, that you can still deduct on your taxes for the current year.
Formula: Initial Total Loss – Disallowed Loss - Calculate the New Adjusted Cost Basis: The disallowed loss isn’t lost forever; it’s added to the cost basis of the replacement shares. This defers the tax benefit until you sell the new shares.
Formula: (Total Cost of Repurchase + Disallowed Loss) / Number of Repurchased Shares
Variables Table
| Variable | Meaning | Unit | Typical Range |
|---|---|---|---|
| SP | Initial Sale Price per Share | USD ($) | $0.01+ |
| NS | Number of Shares Sold | Shares | 1+ |
| OC | Original Cost per Share | USD ($) | $0.01+ |
| RP | Repurchase Price per Share | USD ($) | $0.01+ |
| NR | Number of Shares Repurchased | Shares | 1+ |
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 price falls, and they sell all 100 shares at $40 per share, realizing a loss of $1,000. Ten days later, they repurchase 100 shares of XYZ Corp at $42 per share.
- Initial Loss: ($40 – $50) * 100 = -$1,000
- Shares Replaced: 100
- Disallowed Loss: $1,000 (The entire loss is disallowed because all shares were replaced).
- Recognized Loss: $0
- New Cost Basis: The $1,000 disallowed loss is added to the new purchase cost of $4,200 (100 shares * $42). The new total basis is $5,200, or $52 per share. The wash sale calculator shows this clearly.
Example 2: Partial Wash Sale
An investor buys 200 shares of ABC Inc. at $20 per share. They sell all 200 shares at $15 per share for a total loss of $1,000 ($5 per share loss). Within 30 days, they decide to get back into the position but only repurchase 50 shares at $16 per share.
- Initial Loss: ($15 – $20) * 200 = -$1,000
- Per-Share Loss: $5
- Shares Replaced: 50
- Disallowed Loss: $5 per share * 50 shares = $250.
- Recognized Loss: $1,000 (Initial Loss) – $250 (Disallowed Loss) = $750. The investor can deduct $750 this year.
- New Cost Basis: The cost of the new shares is 50 * $16 = $800. The new adjusted basis is $800 + $250 = $1,050, or $21 per share. Using a wash sale calculator is essential for this kind of partial scenario.
How to Use This Wash Sale Calculator
Our wash sale calculator is designed for simplicity and accuracy. Follow these steps to get your results:
- Enter Sale Information: Input the price per share you sold the security for, the number of shares sold, and your original purchase price (cost basis) per share.
- Enter Repurchase Information: Input the price per share you paid for the new, substantially identical shares and the number of shares you repurchased within the 61-day window.
- Review the Results Instantly: The calculator will automatically update to show your Disallowed Loss, your Recognized (deductible) Loss, and the all-important New Cost Basis Per Share for your replacement shares.
- Analyze the Chart and Table: Use the dynamic bar chart to visualize the split between deductible and deferred losses. The summary table provides a clear, step-by-step breakdown of your transactions, which is useful for record-keeping.
When reading the results, the “Disallowed Loss” is the key figure you cannot deduct this tax year. The “New Cost Basis per Share” is what you must use to calculate your capital gain or loss when you eventually sell the replacement shares. This figure is crucial for accurate future tax reporting.
Key Factors That Affect Wash Sale Results
Several factors can influence the outcome of a wash sale calculation. Understanding them is key to effective tax planning and properly using a wash sale calculator.
- Number of Shares Repurchased: This is the most direct factor. If you repurchase fewer shares than you sold, only a portion of your loss will be disallowed, as seen in our partial wash sale example.
- “Substantially Identical” Securities: The rule is not limited to the exact same stock. Buying a call option on the stock you just sold can also trigger a wash sale. The definition is complex, and it’s a key area where investors can make mistakes. Our guide on what is a wash sale provides more detail.
- Transactions Across Multiple Accounts: The IRS wash sale rule applies across all your accounts, including your IRA. If you sell a stock at a loss in your brokerage account and buy it back in your Roth IRA, the loss is permanently disallowed and not added to any basis.
- Timing of Repurchase: The 61-day window (30 days before, the day of sale, and 30 days after) is strict. A repurchase on day 31 is not a wash sale. Precise record-keeping of transaction dates is essential.
- Dividend Reinvestment Plans (DRIPs): If you sell shares at a loss and a dividend is reinvested automatically within the 61-day window, that automatic purchase can trigger a wash sale, often unexpectedly.
- Spouse’s Transactions: The IRS considers you and your spouse as a single entity for the wash sale rule. If you sell a stock at a loss and your spouse repurchases it within the window, the rule is triggered.
Frequently Asked Questions (FAQ)
There is no single IRS definition. However, it generally means securities that are economically the same. Common stock and preferred stock of the same company are usually not identical, but it depends on conversion rights. An S&P 500 ETF from one provider and an S&P 500 ETF from another are often considered substantially identical. Our wash sale calculator assumes the security you repurchased is identical.
The wash sale rule applies on a share-for-share basis. If you sell 100 shares at a loss and buy back 70, the loss on 70 shares is disallowed and added to their new basis. The loss on the other 30 shares is generally deductible. A good wash sale calculator handles this automatically.
No. The disallowed loss is added to the cost basis of the new shares. This reduces your capital gain (or increases your capital loss) when you eventually sell the new shares, effectively deferring the tax benefit. The exception is buying in an IRA, where the basis adjustment is lost.
No, the rule only applies to losses. You can sell a security for a gain and buy it back immediately without any special tax implications, though you will still owe capital gains tax on the sale.
The wash sale rule is the primary constraint on tax loss harvesting. To harvest a loss, you must sell a security and wait at least 31 days to repurchase it, or purchase a different, not substantially identical, security to maintain market exposure.
While brokers are required to report wash sales on Form 1099-B, their tracking is limited to a single account. They do not know if you repurchased a security in an account at another brokerage or in your spouse’s account. Therefore, you are ultimately responsible, and a wash sale calculator is a vital tool for consolidating your activity.
The holding period of the original shares is added to the holding period of the replacement shares. This can be beneficial, as it might allow a subsequent sale to qualify for long-term capital gains rates even if the replacement shares were held for a short time.
Historically, the rule did not apply to crypto as it wasn’t classified as a “security.” However, regulations are evolving, and it’s possible this could change. For now, consult a tax professional for the most current guidance on digital assets.