The wash sale rule is a U.S. tax rule that disallows a capital loss when you sell a security at a loss and buy the same or a substantially identical security within 30 days before or after that sale. That is a 61-day window in total. Congress wrote it into the tax code in 1921 to stop investors from claiming a deduction while keeping the very same position.
It sounds narrow, and most people never run into it. But it quietly guts a lot of year-end tax loss harvesting, it can reach across your other brokerage accounts and into a spouse’s accounts, and inside an IRA it can erase the loss completely. This guide covers what triggers it, how the numbers work, how it shows up on your tax return, and what you can legitimately do about it.
Every dollar figure below is in U.S. dollars. Rules and thresholds shift with tax legislation, and your own situation may involve exceptions that only a tax professional can judge. Nothing here is individualized tax advice.
Table of Contents
- What Is a Wash Sale Rule?
- How Does the 30-Day Wash Sale Window Work?
- What Counts as a Substantially Identical Investment?
- What Is a Wash Sale Rule for ETFs and Mutual Funds?
- How Is a Wash Sale Loss Calculated?
- Does a Wash Sale Always Produce a Permanent Loss?
- How Do You Report a Wash Sale on Form 8949?
- Can You Avoid a Wash Sale?
- Does the Wash Sale Rule Apply to Spouses and Retirement Accounts?
- Frequently Asked Questions
- Do wash sale losses carry forward to another tax year?
- Can I use specific identification to avoid a wash sale?
- Does a wash sale apply if I sell at a small profit?
- How long must I hold a replacement investment after a wash sale?
- What happens if my broker does not report a wash sale correctly?
- Conclusion
What Is a Wash Sale Rule?
A wash sale is a loss sale that gets paired with a repurchase of the same or a substantially identical security inside the 61-day window. The Internal Revenue Service created it under Section 1091 of the Internal Revenue Code. In plain terms: if you take a tax loss but stay economically exposed to the same thing, you are not allowed to keep the benefit of that loss in the year you sold.
That is the whole trade the rule blocks. Without it, an investor could realize a loss on the last trading day of December, offset all their capital gains for the year, then buy the position back on January 2 with no real change in what they own. The tax code treats that as manufactured paper loss, not a genuine investment decision.
The mechanics everyone needs to know fit in four points:
- 61-day window. Thirty days before the sale, the day of the sale, and thirty days after it. A purchase anywhere in that span counts.
- Disallowed loss. The loss on the sale is not deductible in the year it happens.
- Cost basis adjustment. The disallowed amount is added to what you paid for the replacement shares, so your basis goes up.
- Holding period carryover. The days you already held the original shares are added to the replacement shares’ holding period.
The last two points mean a wash sale usually defers the loss rather than destroying it. In a taxable account, you eventually get the benefit when you sell the replacement position. Elsewhere, and that is where people get hurt, the benefit may simply disappear.
Which assets are involved matters too. Stocks, ETFs, mutual funds, bonds, and certain option contracts all sit inside the rule. Something I see people get wrong constantly: the rule is about securities, not about your house, your car, or a collectible held in a brokerage account. It does not reach mutual fund capital gain distributions either.
How Does the 30-Day Wash Sale Window Work?

