What Is a Wash Sale and How Does It Affect Taxes?

A wash sale is what happens when you sell a stock or other security at a loss and buy the same or a nearly identical security within 30 days before or after that sale. The IRS disallows the loss for the current tax year because your economic position hasn’t really changed. The loss isn’t erased, though. It gets added to the cost basis of the replacement shares, so you recover the tax benefit whenever you eventually sell those shares for good.

The 61-Day Window That Triggers the Rule

The rule sits in 26 U.S.C. § 1091, and it covers a 61-day window: the 30 calendar days before the loss sale, the day of the sale, and the 30 days after. Buy substantially identical stock or securities anywhere inside that window and the loss is disallowed.1Office of the Law Revision Counsel. 26 USC 1091 – Loss From Wash Sales of Stock or Securities

The backward-looking half of that window catches an obvious workaround. You can’t buy the replacement shares first and then sell your losing position, hoping the earlier purchase is safely in the past. If you bought the same stock on December 1 and sold your original lot at a loss on December 20, the December 1 purchase sits inside the window and triggers the rule.

The window follows the investor, not the account. Selling in one brokerage and rebuying in another still counts. So does a purchase through a dividend reinvestment plan you may have forgotten was running. Even a purchase inside your IRA can trigger a wash sale on a loss you took in a taxable account, which is the single most expensive version of this mistake and gets its own section below.

What “Substantially Identical” Actually Means

The statute uses the phrase “substantially identical stock or securities” without defining it. The IRS has never drawn a bright line, so the answer depends on facts and circumstances. IRS Publication 550 has the clearest guidance available.2Internal Revenue Service. Publication 550, Investment Income and Expenses

Shares of one corporation are generally not substantially identical to shares of another, even when the two companies operate in the same industry and their prices tend to move together. The main exception is a corporate reorganization, where predecessor and successor shares can be treated as substantially identical.

Bonds and preferred stock of a company are usually not substantially identical to that company’s common stock. Convertible preferred stock is the exception that can trip investors up. Publication 550 identifies specific conditions where convertible preferred becomes substantially identical to the common: it’s convertible at the holder’s discretion without restrictions, carries the same voting rights and dividend limits as the common, and trades at prices closely tied to the conversion ratio. The tighter the price link between the convertible and the common, the more likely the IRS treats them as the same security.

Options and warrants get pulled in by the statute’s own language. Section 1091 defines “stock or securities” to include contracts or options to acquire or sell stock or securities. Sell shares at a loss and buy a call option on the same stock inside the window, and you’ve triggered a wash sale.1Office of the Law Revision Counsel. 26 USC 1091 – Loss From Wash Sales of Stock or Securities

For ETFs and mutual funds, two funds from different providers tracking different indexes are clearly not substantially identical, even when their underlying holdings overlap heavily. Two funds designed to replicate the exact same benchmark sit in a grayer zone. The IRS has not ruled on whether, say, two S&P 500 index funds from competing companies are substantially identical, and most practitioners treat them as distinct because they have different managers, expense ratios, tracking methods, and legal structures. The closer two funds mirror each other, the more risk you carry if the IRS ever decides to draw a harder line.

How a Wash Sale Changes What You Owe

When the rule applies, you cannot use the disallowed loss to offset capital gains or reduce ordinary income for that tax year. Instead, the disallowed loss is added to the basis of the replacement shares. Section 1091(d) sets the basis of the replacement stock as the basis of the shares you sold, adjusted by the difference between your original purchase price and your sale price.1Office of the Law Revision Counsel. 26 USC 1091 – Loss From Wash Sales of Stock or Securities

A quick example. You sell 100 shares for $4,500, generating a $500 loss, and you buy 100 replacement shares for $5,000 within 20 days. The $500 loss is disallowed this year. But the basis of your new shares goes from $5,000 to $5,500. When you eventually sell those replacement shares for $6,000, your taxable gain is $500 rather than $1,000. The deduction was deferred, not destroyed.

The holding period follows along too. If you held the original position for 14 months before selling, the replacement shares inherit that 14 months of holding time. That carryover controls whether your eventual gain or loss ends up taxed at short-term or long-term rates.2Internal Revenue Service. Publication 550, Investment Income and Expenses

When You Only Rebuy Some of the Shares

The rule works share by share, which matters when your replacement purchase is smaller than the sale. Sell 100 shares at a $1,000 total loss, then buy back only 75 shares inside the window, and you match those 75 replacement shares against 75 of the sold shares. The $750 loss tied to the matched shares is disallowed and shifted into the basis of the new shares. The remaining $250 loss on the unmatched 25 shares is deductible normally. Replacement shares match against sold shares in the order you bought them.2Internal Revenue Service. Publication 550, Investment Income and Expenses

