Wash Sale Calculator

Determine if the wash sale rule applies and calculate adjusted cost basis

Educational purposes only. This calculator is for informational purposes and should not be considered financial, tax, or legal advice. Consult a qualified professional for personalized guidance.

Try an example:

Sale Details

$
$

Repurchase Details

$

Leave blank if same as shares sold

Use negative for purchases before sale

61-Day Window

The wash sale rule applies if you buy substantially identical securities within 30 days before or after the sale.

Check for Wash Sale

Enter sale and repurchase details to determine if the wash sale rule applies.

About the Wash Sale Rule

What Is the Wash Sale Rule?

The IRS disallows loss deductions when you sell a security at a loss and buy a substantially identical security within 30 days before or after.

Cost Basis Adjustment

The disallowed loss is added to the cost basis of the replacement shares, so the loss is not permanently lost but deferred.

How This Tool Works

Wash Sale Calculator

Tax-loss harvesting allows investors to realize losses that offset gains and reduce tax liability. But the IRS prevents investors from claiming losses while maintaining essentially the same market position through the wash sale rule. When you sell a security at a loss and repurchase the same or substantially identical security within 30 days before or after the sale, the loss is disallowed for tax purposes. The wash sale calculator helps you navigate this rule, determining whether planned transactions trigger wash sales and computing the cost basis adjustments that result.

The wash sale rule creates a 61-day window of vulnerability surrounding any loss sale: 30 days before, the sale date itself, and 30 days after. Purchases within this window of the same or substantially identical securities convert what you thought was a realized loss into a disallowed loss with complex basis consequences.

Understanding wash sales prevents costly surprises and enables legitimate tax-loss harvesting within the rules.

How Wash Sales Work

Consider an investor who purchased 100 shares of XYZ stock at $50 per share for a $5,000 cost basis. The stock drops to $30 per share, and the investor sells all shares for $3,000, hoping to claim a $2,000 capital loss. Three weeks later, believing XYZ will recover, the investor repurchases 100 shares at $32 per share.

The repurchase within 30 days triggers a wash sale. The $2,000 loss is disallowed and cannot offset gains on that year's tax return. However, the loss is not permanently lost. Instead, it adds to the cost basis of the newly purchased shares.

The new shares have a purchase price of $3,200 but a cost basis of $5,200 after adding the $2,000 disallowed loss. When these shares are eventually sold, the higher basis reduces the gain or increases the loss, recovering the original loss through future tax treatment.

The 61-Day Window Explained

The wash sale window extends 30 days in both directions from the sale date. This means purchases before the loss sale can trigger wash sales just as purchases after can. The rule catches investors who buy first and then sell to lock in a loss while maintaining position.

DayEventWash Sale Triggered?
Day 1Buy 100 shares at $30Sets up potential wash sale
Day 15Sell original shares at lossWash sale triggered by Day 1 purchase
Day 45Buy 100 shares at $32No wash sale (outside 30-day window)

The calculator analyzes your transaction dates to identify wash sale triggers and quantify which portions of losses are disallowed.

Substantially Identical Securities

The wash sale rule applies not only to identical securities but also to substantially identical ones. While the IRS has not precisely defined this term, certain guidelines are clear.

Buying the same stock or bond is obviously identical. Buying options or contracts to acquire the same security triggers wash sales. Buying a stock and selling a put on that same stock within the window can trigger wash sales.

Different stocks, even in the same industry, are generally not substantially identical. Selling one bank stock and buying another bank stock typically does not trigger a wash sale. This allows investors to harvest losses while maintaining sector exposure through similar but not identical holdings.

Index mutual funds and ETFs tracking the same index may be considered substantially identical, though the IRS has not issued definitive guidance. Conservative tax planning treats S&P 500 index funds from different providers as potentially substantially identical, while funds tracking different indexes are clearly not.

Cost Basis Adjustments

When a wash sale occurs, the disallowed loss adds to the cost basis of the replacement shares. This adjustment preserves your economic loss for future recognition rather than eliminating it entirely.

