Wash Sale Rule 2026: How It Works and How to Avoid It

Wash Sale Rule 2026: How It Works and How to Avoid It

The IRC 1091 wash sale rule disallows a tax loss when you buy the same or a substantially identical security within 30 days before or after selling that security at a loss. “30 days before or after” describes one 61-day span (30 days before the sale, the sale date, and 30 days after), and both directions count. The loss is not erased: in a taxable account it moves into the basis of the replacement shares, unless the replacement lands in an IRA (Source: IRC Section 1091; IRS Publication 550 (2025); Rev. Rul. 2008-5).

Last reviewed: August 2026 | Written and reviewed by Craig Wear, CFP®, founder of Q3 Advisors

Under IRC Section 1091, “30 days before or after” a loss sale means one 61-day window: the 30 days before the sale, the sale date, and the 30 days after. Buying a substantially identical security anywhere in that span disallows the loss. In a taxable account the loss is added to the basis of the replacement shares; if the repurchase is in an IRA, the loss is permanently lost (Source: IRC Section 1091; IRS Pub 550 (2025); Rev. Rul. 2008-5).

What is the wash sale rule (IRC Section 1091)?

The wash sale rule is a provision in Internal Revenue Code Section 1091 that blocks a tax loss when you sell a security at a loss and buy back substantially identical stock or securities within 30 days before or after the sale. It stops investors from claiming a deduction while keeping the same economic position (Source: IRC Section 1091; IRS Pub 550 (2025)).

Talk With Craig Wear's Team

Craig has helped IRA millionaires save over $1 million each in unnecessary taxes. Find out if a Roth conversion strategy fits your retirement, with no sales pressure and no product pitch.

The rule sets the boundary for tax-loss harvesting, which lets you realize losses to offset capital gains or up to $3,000 of ordinary income per year ($1,500 if married filing separately) while staying invested (Source: IRC Section 1211(b)). Harvesting is legal; Section 1091 only disallows the deduction when you repurchase too quickly (Source: IRS Pub 550 (2025), Chapter 4).

What does “30 days before or after” actually mean? (the 61-day window)

“30 days before or after” is a single continuous 61-day window, not two separate 30-day windows. It covers the 30 calendar days before the sale, the day of the sale, and the 30 calendar days after. A purchase of a substantially identical security anywhere inside that span triggers the rule. The statute measures the period from 30 days before the sale to 30 days after it (Source: IRC Section 1091(a); IRS Pub 550 (2025)).

Why both directions count: buying before you sell can trigger it too

Both directions count. Because the statute measures 30 days before the sale as well as 30 days after, a purchase made shortly before you sell an older lot at a loss can create a wash sale just as a post-sale repurchase can (Source: IRC Section 1091(a)). Many investors watch only the days after a sale and miss a recent buy or an automatic reinvestment in the 30 days before it.

A dated example: if you sell on August 7, the window runs July 8 through September 6

Concrete dates make the 61-day window easy to see. If you sell a security at a loss on August 7, 2026, the disallowance window runs from July 8, 2026 (30 days before) through September 6, 2026 (30 days after). Any purchase of a substantially identical security between those two dates disallows the loss (Source: IRC Section 1091(a)).

Date Position relative to the sale Inside the window?
July 7, 2026 31 days before No (one day too early)
July 8, 2026 30 days before Yes (window opens)
August 7, 2026 Sale date Yes
September 6, 2026 30 days after Yes (window closes)
September 7, 2026 31 days after No (safe to repurchase)

The count is inclusive on both ends, which is why 30 plus 1 plus 30 totals 61 days, not 60.

The window can cross into the next tax year (the year-end harvesting trap)

The 61-day window follows the calendar, not the tax year, so it can straddle December 31 and reach into the following year. A December loss sale sets up a repurchase window running weeks into January, and a January buyback can still disallow a loss you meant to claim on the prior year’s return (Source: IRC Section 1091(a); IRS Pub 550 (2025)).

