Does the Wash Sale Rule Apply to Gains? (w/Examples) + FAQs

This article reflects federal rules and general state-conformity rules as of June 2026 and covers tax year 2025 (the return most people file in early 2026), with 2026 figures noted where they differ. Tax law changes — confirm current figures before you file.

Quick Answer

No. For tax year 2025, the wash sale rule does not apply to gains. It only disallows losses when you buy a substantially identical security within 30 days. If you sell at a profit and rebuy right away, the gain is fully taxable — no exception, no deferral.

So the worry that keeps showing up in brokerage forums — “I sold a winner and rebought it the next day, did I just void my profit?” — has a clean answer: you cannot dodge a gain, and the wash sale rule was never built to let you. The catch is the reverse. A wash sale on a loss quietly reshapes a future gain by changing your cost basis and your holding period, and that is where most people get blindsided on their Form 8949.

The stakes are real and the timing is tight. The rule reaches 30 days before and 30 days after a sale — a 61-day window — so a single automatic dividend reinvestment or a routine RSU vesting can trip it without you lifting a finger, per IRS Publication 550. The IRS reported processing more than 160 million individual returns in 2024, and capital-asset sales sit among the most commonly misreported items, according to the IRS Data Book.

Here is what you will walk away knowing:

  • 🎯 Why a gain is always taxable even if you rebuy the same stock one minute later
  • 🔄 How a disallowed loss secretly raises or lowers your future gain through cost-basis math
  • 🧮 A fully worked dollar example you can copy line-by-line onto Form 8949
  • 🪙 Why crypto and futures contracts play by different rules than stocks
  • ⚠️ The seven mistakes — RSUs, IRAs, spouses, DRIPs — that trigger a wash sale you never meant to make

What the Wash Sale Rule Actually Is

The wash sale rule lives in Section 1091 of the tax code and is explained in plain terms in IRS Publication 550. In plain English, it stops you from claiming a tax loss when you sell a security at a loss and buy back the same or a “substantially identical” security within 30 days before or after that sale. Congress wrote it to block a simple trick: selling a stock just to harvest a paper loss, then buying it right back so your real position never changes.

The consequence of tripping the rule is specific. The loss you reported is disallowed for the current year, so it cannot offset your gains or reduce your ordinary income that year. You do not lose the money forever in most cases — the disallowed loss is added to the cost basis of the replacement shares, as Fidelity explains in its wash-sale guide. That single sentence is the hinge of this entire topic, because a cost-basis change is really a future-gain change.

A real-world example shows the shape of it. Maria sells 100 shares of a tech stock on December 15, 2025, locking in a $2,000 loss to cut her tax bill. On December 20, 2025, she buys 100 shares of the same stock back because she still believes in it. The IRS disallows her $2,000 loss for 2025, and instead bolts that $2,000 onto the cost basis of her new shares.

The most common misconception is that a wash sale erases your loss. It usually does not — it defers it by parking it in your new basis, so you collect the benefit when you finally sell the replacement shares for good. The one painful exception is a repurchase inside an IRA, covered below, where the loss truly vanishes.

What you should do about it: if you want the loss to count for 2025, do not buy back a substantially identical security until the 31st day after the sale. Mark that 31-day date on a calendar the moment you harvest a loss, because the window is unforgiving.

So Why Doesn’t It Apply to Gains?

The rule is one-directional by design, and the reason is logical. The wash sale rule exists to stop abuse of the loss deduction — there is no abuse to stop on the gain side, because the government is happy to tax your profit whenever you realize it. As Accounting Insights notes, when you sell at a gain and rebuy inside the window, the gain is simply recognized and taxed.

The consequence is that you can never “wash” a gain away. Selling a winner and instantly rebuying it locks in a taxable event for the year of sale, full stop. There is no basis adjustment, no deferral, and no holding-period merge on the gain side — those mechanics only fire on disallowed losses.

Picture James. He sells 50 shares for a $3,000 profit on March 10, 2026, then rebuys the same 50 shares on March 12, 2026, because he changed his mind. James owes capital gains tax on the full $3,000 for tax year 2026, even though he is right back where he started. His new shares simply take a fresh cost basis equal to what he paid on March 12.

