Once you know which losses survive the wash sale rule, see how much you can deduct now and how much carries forward. Enter your adjusted gains and losses in the calculator.

Open the Capital Loss Carryover Calculator →
Short Answer

The wash sale rule (IRC §1091) disallows a loss when you sell a stock or security at a loss and buy a substantially identical one within 30 days before or after the sale. The loss is not deleted: it is added to the basis of the replacement shares and the holding period carries over, so you get it back when you sell those shares in a clean transaction. The big exception is a repurchase in an IRA, where the loss is permanently forfeited. As of 2026, the rule does not apply to cryptocurrency.

Key Takeaways
  • 61-day window. The rule covers the 30 days before the sale, the sale day, and the 30 days after - a purchase anywhere in that span triggers it.
  • Substantially identical. The same stock or fund is covered; a different company or a fund tracking a different index generally is not.
  • Loss is deferred, not lost. The disallowed loss is added to the replacement shares' basis under §1091(d), and their holding period tacks on the old holding period.
  • The IRA trap is permanent. Under Revenue Ruling 2008-5, buying the replacement in an IRA disallows the loss with no basis step-up, so it is gone for good.
  • Spouses and entities count. A purchase by your spouse or a corporation you control can trigger the rule on your sale.
  • Dividend reinvestment can trigger it. An automatic reinvestment within the window is a purchase of more shares and can cause a wash sale.
  • Crypto is not covered (2026). Cryptocurrency is property, not a security, so §1091 does not currently apply to it.
  • Report with code W. A wash sale is shown on Form 8949 with code W and a positive adjustment in column (g).
  • It feeds the carryover. Because a wash sale shrinks your deductible loss, it directly affects your $3,000 deduction and your capital loss carryover.
M
Written by Munib Ur Rehman · Reviewed by Nausheen Shahid (LMN Tax Inc.) · Tax Years 2025 & 2026 · Last Reviewed: June 2026

What the Wash Sale Rule Is

The wash sale rule is an anti-abuse provision in IRC §1091. It stops you from claiming a tax loss on a security while staying invested in essentially the same position. If you sell stock or securities at a loss and acquire substantially identical stock or securities within a short window around the sale, the loss is disallowed for that year. The economic logic is simple: if you never really left the position, Congress does not let you bank the loss yet.

The rule matters most for tax-loss harvesting, the common practice of selling losers near year-end to offset gains or up to $3,000 of ordinary income. Harvesting only works if the loss is actually deductible, and the wash sale rule is the main thing that can take it away. Critically, the loss is not destroyed, only deferred (except in the IRA case below), so a wash sale is usually a timing problem rather than a permanent loss of the deduction.

Where It Comes From

Section 1091 disallows "any loss" from a sale of stock or securities where, within a period beginning 30 days before and ending 30 days after the sale, the taxpayer has acquired (or entered into a contract or option to acquire) substantially identical stock or securities. The matching basis and holding-period rules are in §1091(d). The IRS explains the mechanics in Publication 550. This guide walks through each part and then shows how it connects to your capital loss carryover.

The 61-Day Window

The wash sale period is often called the 30-day rule, but it is really a 61-day window. It includes the 30 calendar days before the sale, the day of the sale itself, and the 30 calendar days after. A purchase of substantially identical securities at any point in that span disallows the loss.

The Wash Sale Window (IRC §1091(a))
Part of the windowLengthWhat triggers the rule
Before the sale30 daysBuying substantially identical shares in the 30 days leading up to the sale
Day of sale1 dayThe loss sale itself
After the sale30 daysBuying substantially identical shares in the 30 days after the sale

The most overlooked half is the 30 days before. Investors who plan to harvest a loss often remember not to rebuy for 31 days afterward, but forget that a recent purchase, an automatic dividend reinvestment, or a payroll-plan purchase in the prior month can disallow the very loss they are trying to take. To be safe, the position should be clean of any substantially identical purchases for the full 61 days, and you must wait at least 31 days after the sale before buying back.