For example, you sell at a loss on December 15, 2026. The window runs November 15, 2026 through January 14, 2027, so a repurchase on January 5, 2027 disallows the December 15 loss even though the buy happened in a new tax year. This year-end trap also snags automatic January dividend reinvestments. Loss timing near year end often interacts with the 3.8% net investment income tax and the December 31 deadline for a Roth conversion.

What does “substantially identical” mean?

“Substantially identical” is the phrase the whole rule turns on, and the IRS never defines it with a bright line. Publication 550 says you “must consider all the facts and circumstances in your particular case,” then gives one anchor: “Ordinarily, stocks or securities of one corporation are not considered substantially identical to stocks or securities of another corporation” (Source: IRS Pub 550 (2025)).

The table below summarizes how IRS-published examples generally treat common pairings. It is a general guide, not a determination for any specific holding.

Comparison Generally substantially identical? Basis (IRS Pub 550 (2025))
Same stock, same class, same issuer Yes The core wash sale case
Stock of Corporation A vs. stock of Corporation B Ordinarily no “Stocks of one corporation are not considered substantially identical to stocks of another corporation”
Common stock vs. bonds or preferred of the same corporation Ordinarily no Not ordinarily substantially identical
Convertible preferred vs. common of same corporation Can be yes May be identical depending on relative values, price changes, and convertibility
Predecessor vs. successor stock in a reorganization Can be yes “May be substantially identical”
Common stock vs. warrants for that same stock Case by case Rules apply if the two are considered substantially identical

Pub 550 does not resolve whether two S&P 500 index funds from different providers are substantially identical, so that comparison sits in the facts-and-circumstances gray zone. Because securities of different corporations are ordinarily not identical, a comparable fund from another provider is a common substitution during the 61-day window (Source: IRS Pub 550 (2025)).

What securities and transactions are covered? (options, warrants, short sales, DRIPs, RSUs)

The wash sale rule reaches stock and “securities” broadly, including contracts and options. Publication 550 states the rules “apply to losses from sales or trades of contracts and options to acquire or sell stock or securities.” Several less obvious transactions are covered too (Source: IRS Pub 550 (2025)).

  • Options and warrants. A loss on stock paired with a purchase of options or, in some cases, warrants for the same stock can trigger the rule (Source: IRS Pub 550 (2025)).
  • Short sales. The rules apply to a loss on a short sale if you sell, or enter another short sale of, substantially identical securities within 30 days before or after the short sale is complete (Source: IRS Pub 550 (2025)).
  • Compensatory shares (RSUs). Pub 550 Example 2 shows a bonus award of substantially identical stock received within 30 days of a loss sale triggering the rule, which is relevant to restricted stock unit vesting (Source: IRS Pub 550 (2025)).
  • Dividend reinvestment (DRIPs). An automatic DRIP purchase inside the 61-day window is still a purchase and can create a partial wash sale (Source: IRS Pub 550 (2025)).

Two categories fall outside the rule: Pub 550 states it does not apply to “commodity futures contracts and foreign currencies,” and dealers are exempt for losses in the ordinary course of business (Source: IRS Pub 550 (2025)).

What happens when you trigger a wash sale? (loss deferred into basis, not lost)

Triggering a wash sale carries no fine or penalty. The loss is disallowed for the current year, then generally preserved by moving it into the cost basis of the replacement shares, which defers the deduction until you sell those shares. Publication 550 says to “add the disallowed loss to the cost of the new stock or securities,” so the deferred deduction is captured later (Source: IRC Section 1091(d); IRS Pub 550 (2025)).

Worked example: the loss is deferred, not lost (taxable account)

This walkthrough follows IRS Pub 550 Example 1, then adds the eventual sale of the replacement shares to show that a disallowed loss is not erased, only recognized later. The holding period of the security sold at a loss also carries over to the replacement shares, which can affect whether a later gain is short-term or long-term (Source: IRS Pub 550 (2025), Example 1; IRC Section 1091(d)).

  1. You buy 100 shares of X stock for $1,000.
  2. You sell those shares for $750, a $250 loss.
  3. Within 30 days you buy 100 replacement shares for $800. Because they are substantially identical, the $250 loss is disallowed now.
  4. You add the $250 disallowed loss to the $800 cost, giving a new basis of $1,050 in the replacement shares.
  5. Later, in a non-wash transaction, you sell the replacement shares for $900. Your loss is $1,050 minus $900, or $150, and the earlier $250 is reflected in your basis, so the full economic loss is ultimately recognized.

