The Wash Sale Rule Explained: What Happens to Your Tax Loss?
If you sell stock at a loss and buy the same or substantially identical securities within 30 days before or after the sale, U.S. tax rules generally disallow the loss on the matched shares. For a taxable-account replacement, that loss usually increases your cost basis. A purchase inside an IRA or Roth IRA works differently.

Try our free Federal Income Tax Calculator to calculate your calculated 2026 federal tax after working out your reportable investment gains.
1. What triggers a wash sale?
The wash sale rule comes into play when you sell stock or securities at a loss and acquire substantially identical securities during the 30 days before or after the sale. A contract or option to acquire substantially identical securities can also trigger the rule. The tax effect is disallowance of the loss on the matched shares. You can still place the trade. 26 U.S.C. § 1091
Check the loss by tax lot if you bought the position in several batches. One order can close older shares at a gain and newer shares at a loss, depending on what you paid. A replacement purchase can affect the loss lot even if the total sale showed a profit. The holding period of each lot also matters when reporting any gain or allowable loss. Long-term capital gains guide
2. Count 30 calendar days on both sides of the sale
Start with the loss sale as day zero. Look 30 calendar days back and 30 calendar days forward, including both boundary dates. Add the sale date itself and you have a 61-day window. For ordinary exchange-traded shares, use your trade confirmations and the trade dates when reviewing the timeline. IRS Publication 550
Suppose you sell an older lot on December 22, 2026. A replacement purchase on December 10 can count even though it came before the sale. A purchase on January 21, 2027 is exactly 30 days after the sale and can affect the loss on your 2026 return. January 22 falls outside the post-sale window for that sale. A January purchase can matter even when your year-end statement initially shows the December loss.
| Date | Position in the window | Can a replacement purchase count? |
|---|---|---|
| November 22, 2026 | 30 days before the sale | Yes |
| December 22, 2026 | Date of the sale | Yes |
| January 21, 2027 | 30 days after the sale | Yes |
| January 22, 2027 | 31 days after the sale | Outside the window for this sale |
3. Where the disallowed loss goes
When you buy replacement shares in a taxable account, the disallowed loss generally increases their cost basis. The replacement shares generally also inherit the holding period of the shares sold. That basis adjustment affects the gain or loss when you later sell the replacement shares. IRS guidance on wash sales and basis
Assume you originally bought 80 shares for $72 each and sold them for $61.50 each. The loss is $10.50 per share, or $840 in total. Six days later, you buy 80 shares of the same stock for $63 each in your taxable account. The $840 loss is disallowed on the first sale and increases the basis of the replacement shares from $5,040 to $5,880, or $73.50 per share. The adjusted basis differs from the original $72 because you repurchased at a different price than you sold for.
If you later sell all 80 replacement shares for $76 each, you receive $6,080 before fees. Subtract the $5,880 adjusted basis and the gain is $200. Using only the $5,040 repurchase cost would overstate that gain by $840. If the later sale instead produces a loss and you replace those shares again inside the window, the rule can apply again.
For example, start again with those 80 replacement shares at $73.50 of adjusted basis per share. If you sell them for $70 apiece, you have a $280 loss for tax purposes before applying the rule again. Buying all 80 shares back at $71 within the window would generally add that $280 to the newest lot, resulting in a basis of $74.50 per share. Keep the old adjustment as part of the prior lot’s records. The newest adjustment is $280, because the earlier $840 was already included in the basis used to calculate the second sale.
Adjusted basis of taxable replacement shares = their purchase cost + the disallowed loss on matched shares
| Step | Calculation | Amount |
|---|---|---|
| Loss on the original sale | 80 × ($72 − $61.50) | $840 |
| Cost of replacement shares | 80 × $63 | $5,040 |
| Adjusted basis of replacement shares | $5,040 + $840 | $5,880 |
| Gain after a later sale at $76 per share | $6,080 − $5,880 | $200 |
4. What if you buy back fewer shares than you sold?
A partial wash sale generally disallows the loss only on the shares matched to replacement purchases. Say you sell 120 shares from a single lot at a $6 loss per share. You buy back 25 shares first and another 35 during the window. Assuming no other matching transactions, 60 replacement shares match 60 shares sold. The original $720 loss splits into $360 disallowed and $360 that can still be included in your capital gain and loss calculation.
For taxable replacement lots, add $150 to the basis of the 25-share batch and $210 to the 35-share batch. The IRS matches replacement shares in purchase order, starting with the earliest. If your sale included multiple lots with different losses per share, match the actual shares and losses instead of spreading one average loss across everything. IRS share-matching guidance
5. How to think about ETFs, stocks, and options
Repurchasing the same shares is the clearest case. Buying a call option to acquire the same stock can also matter because the rule covers contracts and options to buy substantially identical securities. Review the underlying security as well as the instrument you traded. Wash sale statute
The IRS says whether two securities are substantially identical depends on the facts and circumstances. For ETFs, a different ticker or sponsor does not establish that two funds are different enough. Two funds following the same index deserve closer review. The IRS guidance does not supply an ETF-by-ETF safe list. If you compare funds, start with their benchmarks, holdings and investment mandates, and get tax advice when the classification could materially change your return. IRS Publication 550
6. Check other accounts and the IRA exception
Review the transactions across your accounts. Buying the same shares at a second broker can still match a loss sale at the first. IRS guidance also addresses substantially identical purchases by a spouse or a corporation you control. Automatic purchases, including dividend reinvestments, can create a match on part of the position even when you never place a buy order yourself. IRS Publication 550
A purchase in your traditional IRA or Roth IRA can disallow a taxable-account loss without increasing your IRA basis. If the 80 replacement shares in the worked example were purchased by your IRA instead of your taxable brokerage account, the $840 would be disallowed and the usual taxable-account basis adjustment would be unavailable. That can make the loss permanently unavailable for deduction. IRS Revenue Ruling 2008-5
7. What to review before harvesting a tax loss
Tax-loss harvesting starts with a loss you can actually use under the capital loss rules. Calculate the loss by lot, then check your other gains, losses, and carryovers before assuming how much the sale will reduce your tax. A disallowed wash sale loss does not offset the year’s other gains on that sale, even if your portfolio statement shows the trade as a loss. IRS capital gains and losses guidance
Look backward before choosing a sale date. For example, if you added shares two weeks ago and now plan to sell an older block at a loss while keeping those newer shares, waiting 31 days after the sale to buy again does not change the earlier purchase. Check how many shares the earlier purchase could match. Review the dates of any scheduled purchases within the forward window too.
Consider what the transaction would do to your portfolio while the window is open. Holding cash changes your market exposure. Buying another fund can change the market segment you own, the concentration of its holdings, or its costs. Compare those differences with the potential tax effect. Keep the plan tied to the shares you intend to sell and confirm the actual trade dates afterward.
8. Reconcile Form 1099-B and report the adjustment
Box 1g on Form 1099-B may show a disallowed loss. Brokers are generally required to flag certain covered transactions with the same security identifier in the same account. A blank box can miss matches across brokers or accounts. Compare the form with your trade history, then reconcile the loss and replacement basis before entering the sale. IRS broker reporting instructions
For a wash sale reported on Form 8949, enter code W in column (f) and enter the disallowed loss as a positive adjustment in column (g), following the instructions for your filing year. In the original sale from the example, the $840 adjustment cancels the $840 loss. For the partial example, a $360 adjustment leaves a $360 loss before netting with other gains and losses. Keep the replacement lot records for the return covering their eventual sale. IRS Form 8949 instructions
- List the sale date, tax lot, quantity, proceeds, and basis for each loss trade.
- Check purchases and automatic reinvestments across the full window, including January trades for a late-December sale.
- Record which shares matched and how much of the loss was disallowed. Keep taxable-account basis adjustments tied to their replacement lots.
- Check broker and tax-software adjustments against your records so the same adjustment is applied once.
Keep exploring Percentio
Browse the full directory to find related calculators and compare the assumptions that matter to your situation.
Browse all financial calculators →Questions and answers
Practical answers to common planning questions.


