Taxes & Investing

Wash Sale Rule

Sell an investment at a loss and buy it back within 30 days on either side, and the tax code takes the deduction away — usually just for now, sometimes for good.

Also called: wash sale · section 1091 · disallowed loss · the 30-day rule

Reviewed 12 August 2026 · Sourced from the Internal Revenue Code, the Treasury regulations and the IRS

The short version

If you sell stock or securities at a loss and buy substantially identical ones within 30 days before or 30 days after that sale, § 1091 disallows the loss on this year's return and adds the disallowed amount to the cost basis of the shares you bought back. You get the deduction later, when you finally sell the replacement.

The exception is the expensive one: if the replacement is bought inside your own IRA or Roth IRA, there is no taxable basis to add the loss to, and the deduction is gone permanently.

Key takeaways
  • The window is 61 days, not 30. Section 1091(a) covers the period beginning 30 days before the sale and ending 30 days after it, and Treasury's own regulation at 26 CFR 1.1091-1(a) calls it “the 61-day period” in those words.
  • The loss is usually deferred, not destroyed. Under § 1091(d) the disallowed amount is added to the basis of the replacement shares, so it comes back as a smaller gain the next time you sell.
  • The replacement lot inherits the old holding period. Section 1223(3) tacks the time you held the original shares onto the new ones, so a long-term position stays long-term through a wash sale.
  • An IRA or Roth repurchase kills the loss for good. Revenue Ruling 2008-5 holds that the loss is disallowed and the retirement account's basis is not increased under § 1091(d) — there is nowhere for the deduction to go.
  • Your 1099-B only sees one account. The Instructions for Form 1099-B require the broker to flag a wash sale when the sale and the purchase happen in the same account with the same CUSIP number. Two brokers, or a retirement account, and it is your job.
  • Crypto is outside the rule as of August 2026. Section 1091 says “stock or securities.” H.R. 9172, introduced 8 June 2026, would extend it to digital assets, but it sits in committee and has not been enacted.

What the wash sale rule actually is

It is 6 November 2026. Two hundred shares you bought at $50 are sitting at $38. You sell, book a $2,400 loss to set against this year’s gains, and two weeks later, with the price still low, you buy the same 200 shares back at $39. In April your tax software drops the letter W next to that trade and the $2,400 deduction is gone.

That is the wash sale rule, at 26 U.S.C. § 1091. Without it you could sell every loser on 31 December, buy them all back on 2 January, and collect a deduction while your holdings never changed by a share.

The one-sentence version

Sell stock or securities at a loss, buy substantially identical stock or securities within 30 days before or 30 days after that sale, and § 1091 disallows the loss on this year’s return — adding the disallowed amount to what you paid for the replacement instead.

Most people meet this rule through tax-loss harvesting: selling something that has fallen to create a realized loss that offsets realized gains, or up to $3,000 of ordinary income a year under 26 U.S.C. § 1211(b). That is a description of what investors do, not a suggestion that you do it.

Two things are worth getting straight first, because short explanations routinely get both wrong. The window is 61 days, not 30. And the loss is almost always postponed rather than destroyed — with one exception, ruled on in 2008, that is the most expensive mistake on this topic.

The window is 61 days, and it runs both directions

Section 1091(a) disallows the loss when, in the words of the statute, you acquire substantially identical stock or securities “within a period beginning 30 days before the date of such sale or disposition and ending 30 days after such date.” Treasury’s own regulation, 26 CFR 1.1091-1(a), recites that language and then names it outright: it calls the stretch “the 61-day period.”

Thirty days back, the day of the sale, thirty days forward. That is where the extra day comes from, and why calling this “the 30-day rule” describes half of it. A purchase made three weeks before the sale disallows the loss just as completely as one made the week after.

DateWhat happensInside the window?
6 Oct 2026You buy 200 sharesNo — one day too early
7 Oct 2026Window opens
20 Oct 2026You buy 200 sharesYes
6 Nov 2026You sell 200 shares at a lossThe sale itself
20 Nov 2026You buy 200 sharesYes
6 Dec 2026Window closes
7 Dec 2026You buy 200 sharesNo — one day clear

These are calendar days counted from trade dates: 25 in October, 30 in November, 6 in December — 61, our arithmetic on the regulation’s own label.

