Wash Sale Calculator

Check whether a repurchase triggers the section 1091 wash sale rule, how much loss is deferred into the new basis, and the one case where the loss is lost for good.

How to use this calculator

  1. 1Enter the share count, your cost per share and the price you sold at, so the loss can be computed.
  2. 2Enter the two dates — the rule looks 30 days in both directions, so a purchase made shortly before the sale counts.
  3. 3Enter how many shares you bought back; replacing only part of the position disallows only part of the loss.
  4. 4Tick the IRA box if the repurchase happened in a retirement account, since that changes a deferral into a permanent loss.

How the calculation works

Wash sale if substantially identical shares are acquired within 30 days before or after the loss sale. Disallowed loss = loss per share × shares replaced. New basis = purchase price + disallowed loss
61-day window
30 days before the sale, the sale date itself, and 30 days after
Shares replaced
The lesser of shares sold and shares repurchased — a partial repurchase disallows the loss only in proportion
Basis adjustment
Section 1091(d) adds the disallowed loss to the replacement shares, so it is recovered on a later sale

The rule applies to losses only. A sale at a gain can be repurchased immediately with no consequence.

The holding period of the sold shares is added to the replacement under section 1223(3), preserving long-term status.

Buying the replacement inside an IRA or Roth IRA disallows the loss with no basis increase anywhere, under Revenue Ruling 2008-5. That loss is permanent.

Worked example

Selling 100 shares at a $3,000 loss and buying back 13 days later

  1. 1.The loss is $30 per share on 100 shares, so $3,000 in total.
  2. 2.The repurchase is 13 days after the sale, well inside the 30-day window, and all 100 shares were replaced.
  3. 3.The entire $3,000 loss is therefore disallowed this year.
  4. 4.It is not lost: it is added to the $52 repurchase price, giving a basis of $82 per share.
  5. 5.Selling those shares later recovers the full deduction, and the original holding period carries over.

Result: $3,000 disallowed, deferred into an $82 per-share basis

Deferred, not destroyed

The wash sale rule is usually described as losing your deduction, and in the ordinary case that is wrong. Section 1091 disallows the loss in the year of sale, and section 1091(d) then adds exactly that amount to the basis of the replacement shares. When you eventually sell those, the loss comes back.

The real cost is timing, not the deduction. You wanted a deduction this year and you get it in some later year instead, which is worth the time value of the money and no more. For an investor who was going to hold the position anyway, a wash sale is a nuisance rather than a disaster.

Section 1223(3) adds a second, genuinely favourable wrinkle that is almost never mentioned: the holding period of the shares you sold carries over to the replacement. A position held for five years does not restart its clock. If you sell at a loss and buy back the next day, the replacement shares are long-term from the moment you own them.

The one case where the loss really is gone

Revenue Ruling 2008-5 addresses what happens when you sell shares at a loss in a taxable account and your IRA buys the same security within the window. The answer is severe: the loss is disallowed under section 1091, and there is no basis increase — not in the taxable account, because you no longer hold the shares there, and not in the IRA, because IRA basis does not work that way.

The deduction is destroyed outright. No later sale recovers it. Selling inside the IRA does nothing, because gains and losses inside an IRA have no tax consequence at all.

What makes this dangerous is that nothing warns you. Brokers report wash sales only within a single account, and are not required to look across your taxable account and your IRA — even at the same firm, and certainly not across two. An automatic monthly IRA contribution buying an index fund can silently destroy a loss you harvested in a taxable account two weeks earlier. The rule applies to your spouse's accounts too, since a married couple is treated as one taxpayer for this purpose.

What "substantially identical" means in practice

The statute uses the phrase "substantially identical" and the code never defines it, which leaves a genuinely grey area that no calculator can resolve for you.

Some points are settled. The same stock is identical. Common and preferred shares of the same company generally are not, nor are bonds of different maturities. Two S&P 500 index funds from different providers tracking the same index are widely treated as a real risk, though the IRS has never ruled on it directly.

The common practice is to swap into something correlated but demonstrably different — a total market fund for an S&P 500 fund, or an index fund from a different provider tracking a different index. That preserves market exposure while giving a defensible answer to the question. The aggressive version, buying the same fund from a different provider tracking the identical index, is the one where reasonable advisers disagree.

One clear trap: buying a call option on the security you just sold at a loss triggers the rule, because acquiring a contract or option to acquire substantially identical stock counts. Selling a deep-in-the-money put has been treated the same way.

What this assumes, and where it stops

Assumptions

  • The security sold and the security repurchased are substantially identical, which is the fact the rule turns on.
  • The dates entered are trade dates, which is what section 1091 uses, rather than settlement dates.
  • All shares in the sale were acquired at the same cost, so a single per-share basis applies.
  • The repurchase is the only acquisition inside the window.

Limitations

  • Whether two different funds are "substantially identical" is a judgement the calculator cannot make for you.
  • Multiple purchases across the window are matched here as a single block; the IRS matches them chronologically, which can change how much is disallowed.
  • Accounts belonging to a spouse and to a controlled company are within the rule and are not separately modelled.
  • Options and short sales can trigger the rule and are not handled here.
  • The $3,000 annual limit on deducting net capital losses against ordinary income is not applied to the deductible figure shown.

Common questions

How long do I have to wait to avoid a wash sale?

Thirty-one days after the sale. The rule covers 30 days before and 30 days after the loss sale — a 61-day window with the sale in the middle — so repurchasing on day 31 or later is clear. The window running backwards catches people out: buying shares two weeks before you sell an older lot at a loss is also a wash sale, even though the purchase came first.

Do I lose the loss permanently in a wash sale?

Usually no. The disallowed loss is added to the cost basis of the replacement shares under section 1091(d), so you recover it when you sell those shares. The cost is timing rather than the deduction itself. The one exception is severe: if the replacement is bought inside an IRA or Roth IRA, Revenue Ruling 2008-5 disallows the loss with no basis increase anywhere, and it is gone for good.

Does a wash sale in my IRA affect my taxable account?

Yes, and this is the most expensive version of the rule. If you sell at a loss in a taxable account and your IRA buys the same security within 30 days, the loss is disallowed and no basis adjustment is available in either account, so the deduction is permanently destroyed. Automatic IRA contributions buying the same fund you just harvested are a common way this happens, and no broker will flag it.

Can I sell at a loss in December and buy back in January?

Only if 31 days have passed. Selling on 15 December and buying on 5 January is still a wash sale, because the window runs by days rather than by tax year — the change of calendar makes no difference. Selling on 15 December means waiting until 15 January. Note that the disallowed loss is deferred into the new basis, so a December wash sale generally postpones the deduction by a year rather than losing it.

Sources

Formula and content last reviewed on .

Results are estimates for information only, not professional advice.

Report an error

Tools people commonly use alongside the wash sale calculator.

See all finance calculators →