Wash Sale Rule 2026: Complete Guide to Avoiding Costly Tax Mistakes
Learn how the IRS wash sale rule works in 2026, the 30-day window that disallows losses, and smart strategies to stay compliant while still harvesting tax losses effectively.

What Is the Wash Sale Rule and Why Does It Matter?
The wash sale rule is an IRS provision that prevents investors from claiming a tax deduction on a loss if they buy back the same or substantially identical security within 30 days before or after the sale. It sounds simple enough on paper, but in practice this rule trips up thousands of investors every tax season — and the penalties for getting it wrong are not just a disallowed loss, but also a complicated adjustment to your cost basis that carries forward until you finally sell the replacement shares without triggering another wash sale.
Congress created the wash sale rule in 1921 specifically to stop investors from manufacturing artificial losses at year-end. Before the rule existed, an investor could sell a stock at a loss on December 30, claim the deduction on that year's return, and buy the same stock back on January 2. The wash sale rule closed that loophole by saying: if you repurchase the same security within the 61-day window (30 days before the sale through 30 days after), your loss is disallowed and added to the cost basis of your new shares. The deduction does not disappear forever — it gets deferred — but the deferral creates tracking headaches and can push the tax benefit into a year when you are in a lower bracket, reducing its value.
If you are working through how to report capital gains on your tax return, wash sale adjustments show up directly on Form 8949 and flow through to Schedule D. Each disallowed loss increases the basis of your replacement shares, which means you need to track these adjustments carefully or risk double-reporting the same economic loss.
How the 30-Day Window Actually Works
The wash sale window spans 61 days total: the day of the sale, plus 30 calendar days before and 30 calendar days after. Any purchase of a substantially identical security within that window triggers the rule. Notice that the window is symmetric — it looks backward and forward from the sale date. This catches investors who accidentally buy more shares a few days before selling at a loss, not realizing that the purchase they thought was unrelated actually triggers a wash sale.
Here is a concrete example. You sell 100 shares of Microsoft at a $2,000 loss on November 15. If you bought 100 shares of Microsoft anytime between October 16 and December 15, you have a wash sale and the $2,000 loss is disallowed. The date range includes weekends and holidays — there are no trading-day exceptions. The IRS counts calendar days, not market days, which means a Friday afternoon sale followed by a Monday morning repurchase is almost certainly a wash sale because only two calendar days have passed.
The disallowed loss does not vanish. Instead, it gets added to the cost basis of the replacement shares. So if you bought the replacement Microsoft shares at $300 each and had a $2,000 disallowed loss, your adjusted basis becomes $300 per share plus $20 per share (the $2,000 loss spread across 100 shares), giving you a basis of $320 per share. When you eventually sell those shares, the higher basis reduces your gain or increases your loss at that time. Use our short-term capital gains calculator to see how these basis adjustments change your tax liability when you hold replacement shares for less than a year.