The window counts calendar days, not trading days, and there is no exception for weekends or holidays. Because the count is exact, a repurchase on day 30 still triggers the rule, while a repurchase on day 31 does not.

Substantially Identical Securities

The rule only bites if the security you buy is substantially identical to the one you sold. The phrase is not defined in the statute, and the IRS judges it on the facts, but some patterns are settled.

  • The same security is always substantially identical. Selling and rebuying the same company's common stock, or the same mutual fund or ETF, is the clearest wash sale.
  • Different companies are not. Selling one company's stock and buying a competitor's is not a wash sale, even in the same industry.
  • Index funds tracking the same index from the same provider are generally treated as substantially identical; two funds tracking different indexes usually are not, which is the basis of most harvesting swaps.
  • Preferred stock or bonds versus common stock of the same company can be substantially identical if they are convertible or otherwise interchangeable, but ordinarily are treated as different securities.
  • Options and contracts count. Acquiring a call option or a contract to buy substantially identical stock within the window triggers the rule just like buying the shares.

The practical takeaway for harvesting is to replace a sold fund with one that is clearly not substantially identical - a different issuer tracking a different index in the same asset class - so you keep market exposure without disallowing the loss. After 31 days you can switch back to the original if you wish.

How the Disallowed Loss Is Calculated

When a wash sale applies, you do not deduct the loss in the year of sale. The amount disallowed is the loss attributable to the shares that were replaced. If you replace only some of the shares you sold, only the loss on the matched shares is disallowed; the rest is deductible.

  • Full replacement. Sell 100 shares at a $2,000 loss and buy 100 substantially identical shares within the window - the entire $2,000 loss is disallowed.
  • Partial replacement. Sell 100 shares at a $2,000 loss but buy back only 40 - 40 percent of the loss ($800) is disallowed; the other $1,200 is deductible.
  • More shares bought than sold. If you buy more replacement shares than you sold, the disallowed loss attaches to an equal number of the new shares; the extra shares simply have their own cost basis.

The disallowed amount is what you carry into the basis adjustment below. It also means a wash sale reduces the net loss available for your $3,000 deduction and your carryover, which is why harvesting plans have to account for it before counting on a deduction.

The Basis and Holding-Period Adjustment

This is the part that makes a wash sale usually a deferral rather than a true loss. Under §1091(d), the disallowed loss is added to the cost basis of the replacement shares, and under the holding-period rules the time you held the original shares is added to the holding period of the replacement shares.

Basis Step-Up

Suppose you buy 100 shares for $5,000, sell them for $3,000 (a $2,000 loss), and rebuy 100 substantially identical shares for $3,100 within the window. The $2,000 loss is disallowed, so your basis in the new shares is $3,100 plus $2,000, or $5,100. When you later sell those shares in a clean transaction, the higher basis gives you a bigger loss or a smaller gain, recovering the $2,000. The loss was deferred, not lost.

Holding Period Tacks

The holding period of the shares you sold is added to the replacement shares. So if you had held the original shares for 11 months, the replacement shares are treated as already held 11 months. This can let a later sale qualify as long-term sooner than the actual purchase date would suggest, which affects whether a future gain or loss is short-term or long-term.

IRAs, Spouses, and Related Accounts

The wash sale rule reaches beyond the single account where you sold. A purchase of substantially identical securities counts even if it happens in a different account, in a spouse's account, or by an entity you control.

The IRA Trap (Permanent Loss)

The most damaging version is selling a security at a loss in your taxable account and buying the same security in your traditional IRA or Roth IRA within the window. Revenue Ruling 2008-5 holds that the loss is disallowed and, crucially, your basis in the IRA is not increased. Because an IRA has no outside basis to step up, the deferred loss has nowhere to go - it is permanently forfeited. The same result applies to a purchase in a spouse's IRA. Unlike an ordinary wash sale, you never get this loss back.

Spouses and Controlled Entities

The IRS treats a married couple as one economic unit for this purpose. If you sell at a loss and your spouse buys substantially identical shares within the window, the rule applies. A purchase by a corporation or partnership you control can also trigger it. Brokers cannot see across these separate accounts, so the burden is on you to identify the wash sale and adjust your return.

