Wash Sale Rule Explained (October 2026): 61-Day Examples

The IRS wash sale rule blocks you from deducting a loss on a security you sold at a loss when you buy the same or a substantially identical security within 30 days before or after that sale. That adds up to a 61-day window covering the 30 days on each side plus the sale day itself. The disallowed loss is not gone: it is added to the cost basis of the replacement shares, and the original holding period carries over.

If you run a brokerage account, contribute to a 401(k) with money from a paycheck, or turn on automatic dividend reinvestment, you can trip this rule without doing anything deliberate. Here is how the timing works, what counts as substantially identical, how the disallowed loss is calculated, and how to report it.

Tax rules change and personal situations differ, so treat this as a working understanding of the mechanics rather than advice about your own return. When the numbers get genuinely tangled, a tax professional is the faster path.

Table of Contents
  1. What Is the Wash Sale Rule?
  2. The three conditions, in plain terms
  3. How the 30-Day Rule Works
  4. The December 31 trap
  5. What Counts as a Wash Sale?
  6. What substantially identical actually means
  7. How a Wash Sale Loss Is Calculated
  8. What Happens If the Replacement Shares Are Sold Later?
  9. Does the Wash Sale Rule Apply to ETFs and Mutual Funds?
  10. Common Wash Sale Exceptions
  11. How to Report a Wash Sale on Form 8949
  12. How to Avoid or Minimize Wash Sales
  13. Wash Sale Rule Examples for Investors
  14. Frequently Asked Questions
  15. How soon can I rebuy a stock after selling it?
  16. Is a wash sale good or bad?
  17. Can I get in trouble for a wash sale?
  18. Do wash sale rules apply to IRA accounts?
  19. Does the wash sale rule apply to cryptocurrency?
  20. What are the exceptions to the wash sale rules?
  21. Bottom Line

What Is the Wash Sale Rule?

Three things have to be true at the same time for a wash sale to exist: you sold a security at a loss, you bought the same or a substantially identical security, and you did it inside a 61-day window centered on the sale.

The rule dates back to 1921 and its purpose is anti-abuse, not anti-investor. Without it, a taxpayer could realize a loss on December 31 to offset this year’s gains, then buy the same position back on January 2 and owe no tax on the eventual recovery. The rule exists so that the tax result of owning a security is roughly the same whether you hold it straight through or trade around it.

The three conditions, in plain terms

  • Loss sale: the sale produced a realized loss after commissions and fees.
  • Substantially identical purchase: you acquired the same security, or one that tracks the same investment closely enough that the IRS would treat it as the same.
  • The 61-day window: 30 days before the sale, the day of the sale, and 30 days after it.

Miss any one of the three and there is no wash sale. A sale at a profit is not a wash sale, no matter when you buy back.

How the 30-Day Rule Works

How the 30-Day Rule Works

Count the sale day as day zero. The 30 days before it count backward, and the 30 days after it count forward. A purchase on any of those 61 calendar days can match against the sale.

Say you sell on July 1. The window opens on June 1 and closes on July 31, which makes August 1 the first day you can buy the same or a substantially identical security without creating a wash sale. That is the answer to the most-searched version of this question: wait 31 days.

The count runs backward as well as forward. If you buy 100 shares on June 20 and sell them at a loss on July 1, that purchase sits inside the window and part of your loss is disallowed even though you never re-bought after the sale.

Purchases and sales are not interchangeable here. Only acquisitions count as replacement purchases. Selling more shares of the same security inside the window adds losses to the pile but does not start a second matching window.

The December 31 trap

Year-end harvesting has a timing wrinkle worth planning around. A sale on December 31 does not stop the clock at midnight: the 30 days after it run straight into January. Many investors harvest a loss in late December, then have it undone by an automatic January purchase they never chose.

What Counts as a Wash Sale?

Stock, bonds, mutual funds, exchange-traded funds, and options on any of those are all securities, and all of them are covered. The variable is not the asset class but whether the replacement is substantially identical.