What counts as buying back is broader than pressing the buy button. The Instructions for Schedule D list four triggers: buying substantially identical securities, acquiring them in a fully taxable trade, entering into a contract or option to acquire them, and acquiring them for your IRA or Roth IRA. The statute defines “stock or securities” to include contracts and options, § 1091(f) makes clear that settling in cash is no escape, and § 1091(e) extends the same treatment to losses on closing a short sale. If a stop-loss order fires while you are not watching, the fill date sets the clock — not the day you placed it.

The loss is deferred, not destroyed

This is the part most articles bury, and it decides what a wash sale actually costs. Section 1091(d) sets the replacement’s basis from the basis of what you sold, adjusted for the price difference; the Instructions for Schedule D say it in one line: the basis is “its cost increased by the disallowed loss.” The deduction moves into your cost basis and waits until you sell the replacement.

Worked example

On 3 March 2024 you buy 200 shares at $50 — basis $10,000. On 6 November 2026 you sell all 200 at $38 for $7,600, a realized loss of $2,400. On 20 November, fourteen days later and squarely inside the window, you buy 200 shares back at $39 for $7,800. That is a wash sale on all 200 shares.

What the return showsNo repurchaseRepurchase inside the window
Proceeds, November 2026 sale$7,600$7,600
Cost basis reported$10,000$10,000
Form 8949 column (g) adjustmentnone$2,400, code W
Loss deductible in 2026$2,400$0
Basis in the replacement lot$7,800$10,200
Gain if you sell in 2029 at $52$2,600$200

Read the last two rows together. The replacement cost $7,800; add the $2,400 disallowed and its basis becomes $10,200. Sell later for $10,400 and you report a $200 gain instead of $2,600. The $2,400 arrived, three years late.

The holding period comes along too. Section 1223(3) says that in figuring how long you held the replacement, “there shall be included the period for which he held the stock or securities the loss from the sale or other disposition of which was not deductible.” Your November 2026 lot counts as held since March 2024, so it is long-term from day one — which sets the capital gains tax rate you pay.

The result

A wash sale does not usually cost you the loss. It costs you the use of it: $2,400 that would have offset gains in 2026 sits inside your basis until 2029. At a 22% marginal rate that is roughly $528 paid now and recovered later — our arithmetic, not an IRS figure.

The one version where the loss really is destroyed

Change one thing in that example. You still sell 200 shares from your taxable brokerage account on 6 November for a $2,400 loss. But the shares you buy back on 20 November are bought inside your own Roth IRA.

In Revenue Ruling 2008-5 the IRS took almost exactly those facts — 100 shares with a $1,000 basis sold for $600 on 20 December 2007, with the taxpayer’s IRA or Roth IRA buying 100 identical shares the next day at fair market value — and held: “The loss on the Sale of stock is disallowed under § 1091. A’s basis in the individual retirement account or Roth IRA is not increased by virtue of § 1091(d).”

Both halves matter, and the second is the one that hurts. You lose the deduction this year, and the machinery that normally gives it back — adding the loss to the replacement’s basis — does not run, because a retirement account has no taxable basis to increase. The deduction has nowhere to go.

Watch out

In our numbers that is a permanent $2,400 — about $528 of tax value destroyed rather than deferred at a 22% marginal rate, our arithmetic. And nothing tells you: the sale appears on a 1099-B, the retirement purchase on none.

The realistic way this happens is not a deliberate trade. It is automation. A payroll contribution lands in your Roth IRA on the 15th and buys the index fund you just sold outside it. The 2008 ruling reasoned from substance over form, citing the Security First National Bank of Los Angeles case, and a purchase you forgot about is still a purchase.

A related point that gets tangled with this: a loss on a sale entirely inside an IRA is not deductible either, but that is not the wash sale rule — nothing inside a retirement account reaches your return.

“Substantially identical” has no bright line

Everything above turns on a phrase Congress never defined. Section 1091 says “substantially identical stock or securities” and stops. The regulation does not define it either. IRS Publication 550 carries a subsection under Wash Sales with that exact heading, and what it sets out is a facts-and-circumstances standard, not a test you can run.

Some cases are not close. Sell a company’s common stock at a loss and buy it back inside the window and you have a wash sale — the fact pattern the statute was written for. Options and contracts on that stock are in scope by the statute’s own definition, and bonds of the same issuer on substantially the same terms are generally treated as substantially identical.