The calculation can become complex with partial wash sales. If you sell 100 shares at a loss but only repurchase 60 shares within the window, 60% of the loss is disallowed and added to the new shares' basis, while 40% remains currently deductible.

The holding period of the original shares also carries over to replacement shares for purposes of determining long-term versus short-term treatment. Replacement shares inherit the original holding period, potentially converting what would be a short-term position into long-term treatment.

The calculator handles these partial wash sale scenarios, computing allowed losses, disallowed amounts, and adjusted basis for replacement shares.

Wash Sales Across Accounts

The wash sale rule applies across all your accounts, including IRAs and 401(k)s. Selling at a loss in a taxable account while your IRA purchases the same security within 30 days triggers a wash sale. Worse, when the replacement purchase occurs in a retirement account, the disallowed loss cannot add to basis because retirement accounts do not track cost basis for tax purposes.

This means wash sales involving retirement account repurchases result in permanent loss of the tax benefit. The loss is disallowed with no future recovery through basis adjustment. Coordinating transactions across accounts requires awareness of this trap.

Spousal accounts also trigger wash sales. Your spouse buying a security within the wash sale window of your loss sale disallows your loss. Joint tax filing does not combine positions but does combine wash sale treatment.

The calculator allows input of transactions across multiple accounts to identify cross-account wash sale triggers.

Impact on Tax-Loss Harvesting

Tax-loss harvesting involves intentionally realizing losses to offset gains, then reinvesting in similar but not identical securities to maintain market exposure. The wash sale rule makes this strategy more complex but not impossible.

Successful tax-loss harvesting requires either waiting 31 days before repurchasing the same security or immediately purchasing a substantially different security. Many investors swap between similar index funds or ETFs, such as selling one total market fund and buying another that tracks a slightly different index.

The calculator helps plan harvesting transactions by showing which combinations of sales and purchases avoid wash sale treatment while maintaining desired market exposure.

Wash Sale Tracking Complexity

Investors making frequent trades in the same securities face significant tracking burdens. Each wash sale requires basis adjustment on specific lots, and subsequent sales of those lots must use the adjusted basis. Multiple wash sales on the same security create layered adjustments that challenge even sophisticated recordkeeping.

Brokerage firms report wash sales on Form 1099-B, but their tracking may miss cross-account wash sales or use different lot identification methods than you prefer. Reconciling broker reports with your own calculations often reveals discrepancies requiring manual adjustment on tax returns.

The calculator maintains wash sale history across multiple transactions, tracking basis adjustments through subsequent sales.

Avoiding Wash Sales

The simplest way to avoid wash sales is waiting 31 days before repurchasing sold securities. Set calendar reminders to ensure the window closes before repurchasing. For tax-loss harvesting purposes, December losses must wait until late January for repurchase if you want current-year loss recognition.

Immediately purchasing a substantially different security maintains market exposure without triggering wash sales. Replace individual stocks with sector ETFs. Replace one index fund with another tracking a different index. Replace bonds with similar maturity and credit quality from different issuers.

Turning off automatic dividend reinvestment on securities you might sell at a loss prevents inadvertent wash sales from small reinvestment purchases within the window.

Using the Calculator

Enter your loss sale details including security, date, shares, and proceeds. Add your original cost basis. Then enter any purchases of the same or substantially identical securities within the 61-day window surrounding the sale.

The calculator determines whether wash sales occurred, computes the disallowed loss amount, calculates the adjusted basis for replacement shares, and shows your currently deductible loss if partial wash sales apply.

Use the results to adjust tax planning, revise harvesting strategies, or prepare accurate tax returns reflecting wash sale treatment.


The wash sale rule prevents claiming tax losses while maintaining market positions, but it does not eliminate losses permanently. Disallowed losses become basis adjustments that reduce future gains. The calculator navigates the 61-day window, identifies wash sale triggers, and computes the complex basis adjustments that preserve your economic losses for future tax benefit while keeping your current-year reporting accurate.