Automatic Dividend Reinvestment

A dividend reinvestment plan buys additional shares automatically. If a reinvestment lands within the 61-day window for a security you sold at a loss, even a small one triggers a partial wash sale on a matched number of shares. Turning off reinvestment in a position you plan to harvest is a simple way to avoid the surprise.

Cryptocurrency and What Is Not Covered

IRC §1091 applies to "stock or securities." That wording controls what falls outside the rule.

  • Cryptocurrency. The IRS treats cryptocurrency as property, not a security, so as of 2026 the wash sale rule does not apply to it. Selling a coin at a loss and rebuying it immediately generally preserves the loss. Congress has repeatedly proposed extending wash sale rules to digital assets, and the One Big Beautiful Bill Act did not make that change, so it remains current law. Watch for future legislation, and note that crypto held through a security, such as a stock or an ETF, can be a different story.
  • Commodities and most physical assets. Direct commodity positions outside the securities definition are generally not covered, though related securities and contracts can be.
  • Gains. The rule disallows losses only. There is no wash sale on a gain; selling at a gain and rebuying is never restricted.
  • Section 475 traders. A trader who has made a valid mark-to-market election under §475(f) reports ordinary gains and losses and is not subject to wash sale adjustments on securities.

Because the crypto position is widely misunderstood and the law could change, anyone harvesting crypto losses should document the rules in effect for the year and watch for new legislation each session.

Reporting a Wash Sale on Form 8949

Wash sales are reported on Form 8949, which feeds Schedule D. You report the sale normally, then flag the wash sale and add back the disallowed portion.

  • Column (f) - code W. Enter code W to identify the transaction as a wash sale.
  • Column (g) - adjustment. Enter the disallowed loss as a positive number. This reduces the loss in column (h), so only the deductible part flows to Schedule D.
  • Form 1099-B. Your broker reports wash sales within that one account and may show the adjustment for you, but brokers do not track wash sales across different accounts, across brokers, or between spouses.

The cross-account blind spot is where most reporting errors happen. If you sold at a loss in one brokerage and bought the replacement in another, in an IRA, or in your spouse's account, no single 1099-B will catch it, and you must make the code W adjustment yourself. Keeping the disallowed amount straight is also what keeps your basis in the replacement shares correct for the future recovery.

Wash Sales, Capital Loss Carryover, and Harvesting

The wash sale rule sits upstream of the capital loss rules. Only losses that survive §1091 enter the Schedule D netting that decides your $3,000 deduction and your carryover under §1211 and §1212.

The sequence is: first remove any wash-sale losses (deferring them into basis), then net short-term and long-term gains and losses, then apply the $3,000 ($1,500 MFS) annual limit against ordinary income, and finally carry the rest forward indefinitely, keeping its short-term or long-term character. A wash sale that disallows a loss this year shrinks both the current deduction and the carryover, then quietly restores the benefit later through the higher basis on the replacement shares.

For tax-loss harvesting to work, the loss has to be real for tax purposes, which means avoiding a wash sale entirely or accepting the deferral. Once your figures are clean, the Capital Loss Carryover Calculator shows how much you deduct now and how much, split by character, carries forward. For the rules on the deduction limit and indefinite carryover, the calculator's methodology walks through §1211 and §1212 step by step. Once losses are netted and a gain remains, the Qualified Dividends and Capital Gains Worksheet Guide shows the 0/15/20 percent rate that gain is taxed at.

Cleaned up your wash sales and ready to see the deductible number? Enter your short-term and long-term gains and losses to get this year's $3,000 deduction and the carryover split.

Open the Capital Loss Carryover Calculator →

Practitioner Insight (LMN Tax Inc.)

LMN Tax Inc. — Planning Notes

The wash sale that wrecks a client's return is almost never the obvious one in a single brokerage. It is the cross-account version: a loss harvested in the taxable account while a 401(k) or IRA quietly bought the same target-date or index fund the same week, or a spouse's automatic investment plan picked up the identical ETF. No 1099-B catches it, so we map every household account before approving a December harvest.