Others are conventionally treated as clear the other way: two different companies’ shares, or a company’s common against its preferred. That is the settled understanding among preparers, though this page will not quote a sentence it did not read directly from irs.gov — see the ledger.

Watch out

The genuinely unsettled case is the one most investors face: you sell one sponsor’s S&P 500 index fund at a loss and buy a different sponsor’s S&P 500 fund the next day. Different issuer, different CUSIP — and identical holdings tracking one identical index. No statute, no regulation and no published IRS ruling addresses it. The confident line you will read everywhere, that different fund families are automatically safe, has no citation behind it. It may be right. It is not established.

One thing follows: there is no safe-harbor list to check a trade against, and anyone selling you one built it themselves.

Does the rule apply to crypto in 2026?

As of 12 August 2026, no. The reason is textual: § 1091 disallows losses on the sale of “stock or securities,” and a digital asset held as property is neither. That is why traders have been able to sell a token at a loss and rebuy it minutes later, which a stock investor cannot do.

That is the current answer, not a permanent one. H.R. 9172, the Applying Existing Tax Anti-Abuse Rules to Digital Assets Act, was introduced on 8 June 2026 by Representative Arrington. It would strike “stock or securities” throughout § 1091 and replace it with “specified assets,” covering any stock or security plus any digital asset other than a qualified U.S. dollar stablecoin. Tokenized and wrapped assets would be treated as substantially identical to the economically equivalent security; mining and staking rewards would be carved out.

The House Ways and Means Committee held a legislative hearing on digital asset taxation on 9 June 2026, the day after introduction. The bill is in committee, has not passed either chamber, and is not law. Grant Thornton on 23 June 2026 — a secondary source, flagged as such — judged that enactment this Congress would require a significant political breakthrough in the Senate.

Watch out

One detail is worth knowing even as a proposal: as drafted, the amendments would apply to dispositions after the date of introduction, with a broker-reporting transition through 31 December 2027. Most bills never become law. But “the rule does not apply to crypto” is a statement about August 2026, not a guarantee about your 2026 return as it will eventually be filed.

Already true today: if a digital asset is a security, § 1091 reaches it under the existing text, because the statute follows what the instrument is, not what it is stored on.

What your 1099-B catches and what it misses

Your broker does flag wash sales — a narrow slice of them, and the gap between what the broker owes you and what you owe the IRS is where most unintentional errors live. The Instructions for Form 1099-B say it plainly at Box 1g: “You must report any loss disallowed under section 1091 if both the sale and purchase transactions occur in the same account with respect to covered securities with the same CUSIP number.” Same account, same CUSIP. They go on to relieve the broker of the analysis where the replacement was bought in another account or transferred in from one. Your own obligation under § 1091 has none of those limits.

The situationFlagged on your 1099-B?Still a wash sale?
Sell and rebuy the same fund in one taxable accountYesYes
Sell at broker A, rebuy the identical security at broker BNo — different accountYes
Sell in a taxable account, rebuy in your own IRA or RothNoYes, and permanently
Sell one S&P 500 fund, buy another sponsor’s S&P 500 fundNo — different CUSIPUnsettled — see above
Your spouse buys the identical security in their accountNoCommonly treated as yes
A reinvested dividend buys shares inside the windowUsually, if same accountYes, on those shares

The mechanics are small. Per the Instructions for Schedule D you report the sale on Form 8949, enter code W in column (f), and show the non-deductible loss as a positive number in column (g), which cancels it out. Then you carry the disallowed amount into the replacement lot’s basis yourself — the quiet burden, because a basis adjustment created at a different firm exists only in your records. Sections 1091(b) and (c) also allocate the disallowance when you buy back fewer or more shares than you sold.

What is confirmed, what is unverified, what is convention

