Glossary · US taxes

Wash Sale Rule: What It Is, the 30-Day Window and a Calculator

A wash sale is when you sell a stock or fund at a loss and buy the same one, or one that's substantially identical, within 30 days before or after the sale. The IRS won't let you deduct that loss yet. It isn't lost: it moves into the cost basis of the new shares, and their holding period includes the time you held the ones you sold. You get the loss back when you sell the new shares for good.

An example: 100 shares sold at a $2,000 loss on 15 December 2026

Bought at $50 on 3 March 2026, sold at $30, bought back at $32
Loss on your 2026 return$0of the $2,000. Code W on Form 8949, $2,000 in column (g)
Basis of the new shares$5,200$3,200 you paid plus the $2,000 loss, or $52 a share
They count as bought on24 Mar 2026The 287 days you held the old shares carry over, so they're long-term from 25 March 2027

The purchase in January still disallows a December loss: the window doesn't stop at the end of the tax year. Wait until 15 January to buy back and the full $2,000 counts on your 2026 return.

Wash sale calculator

Enter the sale, every purchase of the same security in the 30 days after it, and any from the 30 days before that you still held when you sold. It works out how much of the loss is disallowed, which shares take it and their new basis.

The sale at a loss

$
$

Purchases of the same security · in any of your accounts

Include reinvested dividends, automatic investments and buys at other brokers. Leave out earlier purchases you had already sold before the loss sale. Cost and sale price are per share, after fees. Purchases are matched to the loss in date order, the earliest first, one share for one share. A purchase in your spouse's account counts too; this calculator doesn't place the adjustment on their shares.

Wash sale
$2,000 disallowedof a $2,000 loss

Counts nowMoved into new sharesLost in an IRA
Deduct now$0
Into new basis$2,000
Lost for good$0

How the 30 days are counted

Calendar days, not trading days, counted from the trade date of the sale. The sale day plus 30 days either side makes 61.

Sold at a loss onWindow opensOpensWindow closesClosesFirst day to buy backBuy back
Mon 2 Nov 2026Sat 3 OctWed 2 DecThu 3 Dec
Mon 16 Nov 2026Sat 17 OctWed 16 DecThu 17 Dec
Tue 1 Dec 2026Sun 1 NovThu 31 DecMon 4 Jan 2027
Tue 15 Dec 2026Sun 15 NovThu 14 Jan 2027Fri 15 Jan 2027
Tue 22 Dec 2026Sun 22 NovThu 21 Jan 2027Fri 22 Jan 2027
Thu 31 Dec 2026Tue 1 DecSat 30 Jan 2027Mon 1 Feb 2027

Three things that catch people out

It runs backwards too. Shares you bought in the 30 days before the sale count, as long as you still hold them when you sell. Buy 100 more in late November, sell your original 100 at a loss in December, and that's a wash sale.

It crosses the new year. A loss sold on 31 December 2026 is caught by a purchase as late as 30 January 2027, and it's the 2026 return that loses the deduction.

Trade dates, not settlement. Both the sale and the purchase are dated by the day the trade was made. On day 31 you're clear, even if it's a Sunday; the table shows the first day markets are open.

Buy by30 Nov

To buy first and still sell at a loss on 31 December 2026

Some investors double up: they buy the new shares more than 30 days before selling the old ones, so they're never out of the market. For a sale on the last trading day of 2026, the extra shares have to be bought by Monday 30 November. Buy them on 1 December or later and the 31 December sale is a wash sale.

Six wash sale examples

The same 100 shares bought at $50 on 3 March 2026 and sold at $30 on 15 December, a $2,000 loss. Only the purchase around the sale changes.

Bought back 21 days later

Wash sale

You buy 100 shares back at $32 on 5 January 2027. The whole loss is disallowed and the new shares start at $52 a share, the $32 you paid plus $20 of carried-over loss.

Deduct on 2026 return$0
Added to new basis$2,000

Bought before selling

Wash sale

You buy 100 more at $34 on 25 November, then sell the original 100 on 15 December. The purchase was 20 days before the sale, so it counts. The newer shares' basis becomes $54 a share.

Deduct on 2026 return$0
Added to new basis$2,000

Bought back 40 of 100

Partly

You buy back only 40 shares at $31 on 22 December. Shares are matched one for one, so the loss on 40 of the 100 is disallowed. Those 40 start at $51 a share, and the loss on the other 60 counts.

Deduct on 2026 return$1,200
Added to new basis$800

Bought in an IRA

Wash sale

Your IRA buys 100 shares at $31 on 28 December. It's still a wash sale, but the IRA shares don't take the loss into their basis. The $2,000 is gone for good.

Deduct on 2026 return$0
Lost for good$2,000

Waited 31 days

Not a wash sale

You buy 100 shares back at $33 on 15 January 2027, day 31. The window closed on the 14th, so the whole $2,000 loss goes on your 2026 return. The price rose $3 a share while you waited.