The IRA repurchase is the one we treat as a hard stop. An ordinary wash sale only defers the loss; an IRA wash sale destroys it because there is no basis to step up. We have seen five-figure losses vanish this way. The fix is trivial once you know the rule: never buy the security you just sold for a loss inside any IRA in the household for at least 31 days.

For harvesting we lean on the substantially-identical line. Selling one large-cap index fund and buying a different issuer's fund on a different index keeps the client invested through the 31 days without disallowing the loss, and we switch back afterward if they prefer the original. The mistake to avoid is swapping into a fund so close that the IRS would call it identical; the small tracking difference is the whole point.

We also remind clients that a wash sale is usually a timing issue, not a catastrophe, in a taxable account. The deferred loss rides along in the new basis and comes back on the next clean sale, and the holding period tacks, which can even pull a future sale into long-term treatment. We document the basis adjustment in the year it happens so the recovery is not lost track of two or three years later.

Real-World Scenarios

Scenario 1 — Classic wash sale, loss deferred
Buy 100 shares$5,000
Sell 100 shares (loss)$3,000
Rebuy 100 shares within 20 days$3,100
Loss disallowed this year$2,000
New basis (recovers later)$5,100
Scenario 2 — Wait 31 days, loss allowed
Sell at a loss$2,000
Rebuy on day 31Outside window
Loss deductible now$2,000
Scenario 3 — Partial replacement
Sell 100 shares (loss)$2,000
Rebuy only 40 shares40% matched
Disallowed (40%)$800
Deductible (60%)$1,200
Scenario 4 — IRA repurchase (permanent loss)
Sell in taxable account (loss)$4,000
Buy same security in IRAWithin window
Loss disallowed$4,000
Basis step-up in IRA$0 (gone)
Scenario 5 — Harvesting swap (loss allowed)
Sell Index Fund A (loss)$3,000
Buy Index Fund B (different index)Not identical
Loss deductible now$3,000
Scenario 6 — Crypto rebuy (2026, rule does not apply)
Sell coin at a loss$5,000
Rebuy same coin next dayProperty, not a security
Loss deductible now$5,000

When the General Rules Do Not Apply

  • Cryptocurrency (2026). Crypto is property, not a security, so §1091 does not apply. This could change if Congress acts; check the law for the year.
  • Section 475 mark-to-market traders. A valid §475(f) election produces ordinary gains and losses and removes wash sale adjustments on securities.
  • Dealers in securities. A loss sustained in the ordinary course of a dealer's business is excepted from §1091.
  • Gains. The rule disallows losses only; there is never a wash sale on a position sold at a gain.
  • Different, non-identical securities. Swapping into a security that is not substantially identical avoids the rule even within the window.
  • State conformity. Most states follow the federal treatment, but confirm your state, especially if it computes capital gains differently.
  • Cost-basis method interactions. Specific-identification versus average-cost choices can change which lots are matched in a partial wash sale.

Frequently Asked Questions