Partial wash sales when share counts differ

If you replace fewer shares than you sold, only the matched portion is a wash sale. In Pub 550’s example, an investor with a $1,000 loss on 100 shares who buys 75 substantially identical shares inside the window cannot deduct $750 (the 75-share portion) but can deduct $250 on the remaining 25 shares, with the disallowed loss allocated across the replacement lots (Source: IRS Pub 550 (2025)).

The IRA rule: when the loss is permanently lost (Rev. Rul. 2008-5)

A wash sale involving a retirement account is harsher because the basis-deferral mechanism does not apply. If you sell a security at a loss in a taxable account and buy substantially identical shares in your traditional IRA or Roth IRA within the 61-day window, the loss is disallowed and the IRA basis is not increased, so the loss is permanently gone (Source: Rev. Rul. 2008-5; IRC Section 1091).

Revenue Ruling 2008-5 holds that “A’s basis in the individual retirement account or Roth IRA is not increased by virtue of Section 1091(d).” Investors who hold the same funds in taxable and retirement accounts often wall off harvesting from their IRAs, a question that overlaps with how much to convert to Roth and the timing of required minimum distributions.

Does the wash sale rule apply to my spouse’s account or other accounts I control?

Yes. The wash sale rule looks past a single account and even past a single person. Publication 550 states: “If you sell stock and your spouse or a corporation you control buys substantially identical stock, you also have a wash sale.” This can apply even when spouses file separately (Source: IRS Pub 550 (2025)).

A broker’s tracking is generally limited to the account it administers, so a wash sale spanning a spouse’s brokerage, an IRA, or a second custodian may not appear on any single statement. Reconciling wash sales across all accounts is the taxpayer’s responsibility (Source: IRS Pub 550 (2025)).

Does the wash sale rule apply to cryptocurrency?

The honest 2026 answer is that it is unsettled, not a clean “exempt.” IRC Section 1091 applies to “stock or securities,” and neither the statute nor IRS Pub 550 (2025) lists cryptocurrency as a covered asset. Many practitioners have treated digital assets as outside the rule, but this is a contested, fast-moving area rather than a settled IRS position stated in these primary sources (Source: IRC Section 1091; IRS Pub 550 (2025)).

Several competitor guides flatly call crypto “exempt,” which overstates the certainty. Proposals to extend wash sale treatment to digital assets have surfaced repeatedly in Congress, so the treatment can change and should be checked against the law in effect when a transaction occurs (Source: IRC Section 1091; IRS Pub 550 (2025)).

How do I report a wash sale on my taxes? (Form 8949 code W to Schedule D)

You report a wash sale on IRS Form 8949 and carry the totals to Schedule D. The disallowed loss is entered as a positive adjustment using code “W” so your deductible loss reflects the disallowance rather than the raw sale figures (Source: IRS Pub 550 (2025); IRS Form 8949 Instructions (2025)).

  1. List the sale on Form 8949 with proceeds and cost basis as reported by your broker.
  2. Enter adjustment code “W,” the standard wash sale adjustment code, in column (f).
  3. Report the disallowed loss as a positive adjustment in column (g).
  4. Carry the column totals to Schedule D.
  5. Track the increased basis and carried-over holding period on the replacement shares so the deferred loss is captured when you sell them (Source: IRS Pub 550 (2025)).

How do I avoid a wash sale?