The Retirement Account Trap

The most punishing version of the wash sale rule involves retirement accounts. Sell a stock at a loss in your taxable brokerage account, then buy the same stock inside your IRA or 401(k) within 30 days, and Revenue Ruling 2008-5 treats it as a wash sale. The taxable-account loss is disallowed.3IRS. Rev Rul 2008-5

Here is what makes this so costly. In a normal wash sale, the disallowed loss rolls into the basis of the replacement shares, and you get the benefit back later. Retirement accounts don’t have a taxable cost basis. There’s no mechanism to increase basis inside an IRA or 401(k), so the deferred loss has nowhere to go. The deduction is gone for good. This mistake happens more often than you’d expect when investors run tax-loss harvesting in a taxable account while automatic contributions or reinvestments are buying the same fund inside a retirement account.

Spouses and Related Parties

Section 1091 applies to you as the individual taxpayer and doesn’t explicitly extend to purchases by a spouse or a corporation you control. That does not mean routing the replacement purchase through a spouse’s account is safe. The IRS can disallow the loss under the separate related-party rules of IRC § 267, which block deductions on sales between related persons, including spouses. In one Supreme Court case, a husband who managed his wife’s portfolio directed his broker to sell stock from his account and buy the same stock in her account at nearly the same price. The Court disallowed the losses as indirect related-party sales. Even where Section 1091 doesn’t technically apply, Section 267 can reach the same result, and it doesn’t come with a basis adjustment to soften it.

Where the Rule Doesn’t Reach

A few situations sit outside the wash sale rule, and it’s worth knowing where the boundaries fall.

Cryptocurrency is currently outside the rule. Section 1091 covers “stock or securities,” and the IRS classifies crypto as property rather than a security for federal income tax purposes.1Office of the Law Revision Counsel. 26 USC 1091 – Loss From Wash Sales of Stock or Securities You can sell Bitcoin at a loss and immediately buy it back without triggering a wash sale. Several congressional proposals have tried to extend the rule to digital assets and none have been enacted, but the gap is widely expected to close at some point.

Dealers in stock or securities get a narrow statutory exception when the loss arises in the ordinary course of their business as a dealer. This applies to market makers and similar businesses, not to individual traders or investors.1Office of the Law Revision Counsel. 26 USC 1091 – Loss From Wash Sales of Stock or Securities

Traders in securities who elect mark-to-market accounting under Section 475(f) also step outside the rule for their trading activity. Their securities are treated as sold at fair market value on the last business day of the year, gains and losses become ordinary, and the wash sale rule no longer applies. The election has strict timing requirements, is generally irreversible without IRS consent, and is only available to taxpayers whose activity qualifies as a trade or business rather than investing.4Internal Revenue Service. Topic No 429, Traders in Securities

Reporting a Wash Sale on Your Return

Your broker will usually flag wash sales on your year-end Form 1099-B, with the disallowed loss amount shown in box 1g. The catch: brokers are only required to track wash sales within the same account for covered securities that share the same CUSIP number. They may report wash sales across different accounts at the same firm, but they aren’t required to, and they cannot see purchases at other brokerages.5Internal Revenue Service. Instructions for Form 1099-B (2026)

If you trade the same security across more than one broker, identifying and reporting wash sales is entirely your job. The 1099-Bs will not catch them.

You report wash sales on Form 8949. Enter the transaction, put code “W” in column (f), and enter the disallowed loss as a positive number in column (g). That column (g) adjustment removes the disallowed loss from your net gain or loss, which then flows to Schedule D. If the wash sale amount on your 1099-B is wrong, enter the correct figure and attach a statement explaining the difference.6Internal Revenue Service. Instructions for Form 8949

Harvesting Losses Without Triggering the Rule

Tax-loss harvesting is still one of the more effective ways to lower an annual tax bill, and the wash sale rule doesn’t block it. It just demands some discipline.

The common approach is to sell the losing position and immediately replace it with a similar but not substantially identical security. Sell an S&P 500 index ETF at a loss, for instance, and you might buy a total stock market ETF or a large-cap blend fund that tracks a different index such as the Russell 1000. Your market exposure stays roughly intact, and the two funds are clearly distinct securities. After 31 days you can switch back to the original fund if you want.

The alternative is to sell and wait out the 31 days before buying the same security again. The risk is a rebound during that window that leaves you on the sidelines, which is why most practitioners prefer the immediate-replacement route.

Whichever path you take, keep records across every account you hold, including IRAs and any accounts owned by your spouse. The wash sales that cause real damage aren’t the ones your broker catches on a single 1099-B. They’re the cross-account trades nobody flags until the IRS asks about them.