WhitmanTrading

Wash Sale Rule: How the 61-Day Window Works, With Real Trades and Dividend Dates

A wash sale happens when a security is sold at a loss and a substantially identical one is bought within 30 days before or after that sale (the US rule), which disallows the loss for that year. The disallowed amount is generally added to the replacement's cost basis rather than lost.

A wash sale is a sale of stock or securities at a loss when you buy substantially identical stock or securities within 30 days before or after it; the loss is then not deductible for that sale. IRS Publication 550 adds the disallowed loss to the new shares’ basis, so in most cases the deduction is postponed rather than lost.

The rule stops a familiar trick: sell a falling position for the tax loss, buy it straight back, and own exactly what you owned before. What catches real people is rarely that trick. It is a purchase they did not think of as one, such as a reinvested dividend, a spouse’s account, or a purchase inside an IRA, landing inside a window that runs backward as well as forward.

How it works

The statute sets the window. Section 1091(a) of the Internal Revenue Code disallows a loss when, “within a period beginning 30 days before the date of such sale” and ending 30 days after it, the taxpayer acquires substantially identical stock or securities, or a contract or option to acquire them. Count calendar days, not trading days.

Publication 550 lists four ways to trigger it inside that window: buying substantially identical stock or securities, acquiring them in a fully taxable trade, acquiring a contract or option to buy them, or acquiring substantially identical stock for your IRA or Roth IRA. A purchase by your spouse or by a corporation you control also counts.

The loss moves into the replacement. You add the disallowed loss to the cost of the new shares, and their holding period includes the holding period of the shares you sold. The deduction comes back when the new shares are sold, unless that sale is a wash sale too.

Only matched shares are affected. When you buy more or fewer shares than you sold, Publication 550 matches the shares bought with an equal number of the shares sold, in the order you bought them, and only the matched part of the loss is disallowed.

The window on a calendar

Loss sale Window opens Window closes First day outside
8 Apr 2025 9 Mar 2025 8 May 2025 9 May 2025
15 Dec 2025 15 Nov 2025 14 Jan 2026 15 Jan 2026
1 Jul 2026 1 Jun 2026 31 Jul 2026 1 Aug 2026

Each window is 61 days including the sale day. The December row answers a common year-end question: a loss taken on 15 Dec 2025 is still exposed to a repurchase on 4 Jan 2026, because the window ignores the change of tax year. The July row matches the date example Fidelity uses, with 1 August the first clean day.

A worked example: a real loss, a real dividend

Take 100 shares of QQQ bought at the 19 Feb 2025 close of $539.52, its highest close of 2025 up to that point, and sold at the 8 Apr 2025 close of $416.06. The loss is $123.46 a share, $12,346.00 in all. No QQQ dividend was paid in the 30 days before the sale, and the seller buys nothing back.

But the shares were still held on 24 Mar 2025, QQQ’s ex-dividend date, so the $0.71571-a-share dividend arrives anyway, paid on 30 Apr 2025, 22 days after the sale. If the account reinvests dividends automatically, the $71.57 buys 0.1505 of a share at that day’s $475.47 close (brokers set their own reinvestment price; the close is used here as an illustration).

Apply the matching rule. Only 0.1505 shares were bought inside the window, so only the loss on 0.1505 of the 100 shares sold is disallowed: 0.1505 x $123.46 = $18.58. The other $12,327.42 of the loss stands. The fractional share’s basis becomes $598.93 a share, its $475.47 cost plus the $123.46 of disallowed loss per share, and its holding period includes the time the sold shares were held from 19 Feb.

Now the version that costs real money. Had the seller re-bought all 100 shares at the 1 May 2025 close of $481.68, the entire $12,346.00 would be disallowed and the new basis would be $605.14 a share. Same loss, same week, a different order of events, and a deduction postponed in full rather than trimmed by $18.58.

What counts as substantially identical