What you sold or boughtCovered by the wash sale ruleNote
Shares of a single companyYesThe clearest case there is
ETFs and mutual fundsYesSame fund, definitely
Options on a covered securityYesOption contracts count too
Bonds and bond fundsYesIncluding bond ETFs
A different company’s sharesNoGenuinely different investment
A different sector or asset class fundUsually noThe safe substitute when you need to stay invested
Money market and cash accountsNoNot substantially identical to stock
CryptocurrencyNoTreated as property, not a security
Commodity futures and foreign currencyNoOutside the rule’s scope

What substantially identical actually means

The IRS uses a facts-and-circumstances standard rather than a bright-line test, which is exactly why people get different answers everywhere. Buying the same CUSIP number is clearly a match. So is buying stock in the company that replaced it after a merger or reorganization, since a predecessor and its successor corporation count as the same security.

Convertible preferred stock and its common counterpart have also been treated as substantially identical. Swapping one broad index fund for a different S&P 500 index fund sits in genuinely gray territory, and the IRS has not spelled it out. Investors on ETF forums handle that by rotating between funds with meaningfully different holdings rather than arguing about the definition.

How a Wash Sale Loss Is Calculated

The math is matched share by share, not dollar for dollar. Take the simplest partial case first.

You bought 100 shares of a fund at a total basis of 1,000 dollars, so 10 dollars per share. Six weeks later you sold all 100 shares for 800 dollars, an 8 dollar loss per share and a 200 dollar loss overall. Eleven days after the sale you bought back 50 shares at 7.50 dollars each. Fifty replacement shares match fifty sold shares, so 50 times 8 dollars equals 400 dollars of loss is disallowed.

That leaves the other 50 sold shares unmatched, and their 400 dollars of loss stays deductible in the year of the sale. The disallowed 100 dollars goes into the replacement shares: the 50 new shares now carry a basis of 7.50 plus 2.00, which is 9.50 dollars each.

StepSharesBasis or priceLoss allowed or disallowed
Original purchase, Jan 61001,000 dollars total, 10 dollars eachNot yet realized
Sale at a loss, Feb 17100 sold800 dollars total, 8 dollars each200 dollar realized loss
Repurchase inside the window, Feb 2850 bought7.50 dollars eachMatches 50 sold shares
Disallowed portion508 dollars loss per share100 dollars disallowed
Deductible portion50 unmatched8 dollars loss per share100 dollars allowed
Adjusted basis of replacement shares509.50 dollars eachDisallowed loss folded into basis

When every sold share gets replaced, the entire loss is disallowed for that year. When no shares get replaced inside the window, the full loss stands and nothing changes about your basis. And multiple replacement purchases inside the same window stack: buying 40 shares in one week and 20 in another matches 60 sold shares, not 20, and the disallowed amount follows the 60.

What Happens If the Replacement Shares Are Sold Later?

The deferred loss comes back through cost basis. In the example above, those 50 replacement shares have a basis of 9.50 dollars each. Sell them later for 11.50 dollars each and the 100 dollar gain is fully taxable, because the 100 dollar wash sale amount is now collected. Your holding period on those shares also starts from the day you originally acquired the old shares, so the trade-over date is not erased.

This is why people describe a wash sale as a loan rather than a loss. Traders on options forums often frame it the same way: the deduction is deferred until the replacement position closes and stays closed for the full window.

Two things make it messier in practice. If you sell the replacement shares before the 31-day window closes, the loss stays deferred and rolls into whatever you buy next. And if you sell at a gain, the disallowed loss reduces that gain rather than appearing as a fresh deduction.

One outcome is not a deferral at all. If the replacement shares sit in an IRA or another tax-deferred account, Revenue Ruling 2008-5 says the basis is not increased and the holding period does not tack. That loss is permanently forfeited, and it is the single most expensive common mistake on this list.

Does the Wash Sale Rule Apply to ETFs and Mutual Funds?