It is 30 days, not 60, and the window is 61 days wide. Here is why the numbers look confusing: you count thirty days before the sale, the sale day itself, and thirty days after. That is 61 calendar days of exposure the IRS can examine. The day of the sale sits in the middle and counts toward the total.
Take a sale on September 15. The window opens on August 16 and closes on October 15. A purchase on August 15 is outside it. A purchase on August 16 is inside it. So is one on October 15, while October 16 falls outside again. Most of the counting errors I see come from treating the boundaries as inclusive on both ends when only the outer edges are meant to be inclusive.
| Date | Position relative to the sale | Inside the wash sale window? |
|---|---|---|
| August 15 | 31 days before | No, outside the window |
| August 16 | 30 days before | Yes, window opens |
| September 14 | 1 day before | Yes |
| September 15 | Day of the sale | Yes |
| September 16 | 1 day after | Yes |
| October 15 | 30 days after | Yes, window closes |
| October 16 | 31 days after | No, outside the window |
Two details trip people up. First, the window counts calendar days, not trading days, so weekends and holidays count. Second, it also runs backwards. Buying shares thirty days before your sale counts just as much as buying them after, which is why a long-term investor who already holds a position cannot simply harvest a loss inside the window.
What Counts as a Substantially Identical Investment?
Shares of the same company, or another fund holding the same security, are the clearest case. Beyond that the code says “substantially identical” and leaves the judgment to facts and circumstances, which is exactly where retail investors get stuck. Here is how the categories usually fall.
| Situation | Verdict | Why |
|---|---|---|
| Shares of the same company, same class | Yes, triggers | Identical security, same CUSIP |
| Shares of a different company | No, does not trigger | Different issuer, even in the same sector |
| Common versus preferred of the same company | Generally no | Different security with different rights and pricing |
| A call or put option on the same company | Gray area | Can count as substantially identical depending on strike, expiry and delta |
| Buying a short position in the same company | Gray area | Short sales can trigger the rule and can be matched differently |
| Convertible bonds or notes into the same company | Yes, usually triggers | Treated as substantially identical when conversion is at or near market |
| Futures and forward contracts | No | Outside the scope of the rule in most cases |
| Gold, silver or commodity units in an IRA | Contested | The IRS and courts have split on precious metals held in tax-deferred accounts |
The general test is economic: does the replacement investment track the same security closely enough that you never really exited? Two funds tracking different indexes are not substantially identical just because both are “index funds.” Two different companies in the same industry are not identical either.
What Is a Wash Sale Rule for ETFs and Mutual Funds?
Fund switches are where most “should I worry” questions land. If you sell one fund and buy a different fund that tracks the same index, the answer depends on what the two funds actually own, not on their names. Two S&P 500 index funds from different providers hold nearly the same hundred shares or so of large-cap companies, and the IRS has treated purchases of one after selling the other as a wash sale.
Mutual funds and ETFs tracking the same index sit in the same bucket. A mutual fund share class switching to an ETF of the identical index is generally treated as substantially identical. A total market index fund and a sector fund overlap but are not the same exposure, so that switch usually stands on its own. Track the holdings rather than trusting the ticker or fund label, and if the overlap is close, treat the two as identical until a tax professional tells you otherwise.
How Is a Wash Sale Loss Calculated?
The arithmetic is simple, and it only bites when you buy fewer replacement shares than you sold. Work through a real shape of the numbers: you bought 100 shares for 25,000, the position dropped, and you sold all 100 shares for 20,000. That is a realized loss of 5,000. Twelve days later you buy 50 shares back for 10,500.
| Step | Figure |
|---|---|
| Original cost basis for 100 shares | 25,000 |
| Proceeds from selling 100 shares | 20,000 |
| Realized loss | 5,000 |
| Replacement purchase, 50 shares | 10,500 |
| Repurchase price per share | 210 |
| Loss per share on the original position | 50 |
| Disallowed loss on 50 replacement shares | 2,500 |
| Deductible loss on the 50 shares you did not replace | 2,500 |
| New cost basis for the 50 replacement shares | 13,000 |
You get half the deduction, not all of it. The 2,500 you actually deduct this year matches the shares you genuinely sold and did not replace. The other 2,500 is deferred: it is added to the 10,500 you paid for the replacement shares, giving them a 13,000 basis. If those shares are later sold for 14,000, your taxable gain is 1,000 rather than 3,500.
Here is the part that confuses people even after they understand the calculation. Deferred means deferred, not forgiven, and only as long as the replacement shares sit in a taxable account. The holding period also carries over. If you had held the original shares for two years, those days tack onto the replacement shares, which means a short-term gain later can still be reported as long-term.
Does a Wash Sale Always Produce a Permanent Loss?
No, and that distinction is worth internalizing. In a taxable brokerage account, a wash sale loss is deferred. The basis and holding period adjustments hand the loss back to you when you eventually sell the replacement position, however many years later. That is why tax loss harvesting still works when you follow the rules.
The rule that permanently disallows losses is separate and much harsher. Capital losses above the annual limit, which is 3,000 for individuals married filing jointly or surviving spouses, carry forward year to year and generally never offset ordinary income. Those are not wash sale losses and they behave differently on your return.
The genuinely permanent case is the retirement account. If the replacement shares were bought inside a traditional or Roth IRA, the loss is disallowed and there is no basis adjustment to carry it forward, because no current-year deduction ever attached to it. Revenue Ruling 2008-5 confirmed this treatment. Investors often discover it only years later at distribution, when the deferred tax lands without the offsetting loss they were counting on.
How Do You Report a Wash Sale on Form 8949?