Deduct on 2026 return$2,000
Added to new basis$0

Bought back at another broker

Wash sale

You sell at one broker and buy 100 back at $32 at another on 5 January 2027. The result is the same as the first example, but your 1099-Bs usually won't show it: the adjustment and the $52 basis are yours to make.

Deduct on 2026 return$0
Added to new basis$2,000

Where the disallowed loss goes

The first example, followed to the end: you sell the replacement shares at $35 on 15 June 2027.

2026: the loss waits

Sold for $3,000 against a $5,000 cost. The $2,000 loss is reported with code W and an adjustment that brings it to zero.

$0 deducted

The new shares carry it

100 shares bought for $3,200 on 5 January 2027, plus the $2,000 from the sale. Their holding period includes the 287 days you held the old shares.

$5,200 basis

2027: it comes back

Sold for $3,500: $3,500 − $5,200 is a $1,700 loss, the $2,000 that waited less the $300 the new shares gained. Sold after 24 March 2027, so with the carried-over days it's a long-term loss.

−$1,700 deducted

The holding period carries over too

You held the first shares from 3 March to 15 December 2026, 287 days. The new shares are treated as if you'd held them those 287 days already, so they count as bought on 24 March 2026 and are long-term from 25 March 2027, not from January 2028.

That matters when you sell: a long-term loss nets against long-term gains first, which are taxed at 0%, 15% or 20%, rather than against short-term gains taxed as income.

When it's a timing rule, and when it isn't

In a taxable account the wash sale rule only postpones the loss until you sell the replacement shares, whether that's later the same year or years later. You still get it, and in the meantime you keep the market exposure you wanted.

The exception is an IRA or Roth IRA. If the replacement shares are bought there, the loss is disallowed and nothing is added to the IRA's basis, so it never comes back. The IRS set this out in Revenue Ruling 2008-5.

What counts as substantially identical

The law doesn't list what's substantially identical. The IRS looks at the facts of each case; these are the common ones.

A wash sale

  • The same stock or fundBought in any account you own, with any broker.
  • A call option on itThe law counts a contract or option to buy the shares as buying them.
  • Your spouse buying itIRS Publication 550 says a purchase by your spouse, or by a company you control, creates a wash sale.
  • Reinvested dividendsA reinvestment in the window is a purchase, for the shares it buys.

A grey area

  • Two funds tracking the same indexVOOIVVBoth hold the S&P 500. The IRS hasn't ruled on swaps like this; many investors treat different issuers as different, but it's the swap most open to challenge.
  • Two share classes of one fundVTSAXVTIThe mutual fund and the ETF of the same Vanguard fund hold the same portfolio. Treat it as the same security.

Not a wash sale

  • A different companySelling Coca-Cola and buying PepsiCo, even in the same industry.
  • A fund on a different indexVOOVTIS&P 500 to the total US market: similar returns, different holdings.
  • The company's bonds or preferred stockNot usually identical to its common stock, unless they convert into it and trade like it.
  • Crypto held directlyThe IRS treats cryptocurrency as property, not stock or securities, so under the current law a bitcoin loss stands even if you buy back the next day.

Where wash sales hide

Most accidental wash sales come from a purchase you didn't think of as one.

The other broker

Sell at a loss at one broker and buy at another, and your 1099-Bs usually won't show it. Brokers only have to report a wash sale when both trades are in the same account and the same security.

Your IRA's monthly buy

A regular contribution that buys the same fund in your IRA inside the window turns a postponed loss into a lost one.

Dividend reinvestment

A quarterly dividend reinvested a week after you sell buys a few shares. Only those shares' share of the loss is disallowed, but it still needs an adjustment. Turn reinvestment off before you sell.

Your spouse's account

If your spouse buys the stock you just sold at a loss, it's a wash sale even if you file separately.

Selling only some lots

Buy 50 more shares, then sell the older 100 at a loss two weeks later, and the new 50 are inside the window. Half the loss is disallowed.

Options on the same stock

Selling shares at a loss and buying calls on the same company within the window is a wash sale. So is closing options at a loss and reopening the same contract.

How to report a wash sale on Form 8949

The sale goes on the form with the loss shown, then an adjustment cancels the disallowed part. The first example looks like this.

(a) Description(b) Acquired(c) Sold(d) Proceeds(e) Cost or basis(f) Code(g) Adjustment(h) Gain or loss
100 sh XYZ03/03/202612/15/20263,0005,000W2,0000

Column (g) is positive

The disallowed loss goes in as a positive number, so (d) − (e) + (g) gives the loss you can actually take: here, zero.

Your 1099-B may have done it

When the sale and the purchase were in the same account, the broker shows the disallowed amount in box 1g. You copy it with code W.

Or it may not