Yes. ETFs and mutual funds are securities, so a loss followed by a repurchase of the same or a substantially identical fund inside 61 days is a wash sale, in a taxable account or anywhere else.

Dividend reinvestment is the quiet one. A dividend reinvestment plan buys fractional shares of the very same fund automatically, and nothing about it feels like a trade. Investors who turned their DRIP off specifically to protect a harvest find the habit worth keeping. Auto-investing from a paycheck works the same way, at smaller amounts and just as automatically.

ETF investors who need to stay in the market during a window have a practical workaround: rotate to a fund with genuinely different holdings rather than a near-twin of the same index. Members of r/ETFs describe exactly this, moving from a mega-cap index fund to a broader 750-name fund and then to the S&P 500 to avoid matching while keeping equity exposure.

Your broker’s report is narrower than the rule. Most brokers only match the same CUSIP inside the same account, so a wash sale between your taxable account and your IRA or your spouse’s account can pass through the Form 1099-B unnoticed. People find these at filing time, when tax software surfaces an adjustment with no explanation of which account caused it.

Common Wash Sale Exceptions

Several situations sit outside the rule entirely, based on the current federal treatment:

  • The sale was at a profit, so there is no loss to disallow.
  • The transaction involves commodity futures contracts or foreign currency.
  • You are a trader in the business of trading and use mark-to-market accounting for that activity.
  • The loss arose from a securities dealer’s ordinary-course transaction.
  • The shares were redeemed from a floating-NAV money market fund.
  • Cryptocurrency is involved, since it is treated as property rather than a security.

On that last one, the confusion is worth repeating. XRP, Bitcoin, and Ethereum are property under tax law, and the wash sale rule does not currently apply to them. Your normal capital gains and losses rules still apply, including the annual capital-loss limit. Legislative proposals have discussed extending the rule to digital assets, so this is the piece of the picture most likely to move.

Rule details and thresholds change, so confirm anything you rely on against current IRS guidance or with a preparer before acting on it.

How to Report a Wash Sale on Form 8949

How to Report a Wash Sale on Form 8949

You report the adjusted numbers, not the original ones. When a wash sale disallows part of a loss, you reduce the loss you claim on Form 8949 by the disallowed amount and enter the code W in the adjustment column with a positive number showing the disallowed loss.

The disallowed amount never disappears from your records. It attaches to the replacement shares as added cost basis, which is why keeping lot-level records matters as much at tax time as it does during the holding period.

Two things trip people up here. First, Form 1099-B Box 1g often reports zero or an incomplete wash-sale adjustment for anything that happened across accounts, because the broker’s matching stays inside one account and one CUSIP. Second, software that imports your forms can show a wash-sale adjustment without telling you why it appeared. Where your records and the reported figure disagree, your records govern, and an amended return is the normal route if you have already filed.

Check the current Form 8949 instructions for the exact column positions before you file, since the layout does shift between revisions.

How to Avoid or Minimize Wash Sales

  1. Wait 31 days. Sell on July 1 and the same security is safe to repurchase from August 1. This is the only method that is always correct, and it is the hardest one to follow with a passive plan.
  2. Substitute something genuinely different. A different sector fund, a bond allocation, or a broad international fund keeps you invested without matching. Similar-looking index funds are the risky middle ground.
  3. Turn off auto-invest and DRIP for the window. Automatic purchases are the ones you will not remember at filing time, and a single January reinvestment can undo a December harvest.
  4. Harvest inside a tax-advantaged account. Selling a losing position in an IRA or 401(k) produces no wash sale, because there is no deduction to disallow. The loss is simply gone, which is fine when you have no gains to offset.
  5. Reconcile accounts by hand once a year. Since brokers only report within a single account, a short review of the last 61 days across your taxable, IRA, 401(k), and any spousal accounts is the only way to catch a cross-account match.

