This article reflects federal rules (IRC §1091) and general state conformity as of June 2026 and covers tax years 2025 and 2026. Tax law changes — confirm current figures before you file.
Quick Answer
Yes. A wash sale can happen even if you buy before you sell. The rule under Internal Revenue Code §1091 covers a 61-day window — 30 days before the loss sale plus the day of the sale plus 30 days after. Buying first, then selling at a loss, still triggers it.
Most people picture a wash sale as “sell at a loss, then rush back in.” But the rule is symmetrical: if you purchase the same or a “substantially identical” stock or security within the 30 days leading up to a loss sale, the IRS treats those shares as your replacement shares and disallows the loss on your sale. The immediate consequence is that the loss you expected to use against your taxes this year vanishes from your current return — it gets pushed into the cost basis of the shares you already bought.
This trips up more investors than you might think. Roughly 62% of U.S. families held stock directly or through funds as of the Federal Reserve’s 2022 Survey of Consumer Finances, and year-end “tax-loss harvesting” has become routine — which means a lot of accidental rebuy-first wash sales. Here is what this guide solves for you:
- 🔁 Why buying before selling still creates a wash sale, in plain English.
- 🧮 Worked dollar examples showing exactly how your disallowed loss moves into your new cost basis.
- 🪤 The hidden traps — IRAs, your spouse’s account, options, and dividend reinvestment — that bite even when you bought first.
- 📄 How to report it on Form 8949 with code “W,” line by line.
- 🗺️ Whether your state follows the federal rule, plus the mistakes that cost real money.
This article is educational and is not a substitute for advice from a licensed CPA or tax attorney about your specific situation.
What a Wash Sale Actually Is
A wash sale happens when you sell a stock or security at a loss and, within a 61-day window around that sale, you also acquire the same security or one that is “substantially identical.” When that overlap exists, the wash sale rule in IRC §1091 blocks you from deducting the loss right now. The point of the rule is to stop investors from selling purely to harvest a tax loss while never really giving up their position.
The window is the part most people get wrong. It is not just the 30 days after you sell. The statute begins counting 30 days before the date of the sale and ends 30 days after it. Add the day of the sale itself, and you get a 61-calendar-day danger zone. Because the window reaches backward in time, a purchase you made before the loss sale sits squarely inside it.
The consequence of a wash sale is a deferral, not a permanent loss in most cases. Your disallowed loss is not erased — it gets added to the cost basis of the replacement shares, so you recover the tax benefit later when you sell those shares. The one big exception, covered below, is the IRA trap, where the loss is gone for good.
A common misconception is that the rule only applies in December. It applies year-round, on every loss sale, in every taxable account. What you should do about it: before you sell anything at a loss, look backward 30 days and forward 30 days for any purchase of the same security — including automatic ones you forgot about.
Why “Rebuy Before Selling” Counts
The reason a buy-first trade triggers the rule is the literal text of the statute. Section 1091 disallows a loss if, “within a period beginning 30 days before the date of such sale or disposition and ending 30 days after such date,” you acquired substantially identical stock or securities. The phrase “beginning 30 days before” is the key — Congress wrote the window to run in both directions.
Picture buying extra shares of a stock you already own, then selling your original, older shares at a loss a week later. The shares you bought first become the “replacement” shares for the loss sale. The consequence is that your loss on the old shares is disallowed and rolls into the basis of the newly bought shares. This pattern is often called “doubling up,” and it is the classic way a rebuy-before-selling wash sale happens.
A misconception here is that the order of trades protects you — that only a re-purchase after the sale counts. It does not. The IRS looks at the calendar window, not the sequence. What to do: if you doubled up planning to sell the old lot at a loss, either wait until more than 30 days have passed since the purchase, or accept that the loss will defer into your new shares.
The 61-Day Window, Visualized in Time
The window is best understood as a timeline centered on your loss-sale date. Everything inside it counts; everything outside it is safe. The federal standard comes straight from IRS Publication 550, which restates §1091 for individual investors.
Here is the structure of the danger zone for tax year 2025 and 2026 (the rule is identical for both years):
- Day −30 to Day −1: the 30 calendar days before your loss sale. A purchase here triggers a wash sale.
- Day 0: the date of your loss sale.
- Day +1 to Day +30: the 30 calendar days after your loss sale. A purchase here triggers a wash sale too.
That totals 61 calendar days, not 60, because both endpoints and the sale day are included. The days are calendar days, not trading days, so weekends and holidays count. Missing this by even one day is enough: a repurchase on day 30 is caught, but a repurchase on day 31 is clean.
The consequence of miscounting is a disallowed loss you did not plan for, which can raise your taxable income for the year. What to do: mark your calendar 31 days out from any loss sale, and only buy back on day 31 or later if your goal is to keep the loss deductible this year.
Substantially Identical: The Concept That Decides Everything
The whole rule turns on whether the security you bought is “substantially identical” to the one you sold at a loss. If it is not, there is no wash sale, no matter how close in time the trades are. The IRS has never published a bright-line list, so this is a facts-and-circumstances test, as Morningstar explains.
Some things are clearly substantially identical: the exact same stock (the same ticker), or shares you sold and immediately rebought. Some things are clearly not: stock in two different companies in the same industry — say, Coca-Cola and PepsiCo — are not substantially identical, so swapping one for the other avoids the rule.
The gray zone is index funds and ETFs. Two S&P 500 index funds from different providers track the same index, and many advisors treat them as risky to swap, while others argue different funds are legally distinct. Bonds of the same issuer with different maturities or coupons are generally not identical. The consequence of guessing wrong is a disallowed loss plus, in an audit, possible penalties on the underpaid tax.
A misconception is that switching fund families always makes you safe. It often does, but it is not guaranteed for funds tracking the same index. What to do: when tax-loss harvesting, swap into a fund that tracks a different index (for example, total-market for S&P 500) to stay clearly outside the rule, and document your reasoning.
Which Situation Applies to You?
The right answer depends on how and where you rebought. Use this to find your scenario, then read the matching section below.
- You bought extra shares of the same stock, then sold your old shares at a loss. This is the “doubling up” case — read Example 1. The loss defers into your new shares.
- A dividend got automatically reinvested before you sold at a loss. Even a tiny reinvested purchase triggers a partial wash sale — read the Hidden Traps section.
- You sold at a loss in your brokerage account, and your IRA or Roth IRA bought the same security. This is the worst case — the loss is permanently lost. Read The IRA Trap.
- Your spouse bought the same security, or you bought it in another of your own accounts. The rule reaches across your accounts and your spouse’s — read Hidden Traps.
- You bought a call option or entered a contract before selling the stock at a loss. Options and contracts count as “acquiring” — read Hidden Traps.
Worked Example 1: Maria Doubles Up, Then Sells
Maria owns 100 shares of TechCo that she bought years ago for $50 a share, a $5,000 basis. The stock has fallen to $30. On March 1, 2025, she buys 100 more shares at $30 (a $3,000 purchase) because she still believes in the company. On March 10, 2025, she sells her original 100 shares for $30 each, hoping to claim a $2,000 capital loss.
Because Maria bought identical shares on March 1 — within 30 days before her March 10 loss sale — the wash sale rule applies even though she bought first. Her $2,000 loss is disallowed for tax year 2025. Here is the math:
- Original shares: $5,000 basis − $3,000 sale proceeds = $2,000 loss, disallowed.
- That $2,000 is added to the basis of her March 1 replacement shares.
- New basis in the 100 replacement shares: $3,000 + $2,000 = $5,000.
- Her holding period on the old shares also carries over to the new ones.
The consequence is that Maria cannot use the $2,000 this year, but she has not lost it. When she eventually sells the replacement shares, her higher $5,000 basis means a smaller gain or a usable loss, as TurboTax describes. The deduction is delayed, not destroyed.
Worked Example 2: David’s Partial Wash Sale
David sells 100 shares of FundX at a $1,000 loss on November 20, 2025. But on November 5, 2025, his account had automatically reinvested a dividend that bought 10 new shares of the same fund — a purchase inside the 30-day-before window.
Only the portion of the loss tied to the replacement shares is disallowed. With 10 replacement shares matched against 100 sold shares, 10% of his loss is caught:
- Total loss: $1,000.
- Disallowed portion (10 of 100 shares): $100, added to the basis of the 10 reinvested shares.
- Deductible portion this year: $900.
The consequence is small here, but reinvested dividends are the most common accidental trigger because investors forget they are even buying. What to do: turn off automatic dividend reinvestment in any security you plan to sell at a loss, at least 30 days before the sale.
Worked Example 3: Sofia and the IRA Trap
Sofia sells 200 shares of BigBank in her taxable brokerage account on February 3, 2026, for a $4,000 loss. On January 20, 2026, her Roth IRA had bought 200 shares of BigBank. The IRA purchase came before the taxable-account sale, and it falls inside the 30-day-before window.
Under Revenue Ruling 2008-5, this is a wash sale — and a brutal one. The loss is disallowed, and there is no basis adjustment to the IRA shares, because IRA basis rules do not work that way. The $4,000 loss is gone permanently, as CPA firm COG explains.
| Sofia’s Move | Tax Outcome |
|---|---|
| Sells BigBank at a $4,000 loss in taxable account | Loss disallowed under §1091 |
| Roth IRA bought BigBank 14 days earlier | Triggers wash sale (related account) |
| Basis adjustment to replacement shares? | None — IRA shares get no adjustment |
| Net result | $4,000 loss permanently lost |
The consequence is the worst in the entire wash sale world: a total, permanent forfeiture of the deduction. What to do: never buy a security in your IRA or Roth IRA when you are selling that same security at a loss in a taxable account within 61 days.
The IRA Trap (Why Order Does Not Save You)
The IRA version of the rule deserves its own warning because it converts a temporary deferral into a permanent loss. Revenue Ruling 2008-5 holds that if you sell a security at a loss in a taxable account and your IRA or Roth IRA buys a substantially identical security within the 61-day window, the loss is disallowed. Buying in the IRA first still counts.
What makes it permanent is that §1091’s basis-adjustment relief does not apply to the IRA’s shares. In a normal wash sale, the disallowed loss boosts the replacement shares’ basis so you recover it later. With an IRA, the shares sit in a tax-sheltered account with no taxable basis to adjust, so the loss vanishes forever.
A misconception is that a Roth IRA, being “tax-free,” is somehow exempt. It is not — the ruling names Roth IRAs explicitly. What to do: keep your tax-loss harvesting securities out of your retirement accounts entirely for at least 61 days around any loss sale, and coordinate trades across all your accounts.
Hidden Traps That Bite Even When You Buy First
Several less-obvious actions count as “acquiring” substantially identical securities and can trigger a wash sale from the buy-first side. Each carries the same disallowed-loss consequence.
- Your spouse’s purchases. A purchase in your spouse’s account is treated as yours for the wash sale rule, so a spouse buying the same stock before your loss sale triggers it.
- Your other accounts. Buying in a second brokerage account, a joint account, or a business account you control all count.
- Options and contracts. Entering a contract or buying a call option to acquire the stock counts as “acquiring” it, per the statute — even before you sell the underlying shares at a loss.
- Dividend reinvestment (DRIP). Automatic reinvested-dividend purchases create the partial wash sales shown in Example 2.
- Different share classes or convertible securities that are economically equivalent can be “substantially identical.”
The consequence in each case is a disallowed loss you may not see coming, because brokers only reliably track wash sales within a single account at one firm. Cross-account and spousal wash sales are your responsibility to catch. What to do: keep a simple log of every purchase of a security across all family accounts in the month before you plan a loss sale.
Crypto and the Wash Sale Rule (As of 2026)
As of June 2026, the wash sale rule under §1091 applies only to “stock or securities.” Cryptocurrency such as Bitcoin and Ethereum is treated as property, not a security, so the wash sale rule does not currently apply to crypto. That means a crypto investor can sell at a loss and rebuy immediately — before or after — and still claim the loss for now.
This is an unsettled area. Lawmakers have repeatedly proposed extending the wash sale rule to digital assets, and Congress could close this gap in a future budget bill. Treat the crypto exemption as temporary and subject to change.
A misconception is that crypto ETFs share this exemption. They do not — a spot Bitcoin ETF is a security, so selling one ETF at a loss and rebuying it (or a substantially identical one) does trigger the rule. What to do: if you rely on the crypto loophole, confirm current law before you file, and remember it does not extend to crypto-holding securities.
Does Your State Follow the Wash Sale Rule?
Start with the federal baseline: §1091 governs your federal return. Most states with an income tax begin their calculation from your federal adjusted gross income or federal taxable income, so the disallowed loss flows through automatically — meaning the wash sale carries over to your state return without a separate state rule.
States with no broad income tax — such as Florida, Texas, Washington, Nevada, South Dakota, Wyoming, Alaska, Tennessee, and New Hampshire (which taxes only certain interest/dividends through 2024) — simply do not tax this kind of capital gain or loss, so the question is moot for residents there. The answer “my state does not tax this” is complete on its own.
A handful of states historically computed capital gains differently, so divergence is possible. The consequence of assuming conformity wrongly is a misfiled state return. What to do: confirm your specific state’s treatment with your state department of revenue, especially if you live in a state that does not start from federal taxable income.
How to Report a Wash Sale on Form 8949
You report investment sales on Form 8949 (Sales and Other Dispositions of Capital Assets), and the totals flow to Schedule D of your Form 1040. A wash sale is flagged with a specific code and an adjustment so the loss is added back. Your broker reports a known wash sale in Box 1g of Form 1099-B.
Here is the line-by-line process, as confirmed by tax-software guidance on Code W:
- Columns (a)–(e): enter the security description, dates acquired and sold, proceeds, and cost basis as usual.
- Column (f): enter the code “W” to mark the transaction as a wash sale.
- Column (g): enter the disallowed loss amount as a positive number (this cancels the loss).
- Column (h): the resulting gain or loss after the adjustment — for a fully disallowed loss, this becomes $0.
The deadline is your regular return due date — generally April 15, 2026, for tax year 2025, or October 15, 2026, with an extension. The consequence of skipping the adjustment is an overstated loss, which can trigger an IRS notice (a CP2000) and back taxes. What to do: match every Box 1g amount on your 1099-B to a code “W” entry on Form 8949 before filing. When you have cross-account or spousal wash sales your broker did not catch, add those manually.
Tax-Loss Harvesting Without Tripping the Rule
The legitimate strategy here is tax-loss harvesting — deliberately selling losers to offset gains and up to $3,000 of ordinary income per year (for tax year 2025). The wash sale rule does not ban this; it only bans replacing the security inside the 61-day window. Used right, it can lower your tax bill without changing your real market exposure much.
The cleanest method is to sell at a loss and buy a similar but not substantially identical security to stay invested. For example, sell one large-cap fund and buy a different large-cap fund tracking a different index. The consequence of doing this carelessly is a disallowed loss; done carefully, you keep the deduction and your exposure.
A misconception is that you must sit in cash for 31 days to harvest a loss. You do not — the substitute-security approach keeps you invested the whole time. What to do: pre-pick your “swap” securities before harvesting season so you are not scrambling, and re-confirm they track a different index.
Mistakes to Avoid
- Counting only the 30 days after the sale. Missing the 30-days-before window means an unexpected disallowed loss and a higher tax bill.
- Forgetting dividend reinvestment. A small auto-purchase creates a partial wash sale that reduces your deductible loss.
- Buying the same security in your IRA. This permanently destroys the loss under Revenue Ruling 2008-5 — the costliest error of all.
- Ignoring your spouse’s trades. A spousal purchase counts as yours, so the loss is disallowed and you may not even realize why.
- Assuming two S&P 500 funds are different enough. Funds tracking the same index may be substantially identical, putting your loss at risk.
- Buying a call option before selling the stock at a loss. Contracts and options count as “acquiring,” so the loss is disallowed.
- Skipping the Form 8949 code “W” adjustment. Claiming the full loss the broker disallowed invites an IRS CP2000 notice and back taxes.
- Trusting the broker to catch everything. Brokers track only within one account at one firm, so cross-account wash sales go unreported and become your liability.
Do’s and Don’ts
Do:
- Do look 30 days backward and forward before every loss sale, because the window runs both ways.
- Do turn off dividend reinvestment 30+ days before harvesting, so an auto-buy does not trigger a partial wash sale.
- Do swap into a different-index fund to stay invested while keeping the loss deductible.
- Do keep a written log of family-wide purchases, since brokers miss cross-account trades.
- Do match every 1099-B Box 1g amount to a Form 8949 entry, to avoid an IRS notice.
Don’t:
- Don’t buy the loss security in any IRA or Roth IRA within 61 days, because the loss is then permanently gone.
- Don’t assume buying before selling is safe, since the rule is symmetrical in time.
- Don’t treat your spouse’s account as separate for this rule, because it is treated as yours.
- Don’t rely on the crypto exemption without checking current law, since Congress may close it.
- Don’t guess on “substantially identical” — document your reasoning in case of audit.
Pros and Cons of the Wash Sale Rule
Pros (for the taxpayer):
- The loss is usually deferred, not lost, because it shifts into your replacement shares’ basis — you recover it later.
- Your holding period carries over, which can help you reach long-term capital gains treatment sooner.
- It still allows real tax-loss harvesting, as long as you swap into a non-identical security.
- It applies a clear, mechanical 61-day test, so with a calendar you can plan around it precisely.
- Brokers report most single-account wash sales for you, reducing your paperwork in the common case.
Cons:
- The 30-days-before reach surprises people, so buy-first trades cause unexpected disallowed losses.
- The IRA version is permanent, turning a deferral into a total forfeiture.
- “Substantially identical” is undefined, creating gray-area risk for fund and ETF swaps.
- Cross-account and spousal wash sales are your burden, because no broker tracks them.
- It complicates active trading, where frequent same-ticker buys and sells generate stacked wash sales.
What to Do Next
If you think a rebuy-before-selling wash sale may apply to you, take these steps in order:
- Pull your trade history for the security across all accounts — yours, your spouse’s, and any IRA — for the 30 days before and after the loss sale.
- Confirm whether the purchases were substantially identical to what you sold; if not, there is no wash sale.
- Calculate the disallowed portion (full or partial, based on shares matched) and add it to the replacement shares’ basis — except for IRA purchases, where no adjustment applies.
- Report it on Form 8949 with code “W” in column (f) and the disallowed amount in column (g), then carry totals to Schedule D by the April 15, 2026 deadline for tax year 2025.
- Call a CPA or tax attorney if you have stacked wash sales as an active trader, an IRA-triggered loss, or cross-account complexity. A pro typically charges a few hundred dollars to untangle this and can save far more in correctly timed losses.
Frequently Asked Questions
Can a wash sale happen if I buy before I sell? Yes. The 61-day window includes the 30 days before your loss sale, so a purchase made before you sell still triggers a wash sale and disallows the loss for the year.
How many days is the wash sale window? 61 calendar days. It runs from 30 days before the loss sale, through the sale date, to 30 days after — calendar days, not trading days, so weekends count.
Is the loss gone forever in a wash sale? No, usually not. The disallowed loss is added to the basis of your replacement shares, so you recover it when you sell those shares — except for IRA purchases, where it is permanent.
Does the wash sale rule apply to my IRA? Yes. Under Revenue Ruling 2008-5, buying the security in your IRA or Roth IRA within 61 days disallows the loss, and there is no basis adjustment, so the loss is lost permanently.
Does the wash sale rule apply to cryptocurrency? No, not as of 2026. Crypto is treated as property, not a security, so the rule does not apply — but Congress has proposed changing this, so confirm current law before filing.
Do my spouse’s trades count? Yes. A purchase in your spouse’s account is treated as yours for the wash sale rule, so it can trigger a disallowed loss even if you never touched that account.
What is “substantially identical”? Securities that are essentially the same investment — the same stock, or funds tracking the same index. Different companies in one industry are not, so swapping them avoids the rule.
How do I report a wash sale on my taxes? On Form 8949 with code “W.” Enter the disallowed loss as a positive number in column (g); the totals carry to Schedule D, due April 15, 2026, for tax year 2025.
Can buying a call option trigger a wash sale? Yes. The statute counts entering a contract or option to acquire the stock as “acquiring” it, so an option bought within the 61-day window can disallow your loss.
Does dividend reinvestment cause a wash sale? Yes, partially. An auto-reinvested dividend that buys shares within the window creates a wash sale on the matched portion of your loss, even though you did not choose to buy.
Can I avoid a wash sale and stay invested? Yes. Sell at a loss and buy a similar-but-not-identical security — for example, a fund tracking a different index — to keep market exposure while preserving the deduction.
Do all states follow the federal wash sale rule? Most do. States that start from federal taxable income inherit the disallowed loss automatically, while no-income-tax states like Florida and Texas do not tax it at all.
Related reading
- Can a Wash Sale Raise Your Tax Bill? (w/Examples) + FAQs
- Does a Wash Sale Make You Lose the Loss Forever? (w/Examples) + FAQs
- Does the Wash Sale Loss Come Back When You Sell Again? (w/Examples) + FAQs
- Does the Wash Sale Rule Apply to Bonds? (w/Examples) + FAQs
- Does the Wash Sale Rule Apply to Gains? (w/Examples) + FAQs
- What’s the Penalty for a Wash Sale? (w/Examples) + FAQs