A frequent misconception is that the 30-day window somehow “protects” a quick round-trip on a gain. It does not. The only thing a fast rebuy after a gain does is restart your holding period, which can push you from the lower long-term rate into the higher short-term rate if you sell again soon. What you should do: if you have a gain you do not want to realize yet, simply do not sell — there is no wash-sale shelter for profits, so the only control you have is the sale date itself.

The Real Twist: How a Wash Sale Changes a Future Gain

This is the part that earns the “(w/Examples)” promise, because the wash sale rule touches gains indirectly even though it never touches them directly. When a loss is disallowed, two things attach to your replacement shares, both confirmed in IRS Publication 550.

The cost-basis adjustment

The disallowed loss is added to the cost basis of your new shares. A higher basis means a smaller taxable gain — or a larger deductible loss — when you finally sell those replacement shares. So the loss you could not use today reappears as a tax benefit later, baked into the basis. The consequence of ignoring this is double-counting: many filers forget the adjustment, report the raw broker number, and either overpay tax or trigger an IRS notice for a basis mismatch.

The holding-period merge

The holding period of the shares you sold carries over and tacks onto the replacement shares. This matters because assets held more than one year qualify for long-term capital gains rates — 0%, 15%, or 20% for tax year 2025 — while shorter holds are taxed at ordinary income rates up to 37%. The merge can be a gift: it may let your replacement shares qualify for the lower long-term rate sooner than their purchase date alone would allow. What you should do: keep a running spreadsheet of every adjusted basis and merged holding date, because brokers track this per-account but not across accounts.

A Fully Worked Numeric Example

Walk through Priya, an investor in the 24% federal bracket for tax year 2025. The math below is the exact sequence you would copy onto your own Form 8949 and Schedule D.

Priya buys 200 shares of GreenTech at $50 per share on January 5, 2025, for a $10,000 cost. On November 3, 2025, the stock has fallen to $35, so she sells all 200 shares for $7,000, creating a $3,000 loss she hopes to deduct. On November 20, 2025 — only 17 days later, inside the 30-day window — she rebuys 200 shares at $36 per share for $7,200, because she expects a rebound.

Here is what the wash sale rule does to her numbers:

  • Her $3,000 loss is disallowed for tax year 2025 and cannot offset her other gains.
  • The $3,000 disallowed loss is added to her $7,200 repurchase cost, giving her new shares an adjusted basis of $10,200.
  • Her original holding period (from January 5, 2025) merges onto the new shares.

Now fast-forward. On August 1, 2026, GreenTech recovers and Priya sells all 200 shares for $12,000. Because her adjusted basis is $10,200 — not the $7,200 she actually paid — her taxable gain is only $1,800, not the $4,800 a naive calculation would show. The merged holding period (starting January 5, 2025) means she has held more than a year, so the $1,800 is taxed at the 15% long-term rate = $270, instead of the 24% short-term rate that would have cost $432. The wash sale she stumbled into actually saved her $162 in the end — proof the loss was deferred, not destroyed.

Which Situation Applies to You?

The right answer depends on what you sold and where you rebought it. Use this branch to jump to your facts.

  • You sold at a gain and rebought: The rule does not apply at all. Your gain is taxable in the year of sale; your new shares get a fresh basis and a fresh holding period.
  • You sold at a loss in the same taxable brokerage account: Classic wash sale. Loss disallowed, basis and holding period roll to the replacement shares.
  • You sold at a loss and rebought inside an IRA or Roth IRA: The worst case. Under Revenue Ruling 2008-5, the loss is disallowed and the IRA basis is not increased — the loss is gone for good.
  • Your spouse rebought the security: The IRS treats spouses as one taxpayer for this rule, so it still triggers, per Publication 550.
  • You traded crypto or futures: Different rules entirely — see the crypto and Section 1256 section below.

Three Common Scenarios

Each table below shows a real pattern and exactly what the tax outcome is.

Scenario 1: Sold a winner, rebought immediately