Publication 550 decides it on “all the facts and circumstances”. Shares of one corporation are ordinarily not substantially identical to shares of another, though predecessor and successor companies in a reorganization can be. Bonds or preferred stock are ordinarily not identical to the same company’s common stock, though convertible ones can be, depending on relative values and price changes; preferred stock that converts freely, carries the same votes and dividend limits and trades close to its conversion ratio is the publication’s example of one that is.

Funds are not addressed. The publication gives no example of two funds tracking the same index, or two tracking different indexes. Schwab’s own explainer offers swapping an S&P 500 fund for a Russell 1000 fund as an example and says the government has not given a straightforward definition of the term, so any claim that a particular pair is or is not substantially identical is an interpretation rather than an IRS rule.

Options count, commodity futures do not. The rules apply to contracts and options to buy or sell stock or securities, and Publication 550 says they do not apply to losses on commodity futures contracts or foreign currencies.

Where it catches people

Reinvested dividends. Publication 550 does not name dividend reinvestment, but it counts any purchase, and both Schwab and Fidelity list reinvested dividends as a trigger. The example above shows the usual size of the damage: small, and only on the shares the reinvestment bought.

Other accounts. A buy in your spouse’s account or in a corporation you control counts. A buy in your IRA or Roth IRA counts too, and Revenue Ruling 2008-5 holds that the IRA’s basis is not increased, so that disallowed loss has nowhere to go.

Short sales. A loss on closing a short sale is caught if substantially identical stock is sold, or shorted again, within 30 days before or after the closing.

Gains on the same day. Publication 550 says a wash-sale loss on one block cannot be used to reduce gains on identical blocks sold the same day.

Broker forms. Box 1g of Form 1099-B shows a disallowed wash sale loss only for covered securities bought back under the same CUSIP number in the same account. Publication 550 is explicit that the loss is still not deductible when the form does not show it, and it is reported on Form 8949 with “W” in column (f) and the disallowed amount in column (g).

The original data

Question: how often does a dividend payment fall inside a wash-sale window? For every QQQ trading session from 2 Jan 2013 to 30 Sep 2026 (3,457 sessions) taken as a sale date, the test asks whether a dividend was paid between 30 days before and 30 days after it, using the payment dates in Nasdaq’s dividend history for QQQ and Apple (quarterly payers) and BND, Vanguard’s total bond market fund (a monthly payer).

Three horizontal bars showing the share of 3,457 sale dates from 2013 to 2026 with a dividend payment inside the 61-day window: QQQ 67.43%, Apple 66.73% and BND 100.00%.
Share of sale dates, 2 Jan 2013 to 30 Sep 2026, with a dividend paid within 30 days before or after the sale, QQQ, Apple and BND. Source: Nasdaq dividend history payment dates and Yahoo Finance trading sessions (m106-qqq-aapl-bnd-distribution-paid-within-wash-sale-window-2013-2026.csv).

The finding: for a quarterly payer, a reinvested dividend lands inside the window about two times in three; for a monthly payer, every time. QQQ’s 57 payments covered 2,331 of the 3,457 sale dates (67.43%), Apple’s 54 payments covered 2,307 (66.73%), and BND’s 167 monthly payments covered all 3,457 (100.00%). The longest stretch of sale dates with no QQQ payment in the window was 60 sessions; for Apple it was 83.

And the slice it re-buys is small. One full reinvestment bought a median 0.19 shares per 100 held for QQQ (56 payments) and 0.22 for BND (165 payments), measured as the dividend divided by the close on the payment date. That is why the worked example lost only $18.58 of its deduction: frequent, but narrow.

Second check. Nasdaq’s closes for 19 Feb, 8 Apr, 30 Apr and 1 May 2025 match Yahoo’s to the cent, and every Nasdaq ex-dividend date matches a Yahoo dividend event within a day except two (QQQ 21 Sep 2020, BND 24 Dec 2012), which affect neither the payment dates nor the result. Every sale date is in the dividend window file.

The cost of waiting it out, from this page’s earlier study of SPY, IVV and VTI closes adjusted for distributions, 15 Jun 2001 to 26 Oct 2026. Each window runs from a sale date to the first session on or after the 31st day:

Over each 31-day window (6,357) SPY vs IVV SPY vs VTI SPY vs cash
Median gap 0.03 points 0.26 points 2.89 points
Gap under 1 point 99.73% 96.32% 16.97%
Gap of 5 points or more 0.00% 0.00% 22.53%

SPY was higher at the end of the window in 66.07% of them. This measures price behavior, not tax status; whether two funds are substantially identical is the facts-and-circumstances question above, and the data cannot answer it. The windows are in the 31-day window file.

Three bars for 6,357 thirty-one-day windows since 2001: SPY and IVV ended within 1 point of each other 99.73% of the time, SPY and VTI 96.32%, and SPY against cash 16.97%.
Share of 31-calendar-day windows in which the change gap was under 1 point, SPY vs IVV, SPY vs VTI and SPY vs cash, sale dates 15 Jun 2001 to 25 Sep 2026. Source: Yahoo Finance, adjusted daily closes (m97-spy-ivv-vti-31-calendar-day-window-changes-2001-2026.csv).

When it fails

The harvest that disappears for good. A loss is taken in a taxable account while an IRA buys the same fund on its usual monthly schedule. Publication 550 counts the IRA purchase, Revenue Ruling 2008-5 gives the IRA no basis increase, and the deduction is gone permanently without anyone deciding anything.

Checking only forward. Shares bought in the 30 days before the sale count, which is exactly the averaging-down sequence: add to a loser, then give up and sell the lot. In Publication 550’s own example, 75 shares bought in December disallow the loss on 75 of the 100 shares sold in January.

Trusting the 1099-B. It reports only same-account, same-CUSIP repurchases of covered securities. Purchases at another broker, in a spouse’s account or in an IRA are yours to track.

Forgetting reinvestment and scheduled buys. With quarterly dividends, about two sale dates in three had a payment inside the window from 2013 to 2026; with monthly ones, all of them. Each such purchase re-buys a small slice, but it is a purchase.

Treating cash as the safe choice. Waiting 31 days is a market bet of its own: SPY moved 5 points or more in 22.53% of the windows since 2001, and was higher at the end in 66.07%.

Treating “substantially identical” as settled. The IRS has printed no answer for funds, and broker examples are not rulings.

Questions people ask

Can you buy and sell the same stock within 30 days?

Yes. The rule only disallows losses. A sale at a gain is taxed as usual whether or not you buy back, and a loss sale followed by a repurchase inside the window simply has its loss moved into the new shares’ basis.

What happens if I accidentally trigger a wash sale?

The loss is not deductible for that sale, the disallowed amount is added to the basis of the replacement shares, and the sale is reported on Form 8949 with code W. Publication 550 says this applies even when the 1099-B does not show it.

How does the wash sale rule apply to day traders?

Publication 550’s wash-sale section names one exception: dealers in stock or securities, in the ordinary course of business. IRS Topic No. 429 adds that the wash sale rules do not apply to traders using a valid section 475(f) mark-to-market election. Without that election, a trader who sells at a loss and buys back within 30 days has each loss carried into the next shares’ basis until a loss sale with no repurchase in the window; see trader tax status for how the IRS separates traders from investors.

Is a wash sale illegal?

No. Nothing stops you from selling and buying back; the rule only takes away the deduction for that sale and, outside an IRA, adds it to the new basis.

Tax-loss harvesting is the operation this rule constrains, and the window above is what it has to plan around. Cost basis is where a disallowed loss goes, which is why the replacement shares need their adjusted figure recorded. And taxable accounts are the only place a deductible loss exists, while a purchase in an IRA can still cancel one.

The practical check

The detail that catches people is that it looks backwards too. Buying more of something in the weeks before you sell the rest of it at a loss can trigger this, which is exactly what somebody averaging down and then giving up would do — and it is the most natural sequence in the world.

— Michael Whitman

This page is educational, not financial advice. Test every idea on your own charts before risking money.