When the buy was at another broker or by your spouse, the 1099-B usually shows the full loss, so the adjustment and the higher basis on the new shares are yours to add. After a buy in an IRA you still add the adjustment, but the IRA shares' basis stays as it was.

Catch wash sales across all your brokers

Your brokers each see their own account. AllInvestView puts them in one place, so a sale at one and a purchase at another meet.

US tax report

The disallowed part of each loss, sale by sale

AllInvestView matches every loss sale against purchases in all the accounts in your US tax report, at any broker, and moves the disallowed loss into the replacement shares' basis. Replacements bought in an IRA or Roth IRA are treated as lost for good. The Form 8949 rows carry code W and the adjustment, and the tax-loss harvesting planner shows the wash sale before you sell. A Smart Alert can watch your US stock losses and tell you when a purchase lands inside an open window.

See the wash sale tracker
AllInvestView AllInvestView sale card: NKE, 50 shares sold at USD 38.59 from Schwab Brokerage, bought Jul 28, 2025, loss USD 2,032.50, proceeds USD 1,929.50, basis USD 3,962.00, allowed USD 1,626.00, and a note that USD 406.50 of the loss is disallowed by 10 replacement shares bought inside the wash-sale window AllInvestView sale card: NKE, 50 shares sold at USD 38.59 from Schwab Brokerage, bought Jul 28, 2025, loss USD 2,032.50, proceeds USD 1,929.50, basis USD 3,962.00, allowed USD 1,626.00, and a note that USD 406.50 of the loss is disallowed by 10 replacement shares bought inside the wash-sale window
One sale in the tax-loss harvesting planner, on a demo account: 50 NKE shares sold at a USD 2,032.50 loss, and USD 406.50 of it, a fifth, disallowed by 10 replacement shares bought inside the window. Staged capture.View full-size View full-size

Wash sale rules in other countries

Other tax systems have their own version, with different windows and different results.

CountryWindowWho countsWhat happens to the loss
United States30 days before and after the saleYou, your spouse, a company you control, your IRAAdded to the new shares' basis; lost for good if bought in an IRA
Canada30 days before and after, still held on day 30 afterYou and affiliated persons, including your spouseA superficial loss, added to the adjusted cost base of the new shares
United Kingdom30 days after the sale onlyYou; a buy in an ISA or by a spouse isn't matchedThe sale is matched with the new shares' cost, so a quick buy-back doesn't produce the loss. See the UK share CGT calculator
AustraliaNo fixed number of daysJudged on the purpose of the tradesThe ATO can cancel a loss from a sale and buy-back done mainly for the tax benefit. See the Australian CGT calculator

Questions about wash sales

What is the wash sale rule in simple terms?

If you sell a stock or fund at a loss and buy the same one, or one that's substantially identical, within 30 days before or after the sale, you can't deduct the loss yet. Instead it moves into the cost basis of the replacement shares, and you get it back when you sell them. The rule is section 1091 of the US tax code.

How long do you have to wait to avoid a wash sale?

Until day 31 after the sale. Sell at a loss on 15 December 2026 and the first day you can buy the same security back is 15 January 2027. You also can't have bought it in the 30 days before the sale, unless you sold those shares before the loss sale.

Is a wash sale loss lost forever?

Not in a taxable account. The disallowed loss is added to the basis of the replacement shares, and their holding period includes the time you held the shares you sold, so the loss comes back when you sell them. It is lost for good when the replacement shares are bought in an IRA or Roth IRA.

Does the wash sale rule apply across different brokers and accounts?

Yes. The rule applies to you as a taxpayer, not to one account, so a purchase in your IRA, at a second broker or by your spouse counts. Brokers only have to report wash sales on the 1099-B when the sale and the purchase are in the same account, so the others are usually yours to find and adjust.

Is selling VOO and buying IVV a wash sale?

The IRS hasn't said. Both track the S&P 500 but come from different issuers, and many investors treat them as different securities. It's the swap most open to challenge, though. Switching to a fund on a different index, such as the total US market, is the safer choice.

Is there a wash sale rule for crypto?

Not under the current law. Section 1091 is written for stock and securities, while the IRS treats cryptocurrency as property, so selling bitcoin at a loss and buying it straight back isn't a wash sale. That differs for crypto held through a fund or ETF, which is a security.

Does the wash sale rule apply to gains?

No, only to losses. You can sell at a gain and buy the same shares back the same day. The gain is taxed in that year and the new shares start at the price you paid for them.

See every wash sale before your 1099-Bs do

Connect your brokers or import your history, and your US tax report matches losses and purchases across all of them.

Create a free AllInvestView account

Sources

Checked on 29 October 2026.

The examples use made-up round numbers so the arithmetic is easy to follow. The calculator follows the matching in our US tax report: purchases in date order, share for share. It doesn't cover short sales, options on the loss side or a spouse's basis. None of this is tax advice.