Return Measure

About the Wash Sale Gate

What this calculator answers

Tax-loss harvesting is a legitimate strategy for cutting your tax bill by realizing investment losses to offset gains. The wash sale rule blocks the deduction if you buy back the same security (or a 'substantially identical' one) within 30 days before or after the loss sale. This tool checks whether your planned harvest trips the rule and explains what to do instead if it does.

How the math works

The wash sale window is 61 days total: 30 days before the loss sale, the day of the sale, and 30 days after. If you bought (or buy) the same security or a substantially identical one anywhere in that 61-day window, the loss is disallowed for tax purposes. The disallowed loss is added to the cost basis of the replacement shares, effectively deferring the deduction rather than eliminating it. The tool takes your sale date and any purchase dates and flags conflicts.

When to use it

  • You are planning a year-end tax-loss harvest and want to confirm none of your recent buys (including automatic dividend reinvestment) blocks the deduction.
  • You sold a position at a loss and are deciding when it is safe to repurchase the same security.
  • You want to harvest a loss but stay roughly invested in the same sector or strategy by buying a similar but not substantially identical replacement.
  • You hold the same ticker in multiple accounts (taxable, IRA, spouse's account) and want to check whether IRS rules across accounts will trip the wash sale.

Common mistakes

  • Forgetting that dividend reinvestment purchases count. If your brokerage automatically reinvested a dividend in the 30 days before or after the sale, the corresponding shares are wash-saled.
  • Buying the same security in an IRA. The IRS explicitly states that wash sales can be triggered by purchases in your traditional or Roth IRA, even though IRAs are tax-deferred. The loss is permanently disallowed (not deferred) in that case.
  • Buying a substantially identical security. Two share classes of the same company or two ETFs tracking the same index are substantially identical. A 60 day swap between SPY and IVV (both S&P 500 ETFs) does not work.
  • Assuming the spouse's account is separate. Wash sale rules apply across both spouses' accounts for jointly filed returns. Your loss can be voided by your spouse's buy.

A worked example

On December 15 you sell 100 shares of stock XYZ at a 4,000 dollar loss. On December 28, the brokerage automatically reinvests a 90 dollar dividend, buying 2 shares of XYZ. The wash sale rule applies to those 2 shares: the loss on 2 of the 100 sold shares (about 80 dollars worth of loss) is disallowed and added to the basis of the 2 reinvested shares. The other 98 shares' loss (about 3,920 dollars) remains fully deductible. To avoid this entirely, turn off automatic dividend reinvestment before harvesting.

Frequently asked questions

What counts as 'substantially identical'?

The IRS has never published a bright-line definition, but the consensus is: same company's common stock, share classes that are economically equivalent, and two index funds tracking the same exact index. Funds tracking different indexes (S&P 500 versus Total Market) are generally considered distinct.

Can I sell at a loss and buy a similar ETF instead?

Yes, as long as the replacement is not substantially identical. A common strategy is to sell SPY and buy a different large-cap ETF (like VTI or SPLG) that tracks a related but distinct index, then swap back after 31 days if desired.

Does the wash sale rule apply to crypto?

Not currently under federal tax law (as of 2026), though the rule has been proposed multiple times in Congress. State rules vary. Consult your tax advisor before relying on this.

What happens if I trigger a wash sale by mistake?

The disallowed loss is added to the cost basis of the replacement shares. When you eventually sell those shares, you will realize the deferred loss. You do not lose the deduction permanently (except in IRA cases).

Should I just wait 31 days to repurchase?

Yes, the safest approach. Set a calendar reminder. The wash sale window is 30 days after the sale; you can buy back on day 31.

This page is for general educational information only. It is not financial, tax, legal, or medical advice. Consult a qualified professional before making decisions based on this tool.