What You Did What Happens on Your Taxes
Sold 100 shares at a $5,000 gain on May 1, 2025 Full $5,000 gain is taxable for 2025 — the wash sale rule does not apply to gains
Rebought the same 100 shares on May 2, 2025 New shares get a fresh cost basis and a brand-new holding period starting May 2, 2025

Scenario 2: Sold a loser, rebought in 10 days (taxable account)

What You Did What Happens on Your Taxes
Sold at a $2,000 loss on June 5, 2025 Loss is disallowed for 2025 and cannot offset other gains
Rebought substantially identical shares on June 15, 2025 $2,000 disallowed loss is added to the new basis; old holding period merges in

Scenario 3: Sold a loser, rebought inside your IRA

What You Did What Happens on Your Taxes
Sold at a $1,500 loss in your taxable account on July 1, 2025 Loss is disallowed for 2025 under the wash sale rule
Rebought the same security in your IRA within 30 days Under Revenue Ruling 2008-5, the IRA basis is not raised — the $1,500 loss is permanently lost

Three Named Examples in Action

Carlos and the RSU surprise. Carlos sells 300 shares of his employer’s stock at a $4,000 loss on February 10, 2026, to harvest the loss. He forgets that his quarterly RSUs vest on February 25, 2026, dropping new shares of the same stock into his account inside the 30-day window. The vesting counts as acquiring substantially identical securities, so his $4,000 loss is disallowed and rolled into the basis of the vested shares. RSU vesting is one of the most common silent triggers, as tax practitioners warn.

Lena and the DRIP. Lena sells an index fund at a $1,200 loss on October 1, 2025, planning to claim it. She forgets her account has automatic dividend reinvestment switched on, and a small dividend buys fractional shares of the same fund on October 20, 2025. Even that tiny automatic purchase is a wash sale, disallowing the portion of her loss tied to the reinvested shares, as Fidelity notes.

Tom the winner. Tom panics after selling 100 shares for an $8,000 profit on April 3, 2026, then rebuying them on April 4, 2026. He fears he owes nothing because of a “wash.” Wrong direction — the rule never touches gains, so Tom owes capital gains tax on the full $8,000 for tax year 2026, and his rebought shares start a new holding period.

Crypto and Section 1256 Contracts Play Differently

Not every asset sits under the wash sale rule, and this is a major source of confusion. As of tax year 2025, the wash sale rule in Section 1091 applies to “stocks or securities,” which the IRS does not currently treat as including cryptocurrency, because the IRS classifies crypto as property, not a security. That means a crypto holder can, under current law, sell Bitcoin at a loss and rebuy it minutes later and still claim the loss — though Congress has repeatedly proposed closing this gap, so it may not last.

The consequence of relying on this is risk: it is an unsettled area, and the IRS has not finalized guidance treating digital assets like securities. A misconception is that crypto is “exempt forever” — it is not exempt by design, just not yet covered, and a future law could apply the rule. Futures and broad-based index options instead fall under Section 1256 contracts, which are marked to market each year and use a 60/40 long-term-short-term split, sidestepping wash sale mechanics. What you should do: if you trade crypto for tax-loss harvesting, document everything and watch for new legislation before assuming the loss sticks.

Federal vs. State: Does Your State Follow This Rule?

Start with the federal baseline, then check your state. The wash sale rule is a federal rule under Section 1091, and most states with an income tax begin from federal taxable income, so they automatically inherit the disallowed loss and the basis adjustment. States that conform to the federal definition of adjusted gross income — the large majority — treat your wash sale exactly as the IRS does.

The nuance is that a handful of states do not impose a broad personal income tax at all, so the rule has no state effect there. States including Florida, Texas, and Washington have no general income tax on wages and most investment income, meaning there is no separate state wash-sale calculation to make. The consequence of assuming uniformity is small here, but real: a few states use their own basis-tracking rules or decouple from specific federal provisions, so confirm with your state revenue agency rather than guessing. What you should do: if your state has an income tax, assume it follows the federal wash sale result unless your state’s instructions say otherwise.

