The wash sale rule in Section 1091 of the Internal Revenue Code disallows a loss on stock or securities when you buy substantially identical stock or securities within 30 days before or after the sale. The loss usually moves into the basis of the replacement shares, so it is deferred. If the replacement shares are bought in your IRA or Roth IRA, the loss is gone for good.
That short answer covers most cases. The details matter at year end, when investors and their CPAs sell losing positions to offset gains, and a reinvested dividend or a purchase in a spouse's account quietly turns a planned deduction into a basis adjustment. This guide explains how the wash sale rule works as of October 2026, walks through a worked example, and covers how the rule treats crypto.
The statute is short. Under 26 U.S.C. § 1091(a), no loss deduction is allowed when, within a period beginning 30 days before the sale and ending 30 days after it, the taxpayer has acquired, or has entered into a contract or option to acquire, substantially identical stock or securities. The only exception in that subsection is for a dealer in stock or securities whose loss arises in the ordinary course of business.
IRS Publication 550 restates the rule in plain terms. A wash sale occurs when you sell or trade stock or securities at a loss and, within 30 days before or after the sale, you do one of four things:
Publication 550 adds that if you sell stock and your spouse or a corporation you control buys substantially identical stock, you also have a wash sale. The rule only reaches losses. A sale at a gain is taxed in the normal way, and you can buy the same security back the same day.
The window runs 30 calendar days before the sale, the sale date itself, and 30 calendar days after. That is 61 days in total, and weekends and holidays count. A purchase on day 30 after the sale still triggers the rule. The first clean repurchase date is day 31.
The table below uses a sale on Friday, 4 December 2026, the date used in the worked example later in this guide.
| Event | Date |
|---|---|
| Window opens (30 days before the sale) | 4 November 2026 |
| Loss sale (trade date) | 4 December 2026 |
| Window closes (30 days after the sale) | 3 January 2027 |
| First repurchase date outside the window | 4 January 2027 |
Two timing points catch people. First, the look-back half of the window means a purchase you made in November can disallow a loss you take in December. Second, Publication 550 states that for exchange-traded securities the holding period ends on the trade date you sold them, and a stock sold on 31 December is reported on that year's return even though settlement happens in January. A loss sale placed on 31 December 2026 therefore belongs on the 2026 return, and its wash sale window still runs through 30 January 2027.
Neither the statute nor the regulations give a bright-line definition. Publication 550 says you must consider all the facts and circumstances in your particular case, and it gives a few anchors:
Funds are the gray area. Selling a fund at a loss and buying the same fund back is plainly a wash sale. The IRS has published no rule that settles whether two funds from different sponsors that track the same index are substantially identical, so many advisers use a replacement fund that tracks a different index to keep the comparison clear. Treat any swap as a facts-and-circumstances judgment and document why the replacement differs.
Automatic purchases also count. A dividend reinvestment plan, as Publication 550 describes it, uses your dividends to buy more shares. If a reinvestment lands inside the window, those new shares are a purchase of identical stock and part of the loss is disallowed. Turning off reinvestment on the position before the sale avoids that.
A wash sale usually defers the loss. Publication 550 says to add the disallowed loss to the cost of the new stock or securities, and the result is your basis in the new shares. Section 1091(d) sets the same outcome in statutory language: the replacement basis equals the basis of the shares sold, adjusted by the difference between the purchase price of the new shares and the sale price of the old ones.
The holding period also carries over. Per Publication 550, your holding period for the new stock or securities includes the holding period of the stock or securities sold. That can turn a later sale of the replacement shares into a long-term transaction, which matters for rate planning and for the 3.8% net investment income tax calculation on higher-income returns.
When you buy fewer shares than you sold, only the matched shares are affected. Publication 550 tells you to match the shares bought with an equal number of the shares sold, in the order you bought them, and the rest of the loss stays deductible.
A client buys 200 shares of a stock on 2 March 2026 for $50 per share, a cost of $10,000. On 4 December 2026 the client sells all 200 shares at $38, for proceeds of $7,600 and a loss of $2,400.
Outcome A: wait it out. The client repurchases on 4 January 2027 or later and buys nothing identical between 4 November and 3 January. The full $2,400 loss is deductible on the 2026 return.
Outcome B: repurchase in the taxable account. On 18 December 2026 the client buys 150 shares at $40, a cost of $6,000. Because 150 of the 200 shares are matched, the disallowed loss is $1,800 (150/200 of $2,400). The remaining $600 is deductible in 2026. The replacement basis becomes $7,800 ($6,000 plus $1,800), or $52 per share.
On 15 June 2027 the client sells the 150 replacement shares at $45 for $6,750. The reported loss is $1,050 ($6,750 less $7,800). The original shares were held 277 days and the replacement shares 179 days, a combined 456 days, so the 2027 loss is long-term.
Outcome C: repurchase in an IRA. If the same 150 shares are bought inside the client's IRA on 18 December, $1,800 is still disallowed and only $600 is deductible. The $1,800 is never added to any basis.
| A: wait 31 days | B: rebuy in taxable account | C: rebuy in IRA | |
|---|---|---|---|
| Loss deductible in 2026 | $2,400 | $600 | $600 |
| Loss disallowed in 2026 | $0 | $1,800 | $1,800 |
| Basis of 150 replacement shares | n/a | $7,800 | not adjusted |
| Disallowed loss recovered later | n/a | Yes, through basis | No |
Across both years, Outcome B reports a total loss of $1,650 ($600 in 2026 plus $1,050 in 2027). That equals the economic result of the two trades: a $2,400 loss on the first lot offset by a $750 gain on the second. The wash sale rule changed the timing and character of the loss without changing the total. In Outcome C, $1,800 of loss disappears.
The permanent-loss result in Outcome C comes from Revenue Ruling 2008-5. The IRS considered an individual who sold stock at a loss and caused an IRA or Roth IRA to buy substantially identical stock within 30 days. Its holding: the loss on the sale is disallowed under § 1091, and the individual's basis in the IRA or Roth IRA is not increased by virtue of § 1091(d).
Publication 550 builds this into its list, telling you to add the disallowed loss to the new shares "except in (4) above", the IRA case. For clients who also run a mega backdoor Roth or other retirement strategy, check scheduled contributions and automatic fund purchases inside those accounts before harvesting losses in the brokerage account.
Brokers report part of the picture. Publication 550 explains that box 1g of Form 1099-B shows the disallowed wash sale loss when the securities sold were covered securities and the replacement shares had the same CUSIP number and were bought in the same account. It then adds that you cannot deduct a loss from a wash sale even if it is not reported on Form 1099-B.
On the return, a wash sale goes on Form 8949 with adjustment code W. The Form 8949 instructions say to report the sale and enter the nondeductible loss as a positive number in column (g). If the amount in box 1g of Form 1099-B is wrong, you enter the correct amount and, when your figure is lower than the broker's, attach a statement explaining the difference. The totals then flow to Schedule D, covered in more detail in our guide to Schedule D and Form 8949.
Harvested losses offset capital gains first. Under Publication 550, any excess net capital loss is deductible against other income up to $3,000 ($1,500 if married filing separately) per year, and the rest carries forward. A large harvest that converts a projected gain into a net loss can also change a client's quarterly estimated tax payments for the following year.
For most crypto, no. As of October 2026, §1091 by its terms covers stock and securities, and the current statutory text on Cornell LII contains no reference to digital assets. The IRS states on its digital assets page that for U.S. tax purposes digital assets are considered property. A token such as bitcoin, held as property and with no stock or security status, sits outside § 1091, so a loss sale followed by a quick repurchase is not disallowed under that section. Congress can extend the rule by statute, so check the law in force before relying on this for a 2027 harvest.
The exception is a tokenized security. The 2026 Form 1099-DA instructions tell brokers that losses from wash sales of tokenized securities must be reported, in box 1i, for tokenized securities treated as stock or securities under section 1091 when the sale and repurchase occur in the same account with the same CUSIP number.
Two practical points apply to crypto harvesting. Basis tracking still has to be exact, which our guide to crypto cost basis covers. Broker reporting on Form 1099-DA began for 2025 transactions, so harvested crypto losses will now be matched against broker data.
For high net worth individuals with several brokers and managed accounts, the cross-account review is where most missed wash sales come from, because each broker sees only its own account.
How long do I have to wait to avoid the wash sale rule? Buy the same or a substantially identical security no sooner than the 31st day after the sale, and make sure you did not buy it in the 30 days before the sale. For a sale on 4 December 2026, the first clean repurchase date is 4 January 2027.
Does the wash sale rule apply across different brokerage accounts? Yes. The rule applies to the taxpayer, so a purchase at another broker, in a spouse's account or by a corporation you control can trigger it. Brokers flag wash sales mainly within the same account, so the cross-account check falls on the taxpayer and the preparer.
Is a wash sale loss lost forever? Usually not. The disallowed loss is added to the basis of the replacement shares and the original holding period carries over. The exception is a purchase in an IRA or Roth IRA, where Rev. Rul. 2008-5 holds that the IRA basis is not increased, so the loss is permanently lost.
Does the wash sale rule apply to crypto? As of October 2026, §1091 by its terms covers stock and securities, and the IRS treats digital assets as property. Most crypto tokens therefore fall outside the rule. Tokenized securities are the exception, and Form 1099-DA has a box for their disallowed wash sale losses.
What does code W mean on Form 8949? Code W marks a nondeductible loss from a wash sale. You enter the disallowed amount as a positive number in column (g), using the box 1g figure from Form 1099-B or a corrected amount with an explanation if the broker's figure is too high.
Madras Accountancy supports US CPA firms with individual tax return preparation, including the capital gains schedules where wash sales live. Our team can reconcile broker 1099-B and 1099-DA data across accounts, compute basis adjustments and prepare Form 8949 workpapers for your review as part of a 1040 prep workflow. To discuss capacity for the coming filing season, contact our team.

The section 4960 excise tax is 21% of nonprofit pay over $1M. From 2026 it covers all employees. See the medical carve-outs, Form 4720 and a worked example.

The paid family and medical leave tax credit is permanent from 2026. See the 12.5% to 25% rates, the premium option, the 6-month rule and how Form 8994 works.

Opportunity zones become permanent in 2027 under the One Big Beautiful Bill. See the new deferral, rural bonus, and the 2026 handoff.