The wash sale rule is a tax provision that blocks you from deducting a loss on a stock or security if you buy the same investment, or one substantially identical to it, within 30 days before or after the sale. The loss is not always gone forever. In an ordinary taxable account, the disallowed loss gets added to the cost basis of your replacement shares, which defers the tax benefit until you sell those shares cleanly. In a few situations, most notably when the replacement purchase lands inside an IRA, the loss is lost for good.
How the Rule Works
The rule sits in 26 U.S.C. § 1091. It applies when you sell shares of stock or securities at a loss and reacquire the same or a substantially identical investment too quickly. “Reacquire” is broad: it covers buying shares outright, entering a contract to buy, and purchasing an option on the shares.{1Office of the Law Revision Counsel. 26 USC 1091 – Loss From Wash Sales of Stock or Securities} When the IRS identifies a wash sale, the loss deduction is disallowed. You cannot use that loss to offset gains or reduce taxable income for the year.
The reasoning is that your economic position hasn’t really changed. Sell on Monday, rebuy on Wednesday, and you still own the same investment. Congress decided that a transaction like that shouldn’t produce a deductible loss, because nothing meaningful happened to your portfolio.
Intent does not matter. An accidental repurchase inside the window triggers the same disallowance as a deliberate one. Automatic dividend reinvestment can cause it. So can an automatic contribution to a fund you also happen to hold elsewhere.
The 61-Day Window
The restricted period is 61 calendar days: the 30 days before your loss sale, the day of the sale, and the 30 days after.{1Office of the Law Revision Counsel. 26 USC 1091 – Loss From Wash Sales of Stock or Securities} Every calendar day counts, including weekends, holidays, and days the market is closed. Sell shares at a loss on July 15, and the danger zone runs from June 15 through August 14.
The pre-sale half of the window catches people off guard. If you bought shares on June 20 and then sold your original lot at a loss on July 15, that June 20 purchase falls inside the 30-day lookback and disallows the loss.
The rule ignores the calendar year boundary. A loss sale in late December followed by a repurchase in early January is still a wash sale. The disallowed December loss shifts forward and attaches to the January replacement shares, so the deduction you were counting on for that tax year is gone.
What Counts as Substantially Identical
The statute does not define “substantially identical.” IRS Publication 550 tells you to weigh all the facts and circumstances.{2Internal Revenue Service. Publication 550 – Investment Income and Expenses} Some cases are easy. Selling 100 shares of a company’s common stock and buying 100 shares of the same common stock is always a wash sale.
Stocks of two different companies are ordinarily not substantially identical, even if the companies are in the same industry.{2Internal Revenue Service. Publication 550 – Investment Income and Expenses} Sell one airline and buy another, and you’re generally fine. Bonds and preferred stock of a company are not ordinarily identical to the common stock of that same company either, unless the bonds or preferred are convertible into common, carry similar voting rights, and track the conversion ratio closely.
Options and contracts are covered by the statute itself. Sell a stock at a loss and buy a call option on that same stock, and the rule applies.{1Office of the Law Revision Counsel. 26 USC 1091 – Loss From Wash Sales of Stock or Securities} Warrants work similarly: selling common stock at a loss while buying warrants for the same company’s common stock is a wash sale. Selling warrants and buying common stock only triggers the rule if the two are considered substantially identical on the facts.
ETFs and Mutual Funds
This is the genuinely ambiguous zone. The IRS has not issued a definitive ruling on whether two ETFs from different providers tracking the same index are substantially identical, or on switching between a mutual fund and an ETF holding similar portfolios. Publication 550 says shares issued by one mutual fund are not ordinarily substantially identical to shares issued by another, but the word “ordinarily” leaves room for argument when the holdings overlap heavily.
Automated tax-loss harvesting services often sell one S&P 500 fund and buy a different provider’s S&P 500 fund on the theory that the IRS won’t call them substantially identical. That theory is probably reasonable for funds with different management and fee structures, but it isn’t risk-free. The safer move when harvesting losses on an index fund is to replace it with a fund tracking a genuinely different index, such as selling a total-market fund and buying a large-cap value fund.
Mergers and Reorganizations
Corporate actions can turn distinct securities into substantially identical ones. Publication 550 notes that stocks of a predecessor and successor corporation in a reorganization may be substantially identical.{2Internal Revenue Service. Publication 550 – Investment Income and Expenses} If Company A acquires Company B through a stock swap, selling old Company B shares at a loss and buying Company A shares within the window could trigger the rule if the securities are now functionally the same.
What Happens to the Disallowed Loss
The loss isn’t erased in a normal taxable account. Under Section 1091(d), the basis of your replacement shares equals the basis of the shares you sold, adjusted for any difference between the old sale price and the new purchase price.{3Office of the Law Revision Counsel. 26 USC 1091 – Loss From Wash Sales of Stock or Securities} The disallowed loss rides forward on the cost basis of the new shares.
A quick example. You bought shares for $10,000 and sold them for $9,000, producing a $1,000 loss. Within the window you buy replacement shares for $9,200. The $1,000 loss is disallowed, and the new shares get a cost basis of $10,200: the $9,200 you paid plus the $1,000 disallowed loss. When you eventually sell those replacement shares outside a wash sale window, the higher basis produces a smaller gain or a larger loss.
Your holding period also carries over. Under Section 1223(3), the time you held the original shares counts toward the holding period of the replacement.{4Office of the Law Revision Counsel. 26 USC 1223 – Holding Period of Property} That matters, because long-term capital gains on assets held more than a year are taxed at rates between 0% and 20%, while short-term gains are taxed at ordinary income rates that can reach 37%.{5Internal Revenue Service. Topic No. 409, Capital Gains and Losses}
Partial Repurchases
If you repurchase fewer shares than you sold, the disallowance is proportional. Sell 100 shares at a loss, buy back 75 within the window, and only the loss on 75 shares is disallowed. The loss on the remaining 25 stays deductible.{6Internal Revenue Service. Instructions for Form 1099-B} The disallowed portion is added to the basis of the shares you bought back. Brokers report the disallowed amount in Box 1g of Form 1099-B.
Different Accounts, Spouses, and the IRA Trap
The rule applies across all of your investment accounts, not just within a single brokerage. Selling a stock at a loss in one broker’s account and buying it back in another broker’s account within 61 days still triggers the disallowance. Brokers are required to flag wash sales that occur within the same account for securities sharing a CUSIP number, but they generally do not track your activity elsewhere.{6Internal Revenue Service. Instructions for Form 1099-B} Your 1099-B may not catch every wash sale you owe. Catching cross-account violations is on you.
Spousal purchases can trigger the rule too. When a married couple files jointly, the IRS generally treats a purchase by one spouse as relevant to the other’s loss sale. If you sell a stock at a loss and your spouse buys the same stock within the window, expect the loss to be disallowed.
The IRA Problem
This is the single costliest wash sale mistake. Revenue Ruling 2008-5 confirmed that if you sell stock at a loss in a taxable account and buy substantially identical stock inside your IRA or Roth IRA within 30 days, the loss is disallowed. And here is the important difference: the basis of the IRA is not increased under Section 1091(d).{7Internal Revenue Service. Revenue Ruling 2008-5} Because IRAs don’t track cost basis the way taxable accounts do, the disallowed loss has nowhere to go. You can’t deduct it now, and you can’t recover it later through a higher basis. It’s gone.
The way this usually happens is quiet. You sell a losing position in December to harvest the loss, and an automatic IRA contribution or rebalance buys the same fund a week later. If you plan to harvest losses, check what your IRA holds, and consider pausing automatic contributions or rebalancing during the 61-day window.
Cryptocurrency Is Not Covered
Section 1091 applies only to “stock or securities.” Cryptocurrency and other digital assets are not covered by the wash sale rule as of 2026. You can sell Bitcoin at a loss and immediately buy it back without losing the deduction. The White House has recommended extending the rule to digital assets, and legislative proposals have circulated in Congress, but until a bill is enacted the exemption stands.
Harvesting Losses Without Triggering the Rule
Tax-loss harvesting is one of the simplest ways to reduce a tax bill, and the wash sale rule is the guardrail. A few approaches work reliably.
The most direct method is waiting. Sell the losing position, wait 31 full calendar days, then buy it back. Your loss is fully deductible and your original exposure is restored. The risk is that the security rises during those 31 days. To keep broad market exposure during the gap, some investors temporarily hold a fund that isn’t substantially identical, such as an international fund while waiting to buy back a U.S. index fund.
Substitution is the second approach. Instead of buying back the same investment, permanently replace it with a similar but not substantially identical one. Selling one large-cap growth fund and buying a fund tracking a different index harvests the loss while keeping comparable market exposure. Because different funds with different indexes and fee structures are ordinarily not treated as substantially identical, this generally clears the rule.
The “doubling up” strategy is more aggressive. Buy a second lot equal to your existing position, wait at least 31 days, and then sell the original high-basis lot using specific lot identification. Because the replacement purchase happened more than 30 days before the loss sale, the window is clean. The trade-off is that your position size and capital exposure are doubled for those 31 days.
Reporting on Your Return
Brokers report wash sales on Form 1099-B, Box 1g, which shows the disallowed loss. They are required to report wash sales inside the same account for covered securities sharing a CUSIP number, and may optionally report cross-account wash sales.{6Internal Revenue Service. Instructions for Form 1099-B} The disallowed loss increases the basis of the replacement shares, and the broker should reflect that adjusted basis on the form.
On your return, wash sale transactions flow through Form 8949 and then to Schedule D. Each wash sale requires an adjustment, typically shown with code “W” in column (f) of Form 8949, linking the disallowed loss to the basis increase on the replacement shares.{8Internal Revenue Service. Instructions for Form 8949} If your broker missed a cross-account wash sale, you make the adjustment yourself.
Keep records showing the purchase date, sale date, and cost basis for both the original and replacement shares, the amount of any disallowed loss, and the adjusted basis of the new shares.{8Internal Revenue Service. Instructions for Form 8949} During an audit, the IRS will want to see the chain connecting the disallowed loss to the eventual basis adjustment. Without that chain, the deferred loss can be lost.