How to Report It on Your Tax Forms

Wash sales flow through two forms, and the mechanics matter line by line. You report each sale on Form 8949, and the totals carry to Schedule D of Form 1040. If you want a full line-by-line walkthrough, see a dedicated How to Fill Out Form 8949 guide and the companion Schedule D guide in this cluster.

On Form 8949, you enter the security description, the acquisition date, the sale date, the proceeds, and the cost basis. For a wash sale, you enter code “W” in column (f) and put the disallowed loss amount as a positive number in column (g), which adjusts your reported gain or loss. Your broker usually flags wash sales on your Form 1099-B, but brokers only track them within a single account — they cannot see your IRA, your spouse’s account, or your other brokerages, so the duty to catch cross-account wash sales falls on you.

The deadline is the standard filing date — April 15, 2026 for tax year 2025 returns, or October 15, 2026 with an extension. Missing the adjustment or ignoring a 1099-B wash-sale flag invites an IRS CP2000 notice proposing extra tax months later. What you should do: reconcile every 1099-B against your own records before you file, and keep documentation of each basis adjustment for at least three years.

Mistakes to Avoid

Each error below carries a concrete cost.

  • Thinking the rule shelters gains. It never does — you will still owe full capital gains tax on any profit, and you may waste energy planning a round-trip that does nothing.
  • Ignoring RSU vesting dates. Vesting inside the 30-day window disallows your harvested loss, often by surprise, and rolls it into the vested shares.
  • Leaving DRIP on after harvesting a loss. An automatic reinvested dividend buys substantially identical shares and disallows part of your loss.
  • Rebuying in your IRA. Under Revenue Ruling 2008-5, the loss is permanently destroyed because the IRA basis is not increased — the costliest mistake on this list.
  • Forgetting your spouse’s account. The IRS treats spouses as one taxpayer, so a spouse’s purchase triggers the same disallowance.
  • Assuming different brokers are safe. Cross-account wash sales are your responsibility; brokers do not net them, so you can underreport without realizing it.
  • Treating two S&P 500 funds as different. Near-identical index funds can be “substantially identical,” disallowing the loss you thought you cleanly harvested.
  • Counting only 30 days, not 61. The window runs 30 days before and after the sale, a full 61-day span, so a purchase shortly before a loss sale also counts.

Do’s and Don’ts

Do’s

  • Do wait until the 31st day to rebuy, because that is the first safe day outside the 30-day window.
  • Do track adjusted basis yourself, because the carried-over loss reduces your future taxable gain and you do not want to overpay.
  • Do turn off DRIP before harvesting a loss, since automatic reinvestment is a hidden trigger.
  • Do consider a similar-but-not-identical fund to stay invested in a sector while sidestepping the rule.
  • Do reconcile your 1099-B, because catching cross-account wash sales prevents an IRS notice.

Don’ts

  • Don’t rebuy in an IRA, because the disallowed loss vanishes permanently under Revenue Ruling 2008-5.
  • Don’t assume crypto is safe forever, because the law is unsettled and Congress may extend the rule.
  • Don’t let a spouse rebuy the same security, since the IRS counts you as one filer.
  • Don’t ignore the 30-day before leg, because a purchase just before your loss sale also triggers the rule.
  • Don’t try to wash a gain, because it accomplishes nothing except restarting your holding period at a possibly higher tax rate.

Pros and Cons of the Wash Sale Rule’s Effect on Gains

Pros

  • Losses are usually deferred, not lost, because the disallowed loss raises your replacement basis and shrinks a future gain.
  • The holding period merges, which can qualify your new shares for the lower long-term rate sooner.
  • It enforces real economic change, so genuine tax-loss harvesting still works if you wait 31 days.
  • Brokers flag in-account wash sales, giving most filers an automatic head start on accuracy.
  • Gains stay simple, because no wash-sale math ever complicates a profitable sale.