None of these is free. Waiting 31 days means sitting in cash through a rally, substituting means accepting tracking error, and turning off reinvestment interrupts compounding. Day traders face the sharpest version of this trade-off, and the honest answer is that a full-time trader who treats the market as a business is generally better off harvesting inside a tax-advantaged account than pretending the timing rule does not apply.

Wash Sale Rule Examples for Investors

Selling a losing ETF and buying it back the next week. You sold at a loss on March 3 and bought the same fund on March 7. Every share repurchased inside the window is matched, the loss on those shares is disallowed, and it is added to the basis of what you just bought. If you bought the entire position back, the whole loss is deferred.

Selling a losing ETF and buying a different one. You sold a technology sector fund at a loss and bought a health care sector fund two days later. Different holdings, different index, not substantially identical, so the loss stands and the harvesting worked as intended. This is the strategy people use to stay invested through a window.

Reinvesting dividends during a harvest. You sold a fund at a loss on November 20, and the DRIP bought back 140 dollars worth of the same fund on December 4. You did not place that order, but the rule does not care. That much of the loss is disallowed, and matching it across accounts is left entirely to you.

Selling in a taxable account and rebuilding in an IRA. You sold at a loss on June 2 and contributed to a new IRA a week later, buying the same fund inside it. This is a wash sale, and under Revenue Ruling 2008-5 the IRA basis is not increased. The loss is permanently forfeited, not deferred. It is the outcome that surprises people most.

Selling the entire position. Closing out the whole position does not close the window. If you repurchase substantially identical shares within the following 30 days, the loss is still disallowed. Selling everything only avoids the rule if you wait 31 days before buying back.

A paycheck contribution you never thought about. You harvested a loss in your taxable account on December 28, and your 401(k) payroll deduction bought the same fund on January 5. The plan was not in the 30 days before your sale, so that purchase does not match. But any January purchase after the sale does, and the calendar does not care that you found out in February.

Frequently Asked Questions

How soon can I rebuy a stock after selling it?

Wait 31 days. If you sell on July 1, the earliest you can repurchase the same or a substantially identical security is August 1. The window runs 30 days before the sale, the sale day itself, and 30 days after it. Buying earlier than that, including before the sale, can also trigger the rule.

Is a wash sale good or bad?

It is a timing rule rather than a penalty. The loss you cannot deduct now is added to the cost basis of the replacement shares, so you collect it later instead. The one genuinely bad outcome is a replacement inside an IRA, where the basis is never increased and the loss is permanently lost.

Can I get in trouble for a wash sale?

No. Triggering a wash sale is not an offense, carries no penalty, and does not by itself prompt an audit. The only consequence is that you cannot deduct that loss in the year of the sale. The actual problem is misreporting it, such as failing to enter code W on Form 8949, which can mean an amended return.

Do wash sale rules apply to IRA accounts?

Yes. The rule is account-neutral, so a loss in a taxable account paired with a repurchase in an IRA, 401(k), or a spouse’s account still counts. Under Revenue Ruling 2008-5 the IRA basis is not increased, which makes the loss permanently forfeited rather than deferred into a higher cost basis.

Does the wash sale rule apply to cryptocurrency?

Not currently. Cryptocurrency is treated as property rather than as a security, so selling XRP, Bitcoin, or Ethereum at a loss and buying it back immediately is not a wash sale. Normal capital gains and losses rules still apply, including the annual capital-loss limit, and legislative proposals have discussed extending the rule.

What are the exceptions to the wash sale rules?

There is no wash sale when the sale produced a profit, when the transaction involves commodity futures or foreign currency, when you are a trader in the business of trading using mark-to-market accounting, when the loss came from a securities dealer’s ordinary-course transaction, or when shares were redeemed from a floating-NAV money market fund.

Bottom Line

Start with your account settings, not your tax software. Turn off dividend reinvestment and automatic investing for any fund you are harvesting, then check the 61 days on either side of each sale across every account you hold. If a wash sale already happened, the loss is not lost: it is sitting in the basis of whatever you bought instead.

Leave a Comment

Clear guides to money, markets and investing

Browse the guides