Most brokerage firms pre-fill Form 1099-B with wash sales they detect inside the accounts they manage, and their software transfers those amounts to Form 8949 for you. That covers the easy case, the repurchase inside the same account. Anything across accounts or with a spouse, you handle yourself.
For the transactions you report by hand, the sequence is:
- List every sale in the window. Start from your trade confirmations, not from memory, and include purchases from other brokers and from a spouse’s accounts.
- Match each loss sale to its replacement shares. Match the earliest purchase after the sale first, then work backward for purchases inside the preceding 30 days.
- Enter code W in column (f). That adjustment code tells the IRS the change to the gain or loss figure is a wash sale adjustment.
- Enter the disallowed amount as a positive number in column (g). Not negative. A negative figure there gets the sign backwards.
- Report the deductible remainder normally. The shares you did not replace produce a real gain or loss and go on Form 8949 like any other trade.
- Roll the totals to Schedule D. Short-term and long-term wash sale adjustments land on separate lines before you compute net capital gain or loss.
- Fix the replacement basis in your records. Add the deferred loss to what you paid for the replacement shares and note that the old holding period carries over. This is the step people skip, and it is the reason a sale years later surprises them.
Matching order has one genuine wrinkle worth knowing. For multiple replacement purchases, the IRS matches the earliest shares acquired after the sale first. If you sold at a loss and bought replacement shares twice inside the window, the first purchase absorbs part of the disallowed loss, and any remainder follows to the later purchase.
| What happens | Your broker reports it | You report it |
|---|---|---|
| Repurchase in the same brokerage account | Yes, on Form 1099-B | No, it flows through automatically |
| Repurchase at a second brokerage firm | No | Yes, manually on Form 8949 |
| Repurchase in your IRA or 401(k) | Usually not | Yes, and the loss is permanently disallowed |
| Repurchase in a spouse’s account | No | Yes, manually |
| Automatic dividend reinvestment | Often, if it is in the same account | Sometimes, if the reinvestment happened elsewhere |
| Automatic payroll or monthly contributions | Depends on the firm | Check your own contribution schedule |
If a broker missed a wash sale and you find it later, the practical fix is usually a corrected Form 8949 before you file. If you have already filed, an amended return is the route, and the correction has to be reasonable. Undisallowed losses carry no separate penalty, so the exposure is generally back taxes plus interest rather than a punishment.
Can You Avoid a Wash Sale?
Five approaches work, and all of them are just planning. None of them involves claiming a deduction the rules disallow.
- Wait until day 31. Buy back the same security 31 days after the sale and the window is closed. Watch the boundary carefully, since day 31 is the first safe day.
- Buy something genuinely different. A different company, or a different index with low overlap, breaks the substantially identical test. Buyers often over-cautiously wait 31 days when a clearly different fund would have been fine.
- Turn off dividend reinvestment and pending contributions first. Automatic reinvestment and a standing monthly contribution are purchases you did not consciously make, and both can silently create a wash sale. This is the fix that catches the most people by surprise.
- Double up, then sell after 31 days. Buy additional shares on the sale date, which lets you capture the current loss on the original shares, then sell the extra shares 31 days later. The original loss is harvested while the added shares carry their own basis.
- Time rollovers and distributions. A 401(k) or 403(b) rollover that lands inside the window can function as the replacement purchase. When it is scheduled, delay the rollover or the purchase, or move the sale date.
One thing to keep separate: specific identification, where a broker lets you attach a sale to particular shares and choose which lot is sold first, changes which lot you sell. It does not move you outside the 61-day window, and it does not rescue a wash sale that has already occurred.
Does the Wash Sale Rule Apply to Spouses and Retirement Accounts?
To spouses, yes. If you sell at a loss and your spouse buys the same or a substantially identical security inside the window, that purchase counts. Your combined household return treats the loss as disallowed, which means two tax returns have to be reconciled. If you are married filing separately, the pairing is more complicated still, and that is a conversation for a tax professional.
Retirement accounts reach the rule but handle it badly. In a traditional IRA, a loss is irrelevant because no current deduction applied to it. In a Roth IRA, the same applies with current-year taxes, and in both cases a wash sale replacement makes the loss permanently disallowed. There is no basis adjustment waiting for you at distribution. Employer plans behave the same way.
That is why the sequence matters. If you plan to harvest a loss on a position, make sure the replacement money goes to a taxable account, and if a rollover is pending, push the harvest out of the window or let the rollover clear first. The mechanics are mechanical rather than judgment calls, so most of these situations are avoidable with a calendar.
One last practical note. Because the window straddles tax years, a sale in late December followed by a repurchase in early January is a wash sale that spans two reporting periods, and the 1099-B reflecting it may arrive after you have filed one of those years. Nothing changes about the treatment, but the paperwork gets confusing.
Frequently Asked Questions
Do wash sale losses carry forward to another tax year?
In a taxable account, yes. A disallowed wash sale loss is deferred rather than lost: it is added to the cost basis of the replacement shares and it collects the original holding period. You realize it only when you eventually sell those replacement shares. Inside an IRA or employer plan there is nothing to carry forward, because the loss is permanently disallowed with no basis adjustment, which is why retirement accounts make harvesting much riskier.
Can I use specific identification to avoid a wash sale?
No. Specific identification lets you choose which lot of shares is sold when you hold the same security more than once, and it changes the basis and holding period reported on that sale. It does not shorten the 61-day window and it does not override the substantially identical test. If you sold at a loss and bought a replacement security inside the window, specific identification of the original lot cannot undo the wash sale.
Does a wash sale apply if I sell at a small profit?
No. The rule only applies when the sale produces a loss. A small profit, a break-even sale or a gain leaves you outside the wash sale rule entirely, even if you buy the same or a substantially identical security the next day. Because of this, selling at break-even rather than at a small loss is one of the simplest ways to step around the rule when your actual motive is tax-driven rather than investment-driven.
How long must I hold a replacement investment after a wash sale?
There is no minimum holding period on the replacement investment itself. The rule does not require you to hold the new shares for 31 days or for any set period. What matters is that you do not buy the substantially identical security within 30 days after the sale. The holding period rules work the other way around: days from the original position are added to the replacement shares, which can push a later gain into long-term treatment.
What happens if my broker does not report a wash sale correctly?
You are still responsible for the correct tax treatment, so you have to reconcile it yourself. Brokers only detect wash sales inside the accounts they manage, so purchases at a second firm, in an IRA, or in a spouse’s account never appear on your Form 1099-B. Adjust the figures yourself on Form 8949 using code W and a positive adjustment in column (g), and if you have already filed, file an amended return for the year in question.
Conclusion
Start with a calendar, not a tax form. Pull every purchase and every sale in your accounts, in your spouse’s accounts and in any retirement account that falls inside the 61 days around each loss sale. That single list catches the dividend reinvestments, the standing monthly contributions and the pending rollover that create most accidental wash sales.
Then, for each loss sale, ask one question: was the replacement investment substantially identical to what I sold? If it was, you have a deferred loss in a taxable account and a permanently disallowed one in an IRA, and you should fix the replacement basis and holding period in your records before you forget. If it was not, you can deduct the loss normally.
Primary sources worth reading in full: Section 1091 of the Internal Revenue Code, IRS Publication 550 on investment income and expenses, Revenue Ruling 2008-5 on IRAs, and the instructions for Form 8949 and Form 1099-B. For your own position, talk to a tax professional before filing, particularly if the amounts are large or a spouse’s accounts are involved.