Cons

  • IRA repurchases destroy the loss, which is a harsh, permanent penalty for a common mistake.
  • Cross-account tracking is on you, which creates real reporting risk for multi-broker investors.
  • “Substantially identical” is undefined, so fund swaps carry uncertainty the IRS resolves after the fact.
  • Silent triggers exist, like RSUs and DRIPs, that catch careful investors off guard.
  • Higher future basis can backfire if the replacement shares keep falling, locking gains and losses into a tangle of adjustments.

What to Do Next

Take these steps in order if a wash sale touches your return.

  1. Pull every Form 1099-B and look for the wash-sale “W” flag in the disallowed-loss column.
  2. List all your accounts — taxable, IRA, and your spouse’s — and check for substantially identical purchases inside any 61-day window.
  3. Recalculate the adjusted basis and merged holding period for every replacement lot, and save the worksheet.
  4. Enter each adjustment on Form 8949 with code “W,” then carry totals to Schedule D.
  5. File by April 15, 2026 for tax year 2025, and keep your records for at least three years.
  6. Call a CPA or tax attorney if you have multiple accounts, RSUs, an IRA repurchase, or high-frequency trades — that work typically runs a few hundred dollars and prevents far costlier errors.

This article is educational and is not a substitute for advice from a licensed tax professional about your specific situation. A wash sale spanning an IRA, an estate, or hundreds of trades is exactly the kind of complexity worth paying a CPA or tax attorney to untangle.

FAQs

Does the wash sale rule apply to gains?

No. For tax year 2025, the wash sale rule only disallows losses. If you sell at a gain and rebuy the same security right away, the full gain is taxable in the year of sale — there is no deferral or exception for profits.

Can I avoid capital gains tax by selling and immediately rebuying?

No. Rebuying a winner does nothing to shelter the gain. You owe capital gains tax for the year you sold, and your new shares simply start a fresh cost basis and holding period from the repurchase date.

What is the wash sale window?

61 days total. The rule covers the 30 days before and the 30 days after your loss sale. A substantially identical purchase anywhere in that span triggers the disallowance, per IRS Publication 550.

Is my wash sale loss gone forever?

Usually no. In a taxable account the disallowed loss is added to your replacement shares’ cost basis, so you recover it when you sell those shares. The exception is an IRA repurchase, where the loss is permanently lost.

Does the wash sale rule apply to cryptocurrency?

No, not currently. As of tax year 2025, the IRS treats crypto as property, not a security, so the wash sale rule does not apply. Congress has proposed changing this, so the rule may extend to crypto soon.

How do I report a wash sale on my taxes?

Form 8949. Enter code “W” in column (f) and the disallowed loss in column (g), then carry the totals to Schedule D of Form 1040. The deadline for tax year 2025 is April 15, 2026.

Can my spouse trigger my wash sale?

Yes. The IRS treats married couples as a single taxpayer for this rule, so a purchase by your spouse within the 61-day window disallows your loss just as your own purchase would.

Do RSUs cause wash sales?

Yes. If your employer’s shares vest within 30 days of you selling the same stock at a loss, the vesting counts as buying substantially identical securities, disallowing your loss and adjusting the vested shares’ basis.

Are two different S&P 500 funds substantially identical?

Often yes. Two funds tracking nearly the same index with near-identical holdings can be substantially identical, which triggers the rule. The IRS decides case by case, so swap to a clearly different fund to stay safe.

Does the wash sale rule apply to options and futures?

Partly. Options on stock can trigger the rule if they act as a proxy for the stock. Futures and broad-based index options fall under Section 1256 contracts, which use mark-to-market rules instead.

What happens if I ignore a 1099-B wash sale flag?

An IRS notice. Ignoring the flag can produce a CP2000 notice proposing extra tax, interest, and penalties months later. Always reconcile your 1099-B before filing and report the adjustment correctly.

Can I rebuy in my Roth IRA to avoid the rule?

No. Under Revenue Ruling 2008-5, repurchasing in a Roth or traditional IRA still triggers the wash sale, and worse, the IRA basis is not increased — so the disallowed loss is permanently forfeited.

Word count: approximately 3,500 words. This article reflects federal rules and general state-conformity rules as of June 2026 and covers tax year 2025. Confirm current figures before you file.