Finance

What Is a Wash Sale and Why Does the IRS Care?

Key takeaways

  • A wash sale happens when you sell a stock at a loss and rebuy the same or a substantially identical security within 61 days.
  • The IRS disallows the loss for the current tax year under Section 1091, but adds it to the basis of the replacement shares.
  • The one exception is brutal: rebuy inside an IRA and the loss may be gone permanently, per Revenue Ruling 2008-5.
Chart of the Austrian stock market index from 1991 to 2010
Chart of the Austrian stock market index from 1991 to 2010

A long stock market chart showing the price swings that tempt investors to harvest tax losses. Photograph: Wikimedia Commons contributor

Image Credits: Wikimedia Commons / contributors (stock market chart images)

What is a wash sale?

A wash sale is a tax maneuver that does not work. You sell a stock or fund at a loss, then quickly buy back the same (or a "substantially identical") security. Your economic position barely changed, but on paper you have a tax loss to deduct.

Congress blocked this in Internal Revenue Code Section 1091: if the repurchase happens inside a 61-day window, the IRS disallows the loss.

This article explains the rule in plain terms: what triggers it, how the 61-day window is counted, what happens to the disallowed loss, and the traps that catch careful investors anyway, including the IRA trap and the spouse's account.

The 61-day window that defines the rule

The wash sale rule blocks a capital loss when you buy back a substantially identical security within 30 days before or after the sale. That is a 61-day window in total: 30 days before, the sale date itself, and 30 days after.

The "before" part surprises most people. Say you sell 100 shares at a loss on March 15, 2026. The window runs from February 13 through April 14. A purchase you already made in February can trigger the rule on a sale you make in March.

The rule is set out in the "Wash Sales" section of IRS Publication 550, the agency's core reference on investment income and expenses. It applies to stocks, bonds, options, ETFs, and mutual funds.

It applies only to losses; gains are never affected. If you sell at a profit and buy back the next day, the gain is fully taxable and the rule never enters the picture.

Why the IRS cares about this

Without the rule, every investor with a losing position could manufacture deductions on demand. Sell on December 29, buy back on January 2, claim the loss, and hold the same investment. The tax code would subsidize paper shuffling instead of real economic losses.

The theory behind Section 1091 is that the loss sale and the offsetting purchase inside the window amount to an economic wash. You ended up roughly where you started, so the tax code treats you as if you never sold. The deduction is denied, and the tax benefit you hoped for is deferred instead.

That deferral matters to the Treasury's timing, and it matters to you too, because you cannot use the loss to offset capital gains or reduce this year's taxable income.

What happens to the disallowed loss

The disallowed loss is deferred, not destroyed. It gets added to the cost basis of the replacement shares, and the holding period of the original shares carries over to the new lot. When you eventually sell those replacement shares without triggering another wash sale, the deduction flows through.

A simple example shows the arithmetic. You buy 100 shares at $50 ($5,000 basis) and sell at $40 ($4,000 proceeds) for a $1,000 loss. Two weeks later you buy 100 shares back at $42. The $1,000 loss is disallowed, and your new basis becomes $42 per share plus $10 per share of disallowed loss, or $52 per share.

Brokers flag many of these for you: wash sales are reported on Form 1099-B, and you note them on Form 8949 with code "W" in column (f), entering the disallowed amount as a positive number in column (g).

If you repurchase fewer shares than you sold, only a proportional share of the loss is disallowed. The IRS regulations require matching the disallowed portion to the replacement shares, share for share.

Stock market chart showing price movements over three months
Stock market chart showing price movements over three months

A three-month stock chart, the kind of view investors watch when deciding whether to realize a loss. Photograph: Wikimedia Commons contributor

The traps that catch careful investors

The rule applies at the taxpayer level across all accounts, including a spouse's accounts and accounts you control through a corporation. That cross-account reach is where most accidental wash sales happen.

Sell at a loss in one brokerage account and buy back in another, and the loss is still disallowed. Have your spouse buy the same stock in her account within the window, and it is disallowed too, even if you file separate returns, according to IRS Publication 550.

Entering into a contract or an option to acquire the security also counts as a purchase. Automatic dividend reinvestments (DRIPs) inside the window can trigger the rule. Employer stock purchased through an ESPP or 401(k) match can do it too, which is why December tax-loss harvesting needs a calendar check against every account you touch.

The IRA trap: the loss can die permanently

The single most expensive version of the mistake is buying the replacement shares inside a retirement account. Normally the disallowed loss is preserved by increasing the basis of the replacement shares. But retirement accounts do not use cost basis the same way, so there is nothing to attach the loss to.

IRS Revenue Ruling 2008-5 confirms the harsh result: sell at a loss in a taxable account, buy the same stock in your traditional IRA or Roth IRA within 30 days, and the loss is disallowed and effectively gone forever. No deferral, no later recovery.

The same logic applies to a 401(k) buy in the window. The practical takeaway is simple: during any loss-harvesting campaign, turn off automatic buys of the same security everywhere, including retirement accounts, before you start selling.

Illustration of stock market charts and trading graphs
Illustration of stock market charts and trading graphs

Illustrated stock charts of the type investors scan when timing sales around the wash sale window. Photograph: Wikimedia Commons contributor

How to harvest losses without tripping the rule

Tax-loss harvesting is legitimate. The IRS only demands that you wait.

After selling at a loss, stay out of the security and anything substantially identical for 31 days. Then you can repurchase freely, and the loss stands.

Common clean strategies include swapping into a similar-but-not-identical fund (an S&P 500 index fund for a total-market fund, for example), waiting the full 31 days before repurchasing, or simply harvesting at year end and redeploying into a different position.

What the IRS has never published is a bright-line definition of "substantially identical." Different share classes of the same fund are treated as identical.

Two different index funds tracking different benchmarks are generally treated as different. When in doubt, waiting the 31 days removes the question entirely.

One notable carve-out: cryptocurrency is currently exempt. The IRS classifies crypto as property rather than securities under IRS Notice 2014-21, so the wash sale rule does not apply to crypto losses as of now. Tax legislation could change that, so treat it as current law, not a permanent feature.

Frequently asked questions

Does the wash sale rule apply to gains?

No. It only disallows losses. A profitable sale followed by an immediate repurchase is a normal taxable event, and the gain is taxed as usual.

What counts as "substantially identical"?

The same stock, different share classes of the same fund, or options on that stock. Two different ETFs tracking different indexes are generally considered different securities, but the IRS has no bright-line test.

How do I report a wash sale?

Your broker reports it on Form 1099-B. You report it on Form 8949 with code "W" in column (f) and the disallowed amount in column (g), then carry totals to Schedule D.

Can a wash sale span the new year?

Yes. Sell at a loss in December, buy back in January within the window, and the loss moves to the next tax year. This is the classic year-end trap.

Does the rule apply in an IRA by itself?

Losses on sales entirely inside a traditional or Roth IRA do not matter for wash sale purposes, because those losses are not deductible in the first place. The danger is the cross-account case: taxable-account loss paired with an IRA repurchase.

This article is for general information only and is not financial advice.

The bottom line

The wash sale rule is the IRS's way of saying a tax loss has to be real. Sell at a loss and stay out for 31 days, and the deduction is yours.

Repurchase too soon and the loss is disallowed and deferred into the replacement shares' basis. Rebuy inside an IRA and it may vanish for good.

This article explains tax rules and is not tax advice. For your own situation, consult a qualified tax professional.

Latest in Personal Finance

Subscribe for one plain-English money explainer every morning.

Taggedwash saletaxesinvesting