Wash Sale Calculator: How Are Wash Sales Calculated?
Estimate disallowed loss, currently deductible loss, replacement-share basis adjustment, and estimated tax deferral from a potential wash sale.
Chart compares total realized loss, disallowed loss, and currently deductible loss.
How Are Wash Sales Calculated? A Practical Expert Guide for Investors
Wash sale calculations can look intimidating at first, but the core math is straightforward once you break it into steps. A wash sale occurs when you sell a security at a loss and buy a substantially identical security within the 61-day wash-sale window: 30 days before the sale, the sale date itself, and 30 days after. When this happens, all or part of your loss can be disallowed in the current tax year. The disallowed amount is not gone forever in most cases. Instead, it is generally added to the tax basis of the replacement shares, effectively deferring the loss.
The governing law is Internal Revenue Code Section 1091, and the IRS explains operational details in Publication 550. If you want to verify rules directly, start with these primary sources: IRS Publication 550 (.gov), 26 U.S. Code Section 1091 at Cornell Law (.edu), and SEC investor tax overview (.gov).
The Core Formula Behind a Wash Sale
To calculate a wash sale, start with the realized loss on the shares sold. If there is no loss, there is no wash sale disallowance. Then identify the number of replacement shares bought inside the 61-day window. The disallowed loss usually equals loss per share multiplied by matched replacement shares.
- Calculate loss per share: Original basis per share minus sale price per share.
- Calculate total realized loss: Loss per share multiplied by shares sold at a loss.
- Calculate matched shares: The smaller of shares sold at a loss or replacement shares purchased in the window.
- Calculate disallowed loss: Loss per share multiplied by matched shares.
- Calculate currently deductible loss: Total realized loss minus disallowed loss.
- Add disallowed loss to replacement-share basis for matched replacement shares.
In equation form:
- Loss per share = Cost basis per share – Sale price per share
- Disallowed loss = Loss per share x min(Shares sold, replacement shares in window)
- Allowed current loss = Total realized loss – Disallowed loss
- Adjusted replacement basis per matched share = Replacement purchase price + Loss per share
Numerical Example (Full Wash Sale)
Suppose you bought 100 shares at $50 and sold all 100 at $40, producing a $10 loss per share, or a $1,000 realized loss. Five days later, you bought 100 substantially identical shares. Because the replacement purchase happened in the wash-sale window and matched all 100 sold shares, the full $1,000 loss is disallowed this year. You do not deduct it now. Instead, your replacement basis is increased by that disallowed amount. If replacement shares were bought at $41, each matched share gets +$10 of basis adjustment, so adjusted basis becomes $51 per matched replacement share.
Numerical Example (Partial Wash Sale)
Now assume the same sale (100 shares sold at a $10 per share loss), but you repurchase only 40 shares in the window. The disallowed part is $10 x 40 = $400. The remaining $600 can generally be recognized now, subject to normal capital loss netting limits. This is why share count matching is crucial. Partial repurchases create partial disallowance.
Comparison Table: Statutory Numbers Every Investor Should Know
| Rule Component | Current Statutory Value | What It Means in Practice |
|---|---|---|
| Wash sale window | 61 days total | Includes 30 days before sale, sale date, and 30 days after sale. |
| Ordinary income offset for net capital losses | $3,000 per year ($1,500 MFS) | After netting capital gains and losses, up to this amount can reduce ordinary income annually. |
| Excess net capital loss carryforward | Unlimited years | Unused losses can carry to future tax years. |
| Top Net Investment Income Tax (NIIT) | 3.8% | Can apply on top of capital gain tax for higher-income taxpayers. |
Comparison Table: Short-Term vs Long-Term Tax Context
| Capital Gain Type | Federal Rate Structure | Why It Matters for Wash Sales |
|---|---|---|
| Short-term capital gains | Taxed at ordinary rates (10% to 37%) | A disallowed loss may defer offset opportunities against high-rate gains. |
| Long-term capital gains | 0%, 15%, or 20% brackets | Loss timing can still matter for yearly gain netting and bracket planning. |
| Potential NIIT overlay | Additional 3.8% for eligible high earners | Deferral can impact total tax timing when NIIT applies. |
What Counts as “Substantially Identical”?
This is one of the most misunderstood pieces. Identical CUSIP shares are obvious. The gray area is “substantially identical” instruments. For most investors, this can include buying the same stock, buying call options on the same stock, or replacing one share class with a nearly identical economic exposure. Different broad-market ETFs tracking different indexes are often used in tax-loss harvesting to reduce wash-sale risk, but classification depends on facts and circumstances. If your replacement exposure is very close in issuer and structure, caution is warranted.
Important: Broker 1099-B reporting may not capture every cross-account scenario, especially if you trade in multiple brokerages, joint accounts, or accounts involving your spouse. You remain responsible for correct wash-sale reporting on your return.
Step-by-Step Workflow for Accurate Calculation
- Export all trades for the affected ticker and related instruments from every account.
- Sort by trade date and isolate all loss sales.
- For each loss sale, scan 30 days before and 30 days after for replacement purchases.
- Match replacement share quantity to sold-loss quantity.
- Compute disallowed and allowed portions per lot, not just per symbol.
- Increase basis on matched replacement lots by the disallowed amount.
- Track holding period carryover where applicable.
- Reconcile against 1099-B and maintain your own supporting schedule.
Common Errors That Distort Wash Sale Math
- Using average cost assumptions when specific-lot matching is required for your records.
- Ignoring purchases made before the loss sale; pre-sale purchases can trigger disallowance too.
- Forgetting retirement accounts in household planning. Replacement purchases there can create unfavorable outcomes because basis adjustment mechanics may not benefit you the same way.
- Assuming crypto is always treated the same way as securities. Tax treatment has evolved and can change; always confirm current guidance.
- Relying only on one broker statement when you used multiple platforms.
Advanced Planning Ideas
The goal is usually not “never trigger a wash sale.” The goal is after-tax efficiency. If you need market exposure, one approach is swapping into a non-identical proxy security during the 30-day post-sale period. Another approach is selling lots with gains and losses intentionally to manage year-end netting. For concentrated positions, staged exits may lower timing risk around inadvertent replacement buys from dividends, DRIPs, or option assignments.
You should also coordinate with your broader tax picture: expected income, capital gain realization plans, charitable gifting strategy, and carryforward balances. A disallowed loss today can still provide future value through basis adjustments, but timing changes can affect your estimated payments and cash flow planning.
How to Read Calculator Results
This calculator returns five practical numbers: total realized loss, disallowed loss, currently deductible loss, adjusted basis for matched replacement shares, and an estimated tax deferral based on your stated marginal rates. Use the tax estimate as directional only. Actual tax impact depends on net capital gains, carryforwards, filing status, NIIT thresholds, and state conformity rules.
Recordkeeping Checklist for Audit-Ready Files
- Trade confirmations showing dates, quantities, and prices for sales and replacement purchases.
- Lot-level worksheet showing how you matched shares and calculated disallowed loss.
- Adjusted-basis log for replacement shares receiving wash-sale additions.
- Broker statements and year-end 1099-B forms.
- Documentation for any manual corrections across multiple accounts.
Bottom Line
Wash sales are calculated by matching loss shares sold with substantially identical replacement shares purchased inside the 61-day window, then disallowing the matched portion of the loss for current deduction. The disallowed amount is generally added to basis of replacement shares, preserving tax value but delaying recognition. If you apply lot-level math consistently and maintain strong records, you can avoid unpleasant surprises at filing time and make cleaner tax-loss harvesting decisions year-round.