Wash Sale Calculator
A wash sale occurs when you sell a security at a loss and buy the same or a “substantially identical” one within 30 days before or after the sale. This calculator helps you determine the disallowed loss and the adjusted cost basis of the new shares according to IRS rules.
What is a Wash Sale?
A wash sale is a rule created by the Internal Revenue Service (IRS) to prevent investors from claiming artificial losses for tax purposes. The rule is triggered when an investor sells a security (like a stock or bond) at a loss and, within a 61-day period (30 days before the sale, the day of the sale, and 30 days after the sale), buys a “substantially identical” security. When a wash sale occurs, the tax loss from the sale is disallowed. Instead of being claimed in the current tax year, the loss is added to the cost basis of the new, replacement shares. This effectively defers the loss until the replacement shares are sold. Our wash sale calculator simplifies this complex calculation for you.
This rule applies to individual investors, traders, and even some entities. Anyone managing their own portfolio who engages in tax-loss harvesting needs to be acutely aware of the wash sale rule. 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, which can include options on the stock or certain bonds from the same issuer. Using a wash sale calculator is crucial for accurate tax reporting and avoiding issues with the IRS.
Wash Sale Formula and Mathematical Explanation
Understanding the math behind the wash sale rule is key to managing your investments effectively. The wash sale calculator automates these steps, but here’s a breakdown of the process.
- Calculate the Initial Loss: This is the straightforward loss from your sale.
Formula: (Sale Price per Share – Original Purchase Price per Share) * Number of Shares Sold - Determine the Number of Shares in the Wash Sale: The rule only applies to the number of shares you replaced. This is the lesser of the shares you sold and the shares you repurchased.
Formula: min(Number of Shares Sold, Number of Replacement Shares Purchased) - Calculate the Disallowed Loss: This is the portion of your initial loss that you cannot claim for tax purposes right now.
Formula: (Initial Loss / Number of Shares Sold) * Number of Shares in Wash Sale - Calculate the Adjusted Cost Basis: The disallowed loss is added to the total cost of your replacement shares. This new basis is used to calculate your gain or loss when you eventually sell the replacement shares.
Formula: (Replacement Price per Share * Replacement Shares) + abs(Disallowed Loss)
Using a wash sale calculator ensures these calculations are performed correctly, especially when dealing with partial repurchases.
Variables Table
| Variable | Meaning | Unit | Typical Range |
|---|---|---|---|
| Original Purchase Price | Cost per share of the security sold | USD ($) | $0.01 – $10,000+ |
| Sale Price | Price per share received upon selling | USD ($) | $0.01 – $10,000+ |
| Shares Sold | Quantity of shares sold | Shares (integer) | 1 – 1,000,000+ |
| Replacement Shares | Quantity of shares repurchased | Shares (integer) | 1 – 1,000,000+ |
| Disallowed Loss | The portion of the loss deferred | USD ($) | Depends on transaction |
| Adjusted Cost Basis | The new tax basis of the replacement shares | USD ($) | Depends on transaction |
Practical Examples (Real-World Use Cases)
Example 1: Full Wash Sale
An investor, Jane, wants to realize a loss for tax purposes but still believes in a stock’s long-term potential.
- Action 1: Jane sells 100 shares of XYZ Corp. at $40 per share. She had originally bought them for $50 per share. Her initial loss is ($40 – $50) * 100 = -$1,000.
- Action 2: 15 days later, she buys back 100 shares of XYZ Corp. at $42 per share.
Result: Because she bought back the same number of shares within 30 days, the entire $1,000 loss is disallowed. The $1,000 disallowed loss is added to the cost of her new shares. Her new total cost basis is (100 shares * $42) + $1,000 = $5,200, or $52 per share. She cannot claim the $1,000 loss on her taxes this year. A wash sale calculator would instantly show this adjustment.
Example 2: Partial Wash Sale
Another investor, Tom, sells shares but only repurchases a portion of them.
- Action 1: Tom sells 200 shares of ABC Inc. at $20 per share. He had bought them for $25 per share. His initial loss is ($20 – $25) * 200 = -$1,000.
- Action 2: 10 days later, he buys back only 50 shares of ABC Inc. at $19 per share.
Result: The wash sale rule applies only to the 50 shares he repurchased.
Loss per share = $5.
Disallowed Loss = 50 shares * $5/share = $250.
Allowable Loss = (200 shares sold – 50 wash sale shares) * $5/share = $750.
Tom can claim a $750 loss now. The $250 disallowed loss is added to the cost basis of his 50 new shares. The new total cost basis is (50 shares * $19) + $250 = $1,200, or $24 per share. This scenario highlights why a precise wash sale calculator is so valuable. For more complex scenarios, consider using a cost basis calculator to track your positions.
How to Use This Wash Sale Calculator
Our wash sale calculator is designed for simplicity and accuracy. Follow these steps to determine your tax implications:
- Enter Original Purchase Details: Input the price you paid per share and the number of shares you sold in the designated fields.
- Enter Sale Details: Input the price per share at which you sold the security. The calculator assumes this is a losing transaction.
- Enter Replacement Purchase Details: Input the number of shares you repurchased within the 61-day window and the price you paid for them.
- Review the Results: The wash sale calculator will instantly update. The “Disallowed Loss” is the primary result, showing the amount you cannot deduct. The “Allowable Loss” shows what you can still claim. “New Cost Basis per Share” and “Total Adjusted Cost Basis” show the adjusted value of your new holding for future tax calculations.
- Analyze the Visuals: The table and chart provide a clear, visual breakdown of the financial impact, making it easy to understand how the disallowed loss is transferred to the new shares.
Key Factors That Affect Wash Sale Results
Several factors can trigger the wash sale rule or change the outcome of the calculation. A good wash sale calculator accounts for the core numbers, but investors should be aware of these nuances.
- Timing of Transactions: The 61-day window (30 days before, day of sale, 30 days after) is the most critical factor. Any purchase of a substantially identical security within this period can trigger the rule.
- “Substantially Identical” Securities: This is a gray area. It clearly includes the same stock, but the IRS also considers options contracts (e.g., buying a call option) on the stock to be substantially identical. Bonds from the same issuer with similar maturity and coupon rates may also qualify.
- Transactions in Different Accounts: The wash sale rule applies across all of your accounts. You cannot sell a stock at a loss in your taxable brokerage account and then buy it back in your IRA within the window to avoid the rule. The loss will still be disallowed.
- Partial Repurchases: As shown in our example, if you sell 100 shares but only buy back 50, the wash sale rule only applies to 50 shares. The loss on the other 50 is still deductible. Our wash sale calculator handles this automatically.
- FIFO vs. Specific Identification: By default, brokers use the First-In, First-Out (FIFO) method for selling shares. However, if you identify specific lots to sell, you can have more control, though the wash sale rule still applies if you repurchase shares. This is a key part of tax loss harvesting.
- Short Sales: The rule also applies to closing a short sale at a loss and then opening another short sale on a substantially identical security within the 61-day window.
Frequently Asked Questions (FAQ)
The rule prevents taxpayers from creating artificial losses to reduce their tax liability while maintaining their investment position. It ensures that a loss is only recognized when the investor has truly exited their position in a security for at least 30 days. Using a wash sale calculator helps you comply with this rule.
No, the wash sale rule only applies to losses. You are free to sell a security for a gain and buy it back immediately. The gain will be taxable in the year of the sale. You can use a capital gains tax calculator to estimate the tax on your gains.
The disallowed loss is not lost forever. It is added to the cost basis of the replacement shares. This increases your basis, which will reduce your taxable gain (or increase your deductible loss) when you eventually sell the replacement shares.
On IRS Form 8949, you report the sale transaction. You would enter the full loss in column (h) and then enter the disallowed amount as a positive number in column (g) with code “W”. The net result will be your allowable loss. Your broker’s 1099-B form usually reports wash sales for you, but it’s your responsibility to ensure accuracy, especially across different brokerage accounts.
Historically, the IRS classified cryptocurrency as “property,” not “securities,” so the wash sale rule did not apply. However, tax laws are evolving, and there has been legislative discussion about applying this rule to digital assets. Always consult a tax professional for the most current guidance.
Yes, the rule still applies. The 61-day window includes 30 days *before* the sale. For example, if you buy 100 shares on Jan 15th, then sell 100 shares of the same stock (that you owned previously) at a loss on Feb 1st, it is a wash sale. The wash sale calculator logic applies regardless of the order of buy/sell within the window.
This specific wash sale calculator is designed for a single sell/repurchase event. For tracking multiple wash sales across a year, you would typically need more advanced software or a detailed spreadsheet, applying the logic of this calculator to each triggering event sequentially.
The IRS considers you and your spouse as a single entity for the wash sale rule. If you sell a stock for a loss and your spouse (or a corporation you control) buys it back within the 61-day window, it is still considered a wash sale.
Related Tools and Internal Resources
For a comprehensive approach to managing your investment taxes and returns, explore these related resources:
- Stock Profit Calculator: Quickly calculate the profit or loss from a stock trade before considering tax implications.
- Capital Gains Tax Calculator: Estimate the taxes you’ll owe on your investment gains.
- Cost Basis Calculator: An essential tool for accurately tracking the basis of your investments, especially after events like wash sales or stock splits.
- Tax-Loss Harvesting Strategies: A detailed guide on how to strategically sell losing positions to offset gains, with careful consideration of the wash sale rule.
- Investment Return Calculator: Measure the total performance of your investments over time.
- Portfolio Rebalancing Tips: Learn how to rebalance your portfolio, a process that can sometimes trigger wash sales if not done carefully.