ClaimStatusWhat establishes it, or doesn’t
The window is 61 days: 30 before, the sale day, 30 afterConfirmedSection 1091(a) sets the period; 26 CFR 1.1091-1(a) names it “the 61-day period.” The day count is our arithmetic.
The disallowed loss is added to the replacement’s basisConfirmedSection 1091(d), and the Instructions for Schedule D: the basis is “its cost increased by the disallowed loss.”
The replacement lot inherits the original holding periodConfirmedSection 1223(3), quoted above from the U.S. Code.
An IRA or Roth repurchase destroys the loss permanentlyConfirmedRevenue Ruling 2008-5, read directly from the IRS PDF: the loss is disallowed and the account’s basis is not increased under § 1091(d).
Brokers report wash sales only within one account and one CUSIPConfirmedInstructions for Form 1099-B, Box 1g, quoted above.
$3,000 a year of net capital loss against ordinary incomeConfirmedSection 1211(b), $1,500 filing separately. The statute carries no inflation adjustment and the figure dates to the 1986 Act.
Crypto is outside § 1091 as of August 2026ConfirmedThe statute reaches “stock or securities.” H.R. 9172 would change that and remains in committee; the Senate outlook is a secondary source’s judgment, not a fact.
Two S&P 500 index funds from different sponsors are not substantially identicalUnverifiedNo statute, regulation or published ruling addresses it, and the confident version repeated online carries no citation. Publication 550’s wording under “Substantially identical” could not be read directly here either — the IRS page truncated before chapter 4 on three fetches — so this page describes it rather than quoting it.
A purchase in your spouse’s separate account triggers the ruleConvention, reasonedSection 1091 speaks of “the taxpayer,” and the substance-over-form reasoning of Revenue Ruling 2008-5 points the same way, but no published ruling squarely on spouses was located here. Preparers treat it as a wash sale; on a joint return it is moot.

Where a figure here is not from a statute or a ruling — the $528, the 22% rate, the 61-day count — it is our own arithmetic and says so.

What trips people up

Counting forward only. You add to a position on 20 October, decide by 6 November it is not working, and sell the older shares at a loss. The October purchase sits in the “30 days before” half of the window, so the loss is disallowed even though you bought nothing afterward. Cost: the whole deduction, pushed into a lot you may not sell for years.

Selling in late December and buying in early January. The 61-day window does not reset at midnight on 31 December — a 20 December sale stays exposed until 19 January. Cost: the deduction you were harvesting for that tax year moves out of it.

Forgetting the automation. A single $47 reinvested dividend inside the window creates a wash sale on the shares it bought, and § 1091(b) and (c) allocate the disallowance to those shares. Cost: small in dollars, but it splits one clean lot into two with different bases you now have to track.

Buying the replacement in the IRA. The one that is not recoverable. Under Revenue Ruling 2008-5 the loss is disallowed and the account gets no basis increase, so $2,400 is simply gone — roughly $528 at a 22% rate on our numbers. Cost: the full loss, forever, with no form telling you it happened.

Trusting the 1099-B to be complete. The broker checks one account and one CUSIP because that is all the Instructions for Form 1099-B require. Sell at one firm and buy at another and your reported gain is understated. Cost: back tax plus interest, and penalties.

Treating an unsettled question as settled. Swapping between two funds tracking the same index rests on an interpretation no published authority confirms. For the wider picture, see Stage 4: Invest.

Frequently asked questions

What is the wash sale rule?

The wash sale rule is a federal tax provision at 26 U.S.C. § 1091 that stops you from deducting a loss when you sell stock or securities and buy substantially identical ones within 30 days before or 30 days after that sale. It exists so nobody can sell losers at year end, buy them straight back, and claim a deduction while owning what they owned before. In most cases the loss is not gone for good: the disallowed amount is added to the cost basis of the shares you bought back. The main exception is a repurchase inside your own IRA or Roth IRA, where the loss is destroyed permanently.

Is the wash sale rule 30 days or 61 days?

Both numbers are right about different things. The rule looks 30 days backward from the sale and 30 forward, and covers the sale day itself, so the total exposure is 61 calendar days — Treasury’s own regulation, 26 CFR 1.1091-1(a), uses the phrase “the 61-day period.” Anyone who tells you to just wait 31 days after selling has described half the rule: a purchase made three weeks before the sale disallows the loss too.

Do I lose the money when a wash sale is disallowed?

Usually not. Under § 1091(d) the disallowed loss is added to what you paid for the replacement shares, raising their cost basis by the amount you were denied. Sell at a $2,400 loss, rebuy for $7,800, and your basis in the new lot is $10,200, so a later sale produces a smaller gain by that same $2,400. Section 1223(3) also lets the replacement inherit the original holding period. What you lose is timing — the use of that deduction until you sell the replacement.

