Wash Sale Rule Analysis
Wash Sale Rule Loss Disallowance Calculator
What This Calculator Does and Why It Matters
The wash sale rule is one of the most misunderstood and costly tax traps for active investors. Many people sell a losing position to capture a tax loss, then quickly buy back the same stock — only to discover the IRS will not allow the deduction. The loss is disallowed, and unless you understand how the adjusted cost basis works, you may be surprised at tax time.
This free wash sale rule loss disallowance calculator helps you see exactly how much of your loss is disallowed, how much is still deductible this tax year, what your new adjusted cost basis is on the repurchased shares, and how much tax savings you are deferring to a future sale. Enter your purchase price, sale price, share counts, and repurchase details and the tool walks through the full wash sale calculation instantly.
The wash sale rule is defined under IRS Publication 550, which governs investment income and expenses and provides the official guidance investors and tax professionals rely on.
How to Use This Calculator
Step-by-Step Instructions
- Enter the original purchase price per share of the stock you sold at a loss.
- Enter the sale price per share at which you sold the position.
- Enter the total number of shares you sold.
- Enter the number of shares you repurchased within 30 days before or after the sale date.
- Enter the price per share you paid for the repurchased shares.
- Enter your marginal tax rate as a percentage to see the dollar value of the deferred tax benefit.
- Click Calculate to see your disallowed loss, deductible loss, new cost basis, and deferred tax impact.
- Use Reset to clear all fields and run a new scenario.
The Formula Explained
Breaking Down the Formula
The wash sale disallowance is calculated based on the number of shares repurchased within the 30-day window before or after the sale. The disallowed loss equals the loss per share multiplied by the number of shares repurchased (up to the number of shares sold). The remaining shares’ loss — those not matched by a repurchase — is still deductible.
The critical follow-on effect is the basis adjustment. The disallowed loss per repurchased share is added to the cost basis of those new shares. So if you paid $39/share for repurchased stock and your disallowed loss per share is $11, your new adjusted basis is $50/share. This higher basis reduces the taxable gain — or increases the loss — when you eventually sell those shares. The loss is deferred, not permanently lost.
If you also deal with cryptocurrency and want to understand wash sale-related planning there, the crypto tax loss harvesting calculator on ToolCR is a helpful companion tool, as crypto currently has different wash sale treatment under US tax law.
Example Calculation with Real Numbers
You bought 100 shares at $50 and sold them at $38 — a loss of $12 per share, totaling $1,200. Within 25 days you repurchased 60 shares at $39. The wash sale rule disallows the loss on 60 shares: 60 × $12 = $720 disallowed. The remaining 40 shares’ loss of $480 is deductible. Your new cost basis on the 60 repurchased shares is $39 + $12 = $51 per share. When you eventually sell those shares, the $720 loss effectively resurfaces through the higher basis.
When Would You Use This
Real Life Use Cases
This calculator is useful for individual investors doing tax-loss harvesting, financial advisors reviewing year-end client portfolios, accountants preparing Schedule D, and anyone who actively trades individual stocks. It is especially important to run this analysis before executing trades in November and December when year-end tax-loss harvesting activity peaks.
Specific Example Scenario
A self-employed investor in the 32% marginal bracket is sitting on $8,000 in capital gains from earlier in the year. They want to sell a losing stock position worth $5,000 in losses to offset the gains. Before selling, they check whether they already bought back similar shares in the past 30 days or plan to do so within the next 30. By running this calculator they see that a planned repurchase of 50% of the position would disallow $2,500 of the loss — a meaningful difference in their tax bill. For investors managing self-employment income alongside these losses, the self-employment tax calculator helps with the full tax picture for the year.
Year-end tax planning is one of the most common use cases, but wash sale violations can also happen mid-year whenever an investor panic-sells and quickly buys back the same position. This calculator can be used any time a sale at a loss is followed by a repurchase within the wash sale window.
Tips for Getting Accurate Results
Remember the 30-Day Rule Goes Both Ways
The wash sale window is 61 days total — 30 days before the sale date, the sale date itself, and 30 days after. Most investors only think about repurchases after the sale, but if you bought shares within 30 days before selling at a loss, those purchases also trigger the wash sale rule. Always check both directions when reviewing a potential wash sale situation.
Track Substantially Identical Securities, Not Just the Same Ticker
The IRS applies the wash sale rule to substantially identical securities — not just the exact same stock. This means selling a mutual fund and buying a nearly identical ETF tracking the same index may trigger the rule. Selling stock in one company and buying options on the same stock can also apply. When in doubt, consult your tax advisor before executing the repurchase. For investors tracking capital losses more broadly, the capital loss carryover deduction calculator helps you understand how unused losses carry forward to future tax years.
Keep Detailed Records of All Trade Dates and Prices
Wash sale violations often go unnoticed until a broker issues a 1099-B with adjusted proceeds figures at year-end, which can surprise investors who thought they had clean loss deductions. Keep a detailed trade log with purchase date, sale date, repurchase date, number of shares, and prices for any position where you sell at a loss. Your broker’s tax center may flag wash sales automatically, but not all do so perfectly — especially across multiple brokerage accounts.
Frequently Asked Questions
What exactly is the wash sale rule?
The wash sale rule is an IRS rule under Section 1091 of the Internal Revenue Code that disallows a capital loss deduction when you sell a security at a loss and repurchase the same or a substantially identical security within 30 days before or after the sale. The disallowed loss is not permanently lost — it is added to the cost basis of the repurchased shares, deferring the tax benefit to a future sale.
Does the wash sale rule apply to gains?
No. The wash sale rule only applies to sales that result in a loss. If you sell a security at a gain and immediately repurchase it, the gain is fully taxable. The rule was designed specifically to prevent investors from manufacturing artificial tax losses while maintaining their market position — it has no mechanism to defer or disallow gains.
Does the wash sale rule apply to cryptocurrency?
As of the current tax year, the IRS has not formally classified cryptocurrency as a security, which means the wash sale rule under Section 1091 technically does not apply to crypto losses. However, this is an area of active legislative discussion and future tax law changes may extend the wash sale rule to digital assets. Always verify the current rules with your tax advisor, as this area is evolving.
What happens to my disallowed loss — is it gone forever?
No, the disallowed loss is not gone. It is added to the cost basis of the repurchased shares. This means when you eventually sell those shares, your taxable gain will be lower — or your deductible loss will be higher — by exactly the amount of the previously disallowed loss. The tax benefit is deferred, not eliminated, as long as you hold and eventually sell the repurchased shares outside a wash sale window.
What if I sell fewer shares than I repurchased?
The wash sale rule disallows losses proportionally based on the number of repurchased shares, up to the number of shares sold. If you sell 100 shares at a loss and repurchase 150, only the first 100 repurchased shares are matched against the sale. The excess 50 shares are purchased at their own basis without any wash sale adjustment.
Does the wash sale rule apply across different brokerage accounts?
Yes. The wash sale rule applies across all accounts you own, including your spouse’s accounts and IRAs. A particularly costly scenario is selling at a loss in a taxable brokerage account and repurchasing the same security in an IRA — the loss is disallowed in the taxable account, and because the basis in the IRA cannot be adjusted in a meaningful tax-deductible way, the deferred benefit is effectively permanently lost. For tax-advantaged account planning, the Roth IRA conversion tax calculator is a useful related tool.
How does the wash sale rule interact with tax-loss harvesting?
Tax-loss harvesting is the practice of intentionally selling losing positions to realize capital losses that can offset gains and reduce taxable income. The wash sale rule is the primary constraint on this strategy. The standard approach to harvesting losses without triggering a wash sale is to replace the sold security with a similar but not substantially identical security for at least 31 days before repurchasing the original. For estimated quarterly payments, use the estimated quarterly tax payment calculator to account for harvested gains and losses across the year.
Where on my tax return do I report wash sale adjustments?
Wash sale adjustments are reported on IRS Form 8949 and carried to Schedule D. Brokers are required to report wash sale adjustments on Form 1099-B, where the disallowed loss amount appears in Box 1g. The adjusted cost basis of replacement shares should also reflect the wash sale adjustment. If you use tax software, entering your 1099-B data accurately — including the wash sale amount — will automatically populate the correct adjustments on Form 8949.
Conclusion
The wash sale rule catches many investors off guard, especially those who are actively managing losses at year-end or reacting emotionally to market volatility by selling and then buying back quickly. Understanding exactly how the rule works — and how to calculate the disallowed loss and adjusted basis — is essential for any investor who trades individual securities.
Use this calculator to check any loss transaction where a repurchase occurred within the 30-day window. The numbers will tell you clearly what you can deduct now, what is deferred to a future sale, and how your new cost basis compares. When dealing with complex wash sale scenarios across multiple accounts or security types, always consult a qualified tax professional.