Which Lot Gets Disallowed First
When you buy replacement shares on several dates, the matching order matters. The rule pairs your loss with the earliest replacement purchase in the 61-day window. Shares bought first absorb the disallowed loss first, and their basis rises accordingly.
Say you sold at a loss on June 10 and repurchased on June 12, June 20, and July 2. The June 12 lot carries the disallowed loss and the higher basis. Most brokers apply this oldest-first sequence automatically, but manual traders tracking lots in spreadsheets should mirror it.
What Counts as "Substantially Identical"?
The IRS uses the term "substantially identical" rather than "identical," and that distinction creates enormous confusion. Here is what we know for certain, what is grey area, and what is clearly safe.
Clearly Triggers a Wash Sale
Buying the exact same stock you just sold at a loss always triggers a wash sale. If you sell Apple at a loss and buy Apple shares within 30 days, that is a wash sale. The rule also applies if you buy the same stock in a different account — your IRA, your spouse's account, or an account where you have power of attorney all count. The IRS looks at your total ownership, not just the account where the sale occurred. This is a trap for investors who sell in their taxable brokerage and repurchase in their IRA, thinking the separate accounts shield them. They do not.
Grey Area: ETFs and Options
Buying an S&P 500 index fund after selling a different S&P 500 index fund at a loss is a grey area. The IRS has never issued clear guidance on whether two different S&P 500 ETFs (like SPY and VOO) count as substantially identical. Most tax professionals take the conservative position that different ETFs tracking the same index are not substantially identical because they have different fund managers, expense ratios, and creation mechanisms. However, buying a Vanguard S&P 500 fund after selling a Vanguard S&P 500 fund in a different share class would likely be considered substantially identical because the economic exposure is identical.
Options and contracts on the same stock also trigger wash sales. If you sell Microsoft stock at a loss and buy a Microsoft call option within 30 days, that is a wash sale. The IRS treats options on the same security as substantially identical to the underlying stock. But selling a Microsoft call at a loss and buying a Microsoft put is not a wash sale, because calls and puts have opposite economic exposures.
Clearly Safe: Different Securities
Selling one tech stock and buying a completely different tech stock is always safe. If you sell NVIDIA at a loss and buy AMD, no wash sale. Selling an individual stock and buying a sector ETF that includes that stock is also safe — an ETF is never substantially identical to an individual stock it holds. This is why many tax-loss harvesting strategies involve selling an individual stock and buying a sector ETF as a temporary placeholder.
Wash Sale Rule and Cryptocurrency
Here is where things get really interesting. As of 2026, the IRS does not apply the wash sale rule to cryptocurrency. That means you can sell Bitcoin at a loss on December 30, claim the deduction on your tax return, and buy Bitcoin back on December 31 — and the loss is fully deductible. The wash sale rule, under Internal Revenue Code Section 1091, applies to "stocks and securities," and the IRS has not classified crypto as securities for wash sale purposes.
However, this loophole is closing. The Infrastructure Investment and Jobs Act of 2021 expanded IRS reporting requirements for crypto, and Congress has repeatedly proposed extending the wash sale rule to digital assets. Multiple bills have been introduced that would classify cryptocurrency as a security for wash sale purposes, and most tax professionals expect the rule to cover crypto by 2027 or 2028. If you are using our crypto capital gains calculator to plan your year-end tax strategy, keep in mind that the current wash sale exemption for crypto could change with future legislation. The safe approach is to track your crypto wash sales now, even though they are not currently disallowed, so you are prepared if the law changes retroactively.
The direction of travel matters here. Treasury and White House proposals have recommended extending wash-sale-style disallowance to digital assets. Broker basis reporting went live on January 1, 2026.
Clean records today turn into a routine filing chore tomorrow instead of a reconstruction project. Nothing in current law taxes you extra for keeping good logs.
How Wash Sales Affect Your Cost Basis Tracking
The biggest practical problem with wash sales is not the rule itself — it is the bookkeeping. Every time a wash sale occurs, your replacement shares get a higher cost basis, and you need to track that adjusted basis for when you eventually sell. If you have multiple wash sales on the same stock across different lots and purchase dates, the basis adjustments compound and your brokerage's tracking may not match your own records.
Here is a scenario that plays out constantly. You sell 50 shares of Tesla at a $3,000 loss on March 1. You buy 50 shares back on March 15. The $3,000 loss is disallowed and added to the basis of the March 15 shares. Then you sell those 50 shares at a $1,500 loss on April 10 and buy back 50 shares on April 25. The April 10 loss is also a wash sale, so the $1,500 disallowed loss gets added to the basis of the April 25 shares — on top of the $3,000 already added from the first wash sale. Your April 25 shares now carry $4,500 in deferred losses embedded in their basis. When you finally sell them without repurchasing, you recover the entire $4,500 deduction. But if you make a third wash sale, the compounding continues. Our long-term capital gains calculator can help you model the tax impact of selling these adjusted-basis shares after holding them for more than a year.
Wash Sale Calculator: Worked Examples
You can compute a wash sale adjustment in four lines. Take the disallowed loss, add it to the basis of the replacement shares, and add the holding period of the old shares to the new ones. The three examples below cover the situations investors actually run into: a clean repurchase, a partial sale, and the double-down order that surprises people. Run your own trade through the same sequence before you file, because your broker’s figure can differ when trades cross accounts.
| Example | Trade sequence | Disallowed loss | New basis per share | Result |
|---|---|---|---|---|
| 1. Straight repurchase | Buy 100 shares at $50, sell at $40, rebuy 100 shares at $38 within 30 days | $1,000 (100 x $10) | $38 + $10 = $48 | Loss deferred, not lost; future gain shrinks by $1,000 |
| 2. Partial sale | Hold 200 shares, sell 50 at a $500 loss, rebuy 50 shares within 30 days | $500 on the 50 shares sold | Replacement 50 shares absorb the full disallowed loss | Other 150 shares keep their original basis |
| 3. Double-down trigger | Buy 100 more shares at $45, then sell the original 100 shares (bought at $60) two days later at $55 | $500 loss disallowed | New shares: $45 + $5 = $50 | Buying first does not dodge the rule; order within 30 days is what counts |
Notice what never happens in these examples: the loss does not vanish. It rides inside the replacement shares and comes back as a smaller gain or a bigger loss when you finally sell them. That is also why a wash sale in a tax-advantaged account is the one truly bad outcome — the disallowed loss disappears permanently inside the IRA.
Smart Strategies to Avoid Wash Sales While Still Harvesting Losses
You do not have to choose between harvesting losses and staying compliant with the wash sale rule. Several strategies let you capture tax losses while maintaining your market exposure.
Strategy 1: Wait 31 Days
The simplest approach is to sell your losing position, wait 31 calendar days, and then repurchase. The downside is 31 days of market exposure risk — the stock could rally while you are on the sidelines. For investors with concentrated positions in stocks with significant gains, this timing risk is real. One way to partially hedge this risk is to buy a correlated but not substantially identical security during the waiting period. For example, sell an S&P 500 index fund and buy a total market index fund for 31 days.
Strategy 2: Double Up
Buy the replacement shares first, wait 31 days, and then sell the original losing shares. This keeps you invested the entire time, but requires additional capital to buy the second position. The risk here is that the stock continues to decline during the 31-day waiting period, increasing your total loss exposure.
Strategy 3: Switch to a Similar but Different Investment
Sell the specific ETF or stock at a loss and immediately buy a similar but not substantially identical replacement. Sell an iShares Russell 2000 ETF and buy a Vanguard Russell 2000 ETF. Sell NVIDIA and buy a semiconductor sector ETF. These swaps maintain similar market exposure without triggering wash sales because the investments are not substantially identical.
Strategy 4: Harvest Losses in Tax-Advantaged Accounts Carefully
Be extremely careful about harvesting losses across account types. Selling a stock at a loss in your taxable account and buying it back in your IRA within 30 days triggers a wash sale — and unlike wash sales within a taxable account, the disallowed loss from an IRA transaction cannot be added to any basis. The loss is gone permanently because IRAs do not track cost basis the same way taxable accounts do. This is the worst possible outcome: you lose the deduction entirely with no future recovery.
Reporting Wash Sales on Your Tax Return
Your brokerage is required to report wash sales on Form 1099-B, but only for transactions within the same account. If you trigger a wash sale across two different accounts, your brokerage will not catch it, but the IRS still expects you to report it correctly. You need to manually adjust your cost basis on Form 8949 for any wash sales not captured by your broker.
When you file, each wash sale appears as an adjustment on Form 8949 with code "W" in the adjustment column. The disallowed loss amount goes in the adjustment column, and the gain or loss column shows the adjusted amount (which will be zero for a disallowed loss). The total disallowed losses reduce your net capital loss for the year, which directly affects how much you can deduct against ordinary income.
For investors subject to the Net Investment Income Tax, wash sales are particularly painful because they can push your net investment income above the NIIT threshold by deferring losses into future years. A $10,000 disallowed loss in 2026 means $380 more in NIIT liability (3.8% of $10,000) if your investment income is near the threshold. That is a real cash cost, not just a deferral.
When Your Broker Reports the Wash Sale for You
Brokers flag wash sales on your 1099-B using adjustment code W in box 1f. The disallowed loss is not gone forever — it rides along as extra basis on the replacement shares. Your job is to carry that adjusted basis forward instead of claiming the loss twice.
The IRS receives the same form you do. Automated matching compares each 1099-B against your return, and skipped W codes are among the easiest discrepancies to catch. Reviewing box 1f before filing takes five minutes and prevents a CP2000 letter months later.
| Action | Date | Tax outcome |
|---|---|---|
| Sell 100 shares at a $2,000 loss | March 3 | Loss recognized on paper |
| Buy 100 identical shares | March 15 | Wash sale triggered |
| $2,000 loss disallowed | Filing time | Code W appears on 1099-B |
| Replacement basis rises to absorb loss | Ongoing | Smaller gain when those shares sell |
The table shows why professionals call the wash sale a deferral rather than a denial. The economic loss eventually reduces tax through the higher basis. What the rule punishes is trying to bank the loss while instantly rebuilding the same position.
Key Takeaways
The wash sale rule disallows losses when you buy substantially identical securities within 30 days before or after selling at a loss. The 61-day window is broader than most investors realize, and it applies across all your accounts including IRAs and your spouse's accounts. Disallowed losses are not gone forever — they are added to the basis of your replacement shares — but the basis tracking can become complicated quickly, especially with multiple wash sales on the same security. The simplest way to stay compliant is to wait 31 days before repurchasing, but strategies like switching to a similar ETF or doubling up can keep you invested while avoiding the rule. Cryptocurrency is currently exempt from wash sale rules, but that exemption is likely temporary. Track your wash sales carefully, report them correctly on Form 8949, and consider the NIIT implications when planning your year-end tax-loss harvesting.
Frequently Asked Questions
Does the wash sale rule apply to ETFs and index funds?
ETFs and mutual funds count as securities under Section 1091. Two funds tracking the same index can even count as substantially identical. It depends on how closely they mirror each other.
Can I sell at a loss and buy back in my IRA?
No, and this version is harsher. A repurchase inside an IRA permanently erases the loss, because disallowed amounts in retirement accounts never come back as basis. The IRS spelled this out in Revenue Ruling 2008-5.
How long do I have to wait to avoid a wash sale?
At least 31 days after the sale, counting carefully. The window looks 30 days back and 30 days forward from the sale date, so purchases on both sides count. Calendar the 31st day before you place any order.
Do wash sales apply to gains?
No. The rule only limits losses. You can sell a winner and rebuy immediately, though that shortcut rarely helps since the gain is taxable either way.
What happens if I accidentally trigger a wash sale?
Nothing catastrophic. The disallowed loss joins the basis of your replacement shares, and you deduct it when those shares eventually sell. Fix the lot details on your return and keep moving.
Does the wash sale rule apply across different accounts?
It can. Repurchases in another brokerage account, and even in an IRA, still count as replacements. Section 1091 looks at your overall activity, not just the account where the sale happened.
How are wash sale adjustments reported on my tax return?
The broker flags it with adjustment code W on Form 1099-B, and it flows into Form 8949’s adjustment column. The sales price stays on the form; the disallowed loss appears as a positive adjustment that reduces the reported loss. If the replacement shares sit in a different account, your broker cannot see the match and you must make the adjustment yourself — the full Form 8949 and Schedule D walkthrough covers where each number lands.
Fact-Checked & Reviewed
This article was written and fact-checked by Wasim Akram, Founder & Lead Researcher at TaxGainsCalc. Every rate, threshold, and rule referenced is verified against IRS publications and current tax law as of the date published. Tax laws change frequently — always consult a qualified tax professional for advice specific to your situation.
Disclaimer: This article is for informational purposes only and does not constitute tax, legal, or financial advice. Tax laws and regulations change frequently, and the information presented here may not reflect the most current updates. You should consult with a qualified CPA, tax attorney, or financial advisor before making any tax-related decisions. TaxGainsCalc is not responsible for any actions taken based on the information provided in this article.
Continue Reading
Wasim Akram
Wasim researches and writes every article on TaxGainsCalc, covering capital gains tax for everyday investors. Every figure is checked against primary IRS sources before it goes live.


