Wash Sale Calculation Calculator
Estimate disallowed losses, allowed losses, and adjusted replacement basis under IRS wash sale rules.
Complete Guide to Wash Sale Calculation for Investors and Active Traders
Wash sale calculation is one of the most misunderstood parts of tax reporting for investors. The concept sounds simple at first: if you sell an investment at a loss and buy the same or substantially identical security around the same time, the IRS may disallow your immediate loss deduction. In practice, however, the details can materially change your after tax performance, your replacement cost basis, and the timing of when losses become usable. That is why a practical calculator and a clear framework are essential.
At the center of the rule is timing. The wash sale window covers 61 calendar days total: the day of sale, the 30 days before the sale, and the 30 days after the sale. If a replacement acquisition is made in this window and your original sale was at a loss, all or part of that loss is deferred. Deferred does not mean gone forever. It is generally added to the basis of the replacement shares, which can reduce future taxable gain or increase future loss when those replacement shares are sold.
What the wash sale rule is designed to prevent
Congress and the IRS designed the wash sale rule to prevent taxpayers from claiming a tax loss while maintaining nearly the same economic position. Without the rule, an investor could sell at a loss on December 20, immediately buy the same stock back on December 21, claim the tax loss for the current year, and still hold the same market exposure. Wash sale treatment limits that result by postponing the deduction.
| Wash Sale Window Component | Calendar Days | Why it matters for calculation |
|---|---|---|
| Days before the loss sale | 30 days | Buying replacement shares before you sell can still trigger wash sale treatment. |
| Loss sale day | 1 day | The sale date is included in the rule window. |
| Days after the loss sale | 30 days | Most common trigger period when investors re-enter too quickly. |
| Total statutory window | 61 days | Any substantially identical replacement in this period can defer loss. |
Core wash sale calculation formula
A reliable calculation follows a sequence. First, determine whether the sale is actually a loss. If the sale produced a gain, wash sale treatment does not apply. Second, identify whether replacement shares were acquired during the 61-day window. Third, match replacement shares against loss shares sold. The deferred portion applies only to matched shares, so partial wash sales are common.
- Total realized loss = (Original basis per share – Sale price per share) × Shares sold at loss
- Disallowed shares = Minimum of (Shares sold at loss, Replacement shares acquired in window)
- Disallowed loss = Loss per share × Disallowed shares
- Currently allowed loss = Total realized loss – Disallowed loss
- Adjusted basis of matched replacement shares = Purchase cost of matched replacement shares + Disallowed loss
This is exactly the logic used in the calculator above. It gives you both the immediate tax effect and the future basis effect, which is the part many investors ignore.
Practical example with partial wash sale treatment
Suppose you bought 300 shares at $60 and sold all 300 at $48. Your loss is $12 per share, or $3,600 total. Ten days later, you buy 120 replacement shares in the same stock. Because those 120 shares are within the window, only that matched portion is disallowed now.
- Total loss: $3,600
- Disallowed shares: 120
- Disallowed loss: 120 × $12 = $1,440
- Currently deductible loss: $3,600 – $1,440 = $2,160
The deferred $1,440 is not lost. It is added to the basis of the 120 replacement shares. If replacement shares were purchased at $49, the adjusted basis is effectively $61 per matched share after basis adjustment. This is why proper recordkeeping is mandatory for accurate future reporting.
How holding period and basis adjustments affect future taxes
Two consequences matter after a wash sale: basis adjustment and potential holding period carryover for matched shares. In plain language, your future gain or loss on the replacement lot depends on this adjusted basis. If your broker applies the adjustment correctly, Form 1099-B may include wash sale notation. But investors with multiple accounts, IRAs, or spouse accounts often face reporting gaps where broker statements do not capture every cross-account replacement transaction.
You should therefore treat your own ledger as the final source of truth. Good tracking fields include trade date, quantity, lot ID, acquisition basis, sale proceeds, replacement date, matched quantity, deferred loss, and adjusted replacement basis. If you trade frequently, this recordkeeping is just as important as your entry and exit strategy.
Tax rate context: why deferred loss timing can still be expensive
Many investors focus only on whether a loss is deductible this year, but timing has real value. Deferring a loss means deferring tax relief. If your marginal tax rate is high, this delay can create meaningful cash flow drag. The table below summarizes 2024 long-term capital gain rate thresholds published by the IRS, which helps you estimate how future gains and deferred losses may interact with bracket planning.
| 2024 Filing Status | 0% LTCG Rate | 15% LTCG Rate | 20% LTCG Rate |
|---|---|---|---|
| Single | Up to $47,025 | $47,026 to $518,900 | Over $518,900 |
| Married Filing Jointly | Up to $94,050 | $94,051 to $583,750 | Over $583,750 |
| Head of Household | Up to $63,000 | $63,001 to $551,350 | Over $551,350 |
These thresholds are not the wash sale rule itself, but they are crucial for strategy. For example, if your deferred loss ultimately offsets gain in a higher bracket year, the eventual benefit may be larger. On the other hand, deferral can hurt if you need losses now to manage current-year realized gains.
Substantially identical: where uncertainty creates risk
The code and guidance clearly cover the same stock or security and options tied to that security. The phrase substantially identical can become complex for near-substitute positions. Different share classes, deep in-the-money calls, and some fund substitutions can create gray areas. A conservative approach is best if your goal is low audit risk and clean tax reporting.
Retirement accounts and permanent loss issues
A commonly overlooked issue occurs when replacement purchases happen in tax-advantaged accounts. If you sell at a loss in taxable and buy substantially identical shares in an IRA within the wash window, the loss can be disallowed without the same practical basis recovery path you would get in taxable replacement shares. That can turn a temporary deferral into a more punitive outcome. Advanced traders should monitor all related accounts together, including spouse accounts, before harvesting losses.
Year-end wash sale checklist
- Review open lots with unrealized losses in November and December.
- Identify dividend reinvestment settings that could accidentally repurchase shares.
- Check automatic recurring buys in broker apps and robo accounts.
- Coordinate trades across taxable, IRA, Roth IRA, and spouse accounts.
- If harvesting loss, wait beyond the 30-day post-sale period before repurchasing the same security.
- Prefer a temporary replacement with different but correlated market exposure.
How to use this calculator correctly
Enter the shares sold at a loss, your original basis per share, and your sale price. Then add how many replacement shares were acquired within 30 days of the loss sale, along with replacement price. If your days-between value is more than 30, the tool treats the event as non-wash for basic estimation. The output then shows total realized loss, disallowed loss, currently allowed loss, and replacement basis adjustment.
The chart visualizes the relationship between realized, disallowed, and allowed amounts. This is useful when evaluating alternative execution plans, such as splitting replacement purchases over time or delaying re-entry. Even a one-line strategy change can materially reduce deferred loss.
Limitations and professional review
This calculator is educational and scenario-based. It does not replace formal tax advice or full lot-level reporting software. Real tax returns may include broker-reported adjustments, mixed holding periods, options assignments, and corporate actions that require additional treatment. Use this calculator as a decision support tool, then validate with your CPA or enrolled agent before filing.
Authoritative references for deeper study
For official and high-authority details, review:
IRS Publication 550 (Investment Income and Expenses)
U.S. SEC Investor.gov Glossary: Wash Sales
Cornell Law School Legal Information Institute: 26 U.S. Code Section 1091
If you internalize one idea from this guide, make it this: wash sale calculation is mainly a timing and matching problem. The better you track dates, quantities, and replacement lots, the better your tax outcomes and compliance quality will be. Build the discipline now and your year-end process becomes cleaner, faster, and less expensive.