Smekys
Ad Space

Wash Sale Calculator

Wash sale calculator: disallowed loss, deductible loss, and adjusted cost basis when you repurchase a substantially identical security within 30 days.

Enter Values

$

The total money you received from selling the losing position (net of commissions).

$

What you originally paid for the shares you sold, including commissions.

$

The total cost of the substantially identical shares you bought back.

days

Use a negative number if you bought back the position BEFORE the sale. Within ±30 days triggers the rule.

Result

Realized Gain / (Loss)
$-2,000.00
Wash Sale Triggered?
1
Disallowed (Non-Deductible) Loss
$2,000.00
Deductible Loss This Year
$0.00
Adjusted Cost Basis of New Shares
$6,200.00
Tax Treatment
0

Selling an investment at a loss is painful — but at least you can usually deduct that loss against your other income on your tax return. The IRS wash sale rule (Internal Revenue Code Section 1091) is the exception: if you sell a stock, ETF, or mutual fund at a loss and then buy a "substantially identical" security within 30 days before or after the sale, the IRS will not let you claim that loss on your taxes. This wash sale calculator shows you exactly how much of your loss is disallowed, how much you can still deduct, and what your new cost basis becomes.

The rule is designed to stop people from selling a losing position purely to grab a tax break while immediately jumping back into the same investment. If that is what you did, the loss is not gone forever — it is deferred. The disallowed amount gets added to the cost basis of your replacement shares, so you recapture it when you eventually sell those shares for good.

How to Use

  1. Enter your Sale Proceeds — the total cash you actually received when you closed the losing position, after commissions and fees.
  2. Enter your Original Cost Basis — what you originally paid for those shares, including any fees and prior adjustments. If this number is larger than your proceeds, you took a loss.
  3. Enter your Repurchase Price — the total amount you paid to buy back the same (or substantially identical) security. This can include a near-equivalent ETF or the same fund in a different share class.
  4. Set Days Between Sale and Repurchase. Use a positive number if you bought back after the sale, and a negative number if you bought back before the sale (for example, -10 means you repurchased ten days before you sold the lot). The IRS window is 30 days on either side, for a total of 61 calendar days.
  5. Read the result card. The calculator tells you whether a wash sale was triggered, how much loss is disallowed, how much you can still deduct this year, and your adjusted new cost basis.

How the Wash Sale Math Works

The calculation follows IRS Publication 550. First, the engine computes your realized result:

realizedGainLoss = Sale Proceeds − Original Cost Basis

If that number is negative, you have a loss. The size of that loss is costBasis − proceeds.

Next, the engine checks the timing. A wash sale is triggered only when both conditions are true:

  • You sold at a loss (realizedLoss > 0), and
  • You acquired substantially identical securities within 30 days before or after the sale (abs(daysBetween) ≤ 30).

When the rule is triggered:

  • Disallowed loss = the full realized loss. You cannot deduct it this year.
  • Deductible loss = $0. The loss is deferred, not erased.
  • New cost basis = your repurchase price + the disallowed loss.

That last step is the silver lining. Say you sold for $4,000 shares that cost you $6,000 — a $2,000 loss — and then bought back the position for $4,200 within 15 days. The $2,000 loss is disallowed, but your new cost basis jumps from $4,200 to $6,200. When you eventually sell those replacement shares, your taxable gain will be $2,000 smaller (or your loss $2,000 larger), which is exactly where the deferred loss resurfaces.

If the rule is not triggered — either because you sold at a gain, or because more than 30 days passed — then the entire loss stays deductible and your new cost basis is simply what you paid to repurchase.

What Counts as "Substantially Identical"?

This is the part the IRS deliberately leaves vague, and it matters because the whole rule hinges on it.

  • Buying the exact same stock or ETF you just sold is the clearest wash sale.
  • Buying a different share class of the same mutual fund (for example, switching from Admiral to Investor shares) is very likely treated as substantially identical.
  • Buying a bond or preferred stock of the same issuer at nearly the same terms can also qualify.
  • Buying a different but similar ETF tracking a slightly different index is usually safe — for example, selling VOO and buying SPYG is generally not a wash sale, but selling VOO and buying another S&P 500 ETF like IVV or SPY is a gray area most tax preparers treat cautiously.