What is the wash sale rule?
The wash sale rule in IRC §1091 stops you from claiming a tax loss when you sell a stock or security at a loss and buy a substantially identical one within 30 days before or after the sale. The loss is disallowed for that year, but it is not lost: it is added to the cost basis of the replacement shares, so you recover it when you eventually sell them in a non-wash transaction. The rule prevents harvesting a loss while keeping the same investment position.
How long is the wash sale window?
The wash sale window is 61 days: the 30 days before the sale, the day of the sale, and the 30 days after. If you buy substantially identical stock or securities at any point in that period, the loss on the sale is disallowed. Many investors only think about the 30 days after a sale, but a purchase in the 30 days before the sale, such as a recent dividend reinvestment, can trigger the rule just as easily.
What counts as substantially identical?
Substantially identical generally means the same stock or a security so close that the market treats them as interchangeable. Selling and rebuying the same company's common stock is the clearest case. The same fund, and in many cases an index fund tracking the same index from the same provider, is substantially identical. Two different companies, or two index funds tracking different indexes, generally are not. Stock and a bond of the same company, or stock and an option on it, can be substantially identical in some cases.
What happens to a disallowed wash sale loss?
A disallowed wash sale loss is added to the cost basis of the replacement shares under IRC §1091(d), and the holding period of the shares you sold is added to the holding period of the replacement shares. Nothing is permanently lost in an ordinary taxable account: when you later sell the replacement shares without triggering another wash sale, the higher basis produces a larger loss or smaller gain, giving the deferred loss back. The one exception is a wash sale into an IRA, where the loss is gone for good.
Does the wash sale rule apply to an IRA?
Yes, and the result is harsh. Under Revenue Ruling 2008-5, if you sell a security at a loss in a taxable account and buy a substantially identical one in your IRA or Roth IRA within the window, the loss is disallowed and your IRA basis is not increased. Because an IRA has no outside basis to step up, the deferred loss is permanently forfeited rather than recovered later. The same applies to a purchase in a spouse's IRA. This is the most damaging wash sale mistake.
Does the wash sale rule apply to cryptocurrency?
As of 2026, the wash sale rule does not apply to cryptocurrency. IRC §1091 covers stock or securities, and the IRS treats cryptocurrency as property, not a security, so selling a coin at a loss and rebuying it immediately generally preserves the loss. Congress has repeatedly proposed extending wash sale rules to digital assets, and the One Big Beautiful Bill Act did not enact that change, so it remains current law. Crypto held through a security, such as a stock or an ETF, is a different matter and can be covered.
How do I report a wash sale on my taxes?
A wash sale is reported on Form 8949. You enter the sale as usual, then use code W in column (f) and enter the disallowed loss as a positive adjustment in column (g), which reduces the deductible loss that flows to Schedule D. Your broker reports wash sales within a single account on Form 1099-B, but brokers do not track wash sales across different accounts or between spouses, so you may have to make adjustments the 1099-B does not show.
How do I avoid a wash sale?
Wait at least 31 days before repurchasing the same security, or buy something similar but not substantially identical during the wait, such as a different fund tracking a different index in the same sector. Turn off automatic dividend reinvestment in the security you are selling so a reinvested dividend does not trigger the rule. Watch all of your accounts and your spouse's, especially IRAs, because a purchase anywhere in that group can disallow the loss. Then confirm the deductible loss and carryover with the Capital Loss Carryover Calculator.

What to Do Next

If You Are Harvesting Losses Before Year-End

Confirm the position is clear of substantially identical purchases for the full 61-day window, including any IRA, 401(k), or spouse account. Then run the Capital Loss Carryover Calculator to see how much of the harvested loss you can deduct this year and how much carries forward.

If You Already Triggered a Wash Sale

Make sure the disallowed loss is added to the replacement shares' basis so you recover it later, and report the sale on Form 8949 with code W. Then re-enter your adjusted gains and losses in the carryover calculator to get the correct deductible figure.

If You Have Capital Gains to Offset

Losses that survive the wash sale rule offset capital gains without the $3,000 limit. Estimate the gain on a property sale with the Home Sale Capital Gains Calculator, or read the Installment Sale Guide to time the gains a carryover can shelter.

If You Borrowed to Invest

Margin interest is deductible only against net investment income, and the election to include capital gains changes the result. Check it with the Investment Interest Expense Calculator before you file.

Related Tools and Guides

Official Sources
Disclaimer: This guide describes the wash sale rule under IRC §1091, the basis and holding-period adjustment in §1091(d), Revenue Ruling 2008-5 on IRA repurchases, and the interaction with the §1211/§1212 capital loss deduction and carryover, for tax years 2025 and 2026. It is educational only and not tax or legal advice. The One Big Beautiful Bill Act (P.L. 119-21) made no change to these provisions, and the treatment of cryptocurrency as outside the wash sale rule reflects current law as of 2026 and could change by legislation. Section 475 trader elections, state conformity, and specific-lot basis methods can change the result. Consult a qualified tax professional for your specific facts.