Wash Sale Calculator Software
Determine disallowed losses and new cost basis according to IRS rules.
What is a Wash Sale?
A wash sale is a transaction in which an investor sells a security (like a stock or bond) at a loss and, within 30 days before or after the sale, buys the same or a “substantially identical” security. The IRS wash sale rule (as detailed in Publication 550) prevents taxpayers from claiming that loss for tax deduction purposes. The primary purpose of this rule is to stop investors from creating artificial losses to lower their tax bills while essentially maintaining their investment position. When you use a wash sale calculator software, you are determining the financial consequences of such a series of trades.
This rule is critical for active traders and investors, especially during volatile market periods or near the end of the tax year when tax-loss harvesting is common. A common misconception is that the rule only applies if you repurchase the stock *after* selling. However, the window is 61 days total: 30 days before the sale, the day of the sale, and 30 days after. Our wash sale calculator software helps clarify these complex timelines. Anyone who actively manages their portfolio and wishes to realize losses to offset capital gains should be aware of this rule.
Wash Sale Formula and Mathematical Explanation
The calculation for a wash sale isn’t about finding a new value, but rather about reallocating a loss. The core idea is that the loss you’re not allowed to deduct is added to the cost basis of the new, replacement shares. This effectively postpones the tax benefit of the loss until you sell the new shares. Here’s a step-by-step breakdown that our wash sale calculator software automates for you.
- Calculate the Initial Loss: This is the straightforward loss from your sale. Formula: `Initial Loss = (Original Cost per Share – Sale Price per Share) * Shares Sold`
- Determine the Replacement Shares: Identify how many of the shares you sold were “replaced” by the new purchase. This is the lesser of the number of shares sold or the number of shares repurchased.
- Calculate the Disallowed Loss: This is the portion of your initial loss that is disallowed. If you repurchased fewer shares than you sold, the loss is disallowed on a pro-rata basis. Formula: `Disallowed Loss = (Initial Loss / Shares Sold) * Replacement Shares`
- Calculate Recognized Loss: This is the part of the loss you can actually deduct now. Formula: `Recognized Loss = Initial Loss – Disallowed Loss`
- Determine the New Cost Basis: The disallowed loss is added to the total purchase cost of the new shares. Formula: `New Total Cost Basis = (Repurchase Price * Shares Repurchased) + Disallowed Loss`. The new basis per share is this total divided by the number of repurchased shares.
Variables Table
| Variable | Meaning | Unit | Typical Range |
|---|---|---|---|
| Sale Price | The price per share at which the security was sold. | USD ($) | 0.01 – 10,000+ |
| Shares Sold | The quantity of shares sold at a loss. | Shares | 1 – 1,000,000+ |
| Original Cost | The purchase price per share of the sold security. | USD ($) | 0.01 – 10,000+ |
| Repurchase Price | The price per share of the newly acquired security. | USD ($) | 0.01 – 10,000+ |
| Shares Repurchased | The quantity of new shares bought within the 61-day window. | Shares | 1 – 1,000,000+ |
Practical Examples (Real-World Use Cases)
Example 1: Full Wash Sale
An investor buys 100 shares of TechCorp at $150 per share. The stock drops, and they sell all 100 shares at $140 per share, realizing a loss of $1,000. Two weeks later, fearing they will miss a rebound, they buy back 100 shares of TechCorp at $142 per share.
- Inputs for the wash sale calculator software: Sale Price=$140, Shares Sold=100, Original Cost=$150, Repurchase Price=$142, Shares Repurchased=100.
- Calculation: The initial loss is ($150 – $140) * 100 = $1,000. Since all 100 shares were replaced, the entire $1,000 loss is disallowed.
- Output: The recognized loss is $0. The new cost basis for the 100 repurchased shares is ($142 * 100) + $1,000 = $15,200, or $152 per share. The investor cannot deduct the loss now, but the higher cost basis will reduce their capital gains when they eventually sell the new shares.
Example 2: Partial Wash Sale
An investor buys 200 shares of Energy Inc. at $50 per share. They later sell those 200 shares at $40 per share for a total loss of $2,000. Within 30 days, they decide to re-enter the position but only buy 50 shares at $42 per share. A wash sale calculator software can easily handle this partial replacement.
- Inputs: Sale Price=$40, Shares Sold=200, Original Cost=$50, Repurchase Price=$42, Shares Repurchased=50.
- Calculation: The loss per share was $10. Since only 50 shares were replaced, the disallowed portion of the loss is 50 shares * $10/share = $500.
- Output: The disallowed loss is $500. The recognized (deductible) loss is $2,000 – $500 = $1,500. The new cost basis for the 50 repurchased shares is (50 * $42) + $500 = $2,600, or $52 per share. Check out our guide on understanding cost basis for more information.
How to Use This Wash Sale Calculator Software
Our intuitive wash sale calculator software is designed for accuracy and ease of use. Follow these steps to determine the tax implications of your trades.
- Enter Sale Information: Input the price per share at which you sold your securities and the number of shares sold. This should be a transaction that resulted in a loss.
- Enter Original Cost: Provide the original price you paid per share for the securities you sold.
- Enter Repurchase Information: Input the price you paid for the new, “substantially identical” shares and the number of shares you repurchased within the 61-day window (30 days before or after the sale).
- Review the Results: The calculator instantly updates. The “Total Disallowed Loss” is the main result—this is the amount you cannot deduct from your taxes for the current year. You will also see your “Recognized Loss” (the deductible portion, if any) and the new adjusted cost basis for your replacement shares.
- Interpret the Outcome: A large disallowed loss means the wash sale rule has significantly impacted your transaction. The new cost basis is crucial for future tax calculations. Knowing these figures helps in strategic tax planning, a topic we cover in our tax-loss harvesting strategies guide.
Key Factors That Affect Wash Sale Results
Several factors influence the outcome of a wash sale calculation. Understanding them is key to managing your investment portfolio effectively. This wash sale calculator software accounts for all of them.
- Timing of Repurchase: This is the most critical factor. A repurchase of identical securities within 30 days (before or after) of the sale triggers the rule. A repurchase on the 31st day does not.
- Quantity of Repurchased Shares: If you repurchase fewer shares than you sold, only a portion of the loss is disallowed. This allows you to claim a partial loss, as seen in our second example.
- Substantially Identical Securities: The rule isn’t just for the exact same stock. It also applies to securities that are economically very similar, such as options or convertible bonds of the same company. Our article on substantially identical securities explains this nuance.
- Transactions Across Multiple Accounts: The IRS wash sale rule applies across all your accounts, including IRAs and accounts belonging to your spouse. Selling a stock at a loss in your brokerage account and buying it back in your IRA is a classic wash sale.
- Original Cost Basis: A higher original cost naturally leads to a larger initial loss, which in turn means a potentially larger disallowed loss if the wash sale rule is triggered. Keep precise records, as we explain in our guide to cost basis.
- Sale Price: The lower the sale price relative to the cost basis, the larger the loss. This magnifies the impact of a wash sale. The goal of tax-loss harvesting is to realize these losses without violating the rule.
Frequently Asked Questions (FAQ)
A wash sale calculator software is designed to compute the amount of a capital loss that will be disallowed by the IRS due to the wash sale rule. It also calculates the adjusted cost basis of the replacement shares, which is essential for future tax reporting.
Yes. The wash sale period is exactly 30 days before and 30 days after the sale. If you wait until the 31st day to repurchase the same or a substantially identical security, the loss from your sale is fully deductible and not considered a wash sale.
The IRS does not provide a rigid definition, but it generally means securities that are economically the same. For example, common stock of a company and a call option for that same stock are considered substantially identical. However, stock in two different oil companies would not be. For more detail, see our guide on substantially identical securities.
No, the wash sale rule applies only to losses. You are free to sell a security for a gain and buy it back immediately without any penalty. All gains must be reported.
This is a particularly bad scenario. If you sell a stock at a loss in a taxable account and repurchase it in an IRA within the 61-day window, the loss is permanently disallowed. You cannot add the disallowed loss to the cost basis of the shares in the IRA, so the tax benefit of that loss is gone forever.
You report wash sales on IRS Form 8949. You will list the full amount of the loss and then enter the disallowed amount in column (g) with code “W.” The net result will be your recognized loss. This wash sale calculator software provides the numbers you need for that form. Our guide to reporting wash sales on Form 8949 provides a walkthrough.
Currently, the wash sale rule applies to “stocks and securities.” The IRS has classified cryptocurrencies as property, not securities. Therefore, as of now, the wash sale rule does not apply to crypto, though this could change with future legislation.
Absolutely. By understanding the potential impact of a trade before you make it, you can avoid triggering a wash sale unintentionally. This allows for more effective tax-loss harvesting, where you can strategically sell losing positions to offset gains without violating IRS rules. It’s a key tool for active portfolio management.