Does the wash sale rule apply if I buy the stock back in my IRA?

Yes, and this is the version that costs real money. In Revenue Ruling 2008-5 the IRS held that when an individual sells stock at a loss and causes their IRA or Roth IRA to buy substantially identical stock inside the window, the loss is disallowed under § 1091 and the account’s basis is not increased under § 1091(d). You lose the deduction, and the mechanism that normally returns it later does not run, because a retirement account has no taxable basis to adjust. It usually happens by accident, when an automatic contribution or a reinvested dividend inside the IRA buys the fund you just sold outside it.

Are two different S&P 500 index funds substantially identical?

Nobody official has said. Congress did not define “substantially identical,” the Treasury regulations do not define it, and no published IRS ruling addresses index funds from different sponsors tracking the same index. Publication 550 sets a facts-and-circumstances standard rather than a test. The widely repeated claim that different fund families are automatically safe has no citation behind it: it may be correct, but it is an interpretation, not a rule.

Does the wash sale rule apply to crypto in 2026?

As of August 2026, no. Section 1091 disallows losses on “stock or securities,” and a digital asset held as property is neither, so selling a token at a loss and rebuying it immediately does not trigger the rule. Legislation exists to change that: H.R. 9172, introduced on 8 June 2026, would replace “stock or securities” with “specified assets” covering digital assets other than a qualified U.S. dollar stablecoin. It sits in committee and has not been enacted, and as drafted it would apply to dispositions after its introduction date — so this is a statement about the law today, not a guarantee about how the year ends.

Will my broker tell me if I had a wash sale?

Only within limits. The Instructions for Form 1099-B require a broker to report a disallowed loss at Box 1g when the sale and the purchase happen in the same account and involve covered securities with the same CUSIP number, and they relieve the broker of the analysis when the replacement was bought elsewhere. So a sale at one firm and a repurchase at another, a repurchase inside a retirement account, or a swap into a similar-but-not-identical fund will not show up. Your own obligation has none of those limits, and a wash sale is reported on Form 8949 with code W.

Related terms

Where to go next

Sources
  1. U.S. Code, 26 U.S.C. § 1091, Loss from wash sales of stock or securities — the disallowance itself, the 30-days-before-and-after period, the basis rule at (d), short sales and securities futures at (e), and cash settlement at (f).
  2. U.S. Code, 26 U.S.C. § 1223(3) — the holding-period tacking rule quoted in the deferral section.
  3. U.S. Code, 26 U.S.C. § 1211(b) — the $3,000 annual limit on net capital losses against ordinary income, $1,500 for a married individual filing separately, with no inflation adjustment.
  4. Electronic Code of Federal Regulations, 26 CFR 1.1091-1, Losses from wash sales of stock or securities — Treasury’s own regulation, and the source of the phrase “the 61-day period.”
  5. Internal Revenue Service, Revenue Ruling 2008-5 (PDF) — the holding that an IRA or Roth IRA repurchase disallows the loss and does not increase basis under § 1091(d).
  6. Internal Revenue Service, Instructions for Schedule D (Form 1040) — the four acquisition triggers including the IRA bullet, the sentence that basis is “its cost increased by the disallowed loss,” and the Form 8949 code W mechanics.
  7. Internal Revenue Service, Instructions for Form 1099-B — Box 1g, and the same-account, same-CUSIP limit on what a broker must report.
  8. Internal Revenue Service, Publication 550, Investment Income and Expenses — cited for the existence and shape of the “Substantially identical” discussion under Wash Sales; its exact wording is not quoted here because the page truncated before chapter 4 on every attempt.
  9. U.S. Government Publishing Office, H.R. 9172, Applying Existing Tax Anti-Abuse Rules to Digital Assets Act (PDF) — the digital-asset proposal, the “specified assets” definition, the validation carve-out and the proposed effective date.
  10. U.S. House Committee on Ways and Means, Full Committee Legislative Hearing on Digital Asset Taxation, 9 June 2026 — that the bill received a committee hearing rather than passage.
  11. Grant Thornton (secondary source, labeled), Ways and Means weighs crypto tax reform, 23 June 2026 — a professional assessment that Senate passage is not imminent; opinion, not authority.

The figures on this page are checked against the source that publishes them, and dated. Published rates move after the release named above — the linked source always carries the current number. This page explains a term; it does not recommend a product.