The rule also reaches across your own accounts: IRAs, spouse's accounts, and even your business entity's accounts all count. A classic and expensive mistake is realizing a loss in your taxable brokerage while the same security sits in your IRA — the loss is disallowed and the basis adjustment does not carry into the IRA, so the deferred loss is permanently lost.

Examples

Example 1 — A classic wash sale. You bought 100 shares for $6,000, sold them for $4,000 (a $2,000 loss), and 15 days later bought the same ETF back for $4,200. The calculator flags a wash sale: $2,000 disallowed loss, $0 deductible this year, and a new adjusted cost basis of $6,200. When you sell the replacement shares later, that $2,000 comes back to you in the form of a smaller taxable gain.

Example 2 — Outside the 30-day window. Same $2,000 loss, but you waited 45 days before buying back at $4,200. No wash sale. You deduct the full $2,000 loss on this year's return, and your new cost basis is the $4,200 you actually paid.

Example 3 — Repurchasing before the sale. You bought the position back 10 days before you sold the old lot (daysBetween = -10), locking in the same $2,000 loss. Because the rule looks 30 days in both directions, this still triggers a wash sale: $2,000 disallowed, new basis $6,200.

Example 4 — A six-figure tax-loss harvest. A investor sells a losing index position for $1,500,000 against a $2,000,000 cost basis (a $500,000 loss) and immediately repurchases a similar but not identical fund for $1,550,000. If the replacement is treated as substantially identical within 20 days, the full $500,000 is disallowed and added to the new basis of $2,050,000 — a basis adjustment that large materially changes the long-term gain on the eventual exit.

FAQ

What is the wash sale rule in simple terms?

If you sell a stock or fund at a loss and buy the same or a "substantially identical" investment within 30 days before or after the sale, the IRS disallows (blocks) that loss on your tax return. The loss is not permanently lost — it is added to the cost basis of your new shares and waits until you sell those.

How long is the wash sale window?

The window is 30 days before plus 30 days after the sale date, totaling 61 calendar days. If you repurchase on day 31 or later, the loss remains fully deductible. Weekend days and holidays count toward the 30 days; the clock runs continuously.

Is a wash sale always bad?

Not always. It defers a tax benefit rather than destroying it. If you would have held the replacement shares for many years anyway, a higher basis simply reduces a future taxable gain — often at a similar long-term rate. The real danger is accidentally triggering a wash sale inside an IRA, where the basis adjustment disappears and the loss is gone for good.

Does the wash sale rule apply to IRAs and Roth IRAs?

Yes, and this is the harshest scenario. If you realize a loss in a taxable account and buy the substantially identical security in your IRA or Roth IRA within the window, the loss is permanently disallowed — you do not get the basis step-up in the IRA. Many investors have accidentally triggered this by dividend reinvestment inside an IRA.

Can I avoid a wash sale by buying a "similar" ETF?

Usually yes, if the funds track genuinely different indexes. Selling a total U.S. stock market ETF and buying a total international ETF is safe. Selling an S&P 500 ETF and buying a Russell 1000 ETF is generally considered safe, but swapping between different S&P 500 ETFs (VOO, IVV, SPY) is a gray area that most tax professionals avoid during a tax-loss harvest.

What happens to my holding period?

When a wash sale is triggered, the holding period of the old (sold) shares is tacked on to the holding period of the new shares. This matters if you need the position to qualify for long-term capital-gains treatment: the clock does not restart at the repurchase date.

Disclaimer

This wash sale calculator is provided for informational purposes only and does not constitute tax, legal, or investment advice. Results are estimates based on the inputs you enter and on a simplified reading of IRS Publication 550; the determination of whether two securities are "substantially identical," cross-account interactions, IRA triggers, and state-tax treatment are complex and fact-specific. Wash-sale rules can change and are applied differently by brokers and the IRS. Always consult a qualified tax professional before executing a tax-loss harvest or relying on these numbers for your return.

Related Calculators

Disclaimer

Results are estimates for illustration only. Verify important figures independently.