Wash-Sale Calculator
The wash-sale rule under IRC Section 1091 prevents investors from claiming an immediate tax loss when they repurchase a substantially identical security within 30 days before or after a sale. Rather than eliminating the loss entirely, the IRS transfers it to the cost basis of the replacement shares. This defers the loss recognition until those shares are eventually sold outside the wash-sale window. Understanding the adjusted basis of your replacement shares is critical for accurate tax reporting and future gain/loss calculations. This calculator determines the disallowed loss from a wash-sale transaction, the adjusted basis of the replacement shares, and the holding period consequence. Enter the original shares sold, their cost basis, the proceeds from the sale, and the number of replacement shares purchased.
Wash-sale basis adjustment formula (IRC Sec 1091)
Loss Realised = (Sale Price - Cost Basis) x Shares Sold
Wash-Sale Ratio = min(Replacement Shares, Sold Shares) / Sold Shares
Disallowed Loss = Loss Realised x Wash-Sale Ratio (only if loss > 0)
Adjusted Basis per Replacement Share = Replacement Price + (Disallowed Loss / Replacement Shares)
Total Adjusted Basis = Adjusted Basis per Share x Replacement Shares
The disallowed loss is permanently added to the basis of the replacement shares, not to the IRA if the repurchase is made there.
Wash-sale holding period rule
- The holding period of the replacement shares includes the holding period of the sold shares.
- This can cause a short-term position to become long-term if the sold shares were held long-term.
- The wash-sale window is 61 days: 30 days before the sale, the sale date, and 30 days after.
- Wash-sale rules apply across all accounts you own or control, including your spouse's accounts.
Wash-sale rules: frequently asked questions
What is a wash sale?
A wash sale occurs when you sell a security at a loss and buy a 'substantially identical' security within 30 days before or after the sale. The IRS disallows the capital loss under IRC Section 1091. The disallowed loss is not gone forever; it is added to the cost basis of the replacement shares, deferring the tax benefit until you ultimately sell those shares.
What counts as 'substantially identical'?
The IRS has not precisely defined substantially identical. For most purposes: the exact same stock or bond is always substantially identical. Options and warrants on the same stock are substantially identical. Shares of the same mutual fund are substantially identical. ETFs tracking the same index from the same provider may be substantially identical, while ETFs tracking different but similar indexes from different providers are generally not. The IRS looks at economic substance rather than technical differences.
Does a wash sale permanently eliminate the tax loss?
No. The disallowed loss is added to the basis of the replacement security. When you eventually sell the replacement shares without triggering another wash sale, the higher basis produces a larger loss (or smaller gain), recovering the deferred tax benefit. The only scenario where the loss is permanently lost is if you hold the replacement shares until death (stepped-up basis) or donate them to charity.
What is the wash-sale window?
The wash-sale window is 61 days total: 30 days before the sale, the sale day, and 30 days after the sale. If you buy a substantially identical security on any of these days, the wash-sale rule applies. You must track all purchases across all accounts you control, including IRAs and spouse's accounts.
Do wash-sale rules apply in IRAs?
The wash-sale rule can apply across accounts. If you sell a stock at a loss in a taxable account and buy the same stock in an IRA within the 30-day window, the loss in the taxable account is disallowed. However, the disallowed loss cannot be added to your IRA basis and is permanently lost, because IRA transactions do not have individual cost bases in the same way. This is an important trap to avoid.
Official sources
- IRS Publication 550: Investment Income and Expenses (Wash Sales).
- IRC Section 1091: Loss from Wash Sales of Stock or Securities.
Reviewed by the CalculatorHub team, edited by James Graham, 14 June 2026. See our methodology.