You avoid a wash sale in two ways: do not buy a substantially identical security inside the 61-day window, or replace the position with a security that is not substantially identical. Both approaches stay within IRC Section 1091 and let you keep market exposure while still claiming the loss (Source: IRC Section 1091; IRS Pub 550 (2025)).

  • Wait out the window. A repurchase of the same security made 31 or more days after the sale falls outside the 61-day span defined by the statute (Source: IRC Section 1091(a)).
  • Use a non-identical replacement. Because securities of different corporations are ordinarily not substantially identical, a different issuer or a comparable fund from another provider is not ordinarily treated as identical to the sold security (Source: IRS Pub 550 (2025)).
  • Watch the hidden triggers. Automatic DRIP purchases, a spouse’s account, and IRA buys all count and are among the most commonly missed (Source: IRS Pub 550 (2025); Rev. Rul. 2008-5).

Because a realized loss shifts taxable income for the year, timing often connects to a Roth conversion break-even analysis and broader Roth conversion planning.

Work with Q3 Advisors

Q3 Advisors is a registered investment adviser focused on retirement tax planning. This page is educational and is not advice; consult a qualified professional.

Contact us

Frequently asked questions

What is the 30 day rule for wash sales?

The 30-day rule is IRC Section 1091: selling a security at a loss and buying a substantially identical one within 30 days before or after the sale disallows the loss. “30 days before or after” is one 61-day window (30 days before, the sale date, 30 days after), and both directions count (Source: IRC Section 1091(a)).

Can I sell a stock and buy it back within 30 days?

You can, but IRC Section 1091 disallows the loss. If you buy the same or a substantially identical security within the 30-day-before-or-after window, the loss shifts into the basis of the replacement shares in a taxable account, or is permanently lost if the repurchase is in an IRA. Selling for a gain is not restricted (Source: IRC Section 1091; Rev. Rul. 2008-5).

How do I avoid a wash sale?

Wait 31 or more days after the sale to buy the same security back, or replace it with one that is not substantially identical, such as a comparable fund from a different provider. Also watch dividend reinvestment, a spouse’s account, and IRA purchases, which trigger the rule inside the 61-day window (Source: IRC Section 1091; IRS Pub 550 (2025)).

Is the wash sale rule 30 or 61 days?

Both point to the same rule. It is called the 30-day rule because the statute measures 30 days before and 30 days after the sale, but the full disallowance window is 61 days: 30 days before, the sale date, and 30 days after. A repurchase anywhere in that span disallows the loss (Source: IRC Section 1091(a)).

What happens if you accidentally trigger a wash sale?

There is no penalty. The loss is disallowed for the current year, and in a taxable account it is added to the cost basis of the replacement shares, deferring the deduction until you sell them. The holding period carries over. If the repurchase was in an IRA, the loss is permanently lost (Source: IRC Section 1091(d); Rev. Rul. 2008-5).

Does the wash sale rule apply to gains?

No. IRC Section 1091 only disallows losses. If you sell a security at a gain, the gain is taxable and the wash sale rule does not apply, so there is no waiting period before repurchasing. The rule exists solely to stop a loss deduction while you keep the same position (Source: IRC Section 1091; IRS Pub 550 (2025)).

How long do you have to wait to buy back a stock after a wash sale?

Wait at least 31 days after the loss sale before repurchasing the same or a substantially identical security. Because the window runs 30 days after the sale, a repurchase on day 31 or later falls outside the 61-day span defined by the statute. Watch for automatic reinvestments during that period (Source: IRC Section 1091(a)).

This article is provided by Q3 Advisors for educational and informational purposes only. It is not tax, legal, or investment advice and is not a recommendation to buy, sell, or hold any security or to pursue any strategy. Tax outcomes depend on your specific circumstances and on current law, which can change. Consult a qualified tax or financial professional before acting. Q3 Advisors is a registered investment adviser; registration does not imply a certain level of skill or training. Additional information is available in our Form ADV.

Craig Wear Craig Wear
Helping IRA Millionaires save $1 million (or more) in unnecessary taxes

Is a Roth Conversion Right for You?

Get a personalized strategy from the firm that’s saved clients $9 billion in projected taxes

  • 2,400+ families guided through conversions
  • $9B in tax avoidance
  • Built for $1M+ IRAs

no obligation. 45-minute consultation