Home › Guides › Options: the math
The wash sale rule timeline: how many days, with real dates
Sell at a loss, and a buy-back 30 days before or 30 days after can cancel your loss for now. That is 61 days on the calendar. Here is the rule on a real timeline, with the IRS's own dates and the first day you are clear.
The short answer
The wash sale window is 61 days. It is the day you sell, the 30 days before it, and the 30 days after it. The first day after the window is the sale day plus 31 days.
IRS Publication 550 calls it a wash sale when you sell stock at a loss and, "within 30 days before or after the sale," buy the same stock again. The IRS says "substantially identical." That means the same or nearly the same. A contract or option to buy it counts too.
Want your own dates? Type your sale day into the wash sale window calculator. It shades the 61 days on a calendar.
The IRS's own timeline, day by day
Publication 550 has two dated examples under "More or less stock bought than sold." Here is the first one on a timeline. The day counts are my arithmetic, checked with a date program.
| Date | What happened | Days from the sale | In the window? |
|---|---|---|---|
| Sep 20, 2024 | Bought the 100 shares that were later sold | 105 days before | Not a buy-back |
| Dec 4, 2024 | The window opens | 30 days before | |
| Dec 13, 2024 | Bought 50 more shares | 21 days before | Yes |
| Dec 20, 2024 | Bought 25 more shares | 14 days before | Yes |
| Jan 3, 2025 | Sold the 100 shares for a $1,000 loss | The sale day | |
| Feb 2, 2025 | The window closes | 30 days after | |
| Feb 3, 2025 | First clear day | 31 days after |
The IRS says: "because you bought 75 shares of substantially identical stock within 30 days before the sale, you cannot deduct the loss ($750) on 75 shares. You can deduct the loss ($250) on the other 25 shares."
Look at the dates. Both buy-backs came before the sale. The window runs backward too. The window runs backward too.
The second example runs the other way. You sold 100 shares on January 29, 2025, at a $1,000 loss. Then, in the IRS's words: "On each of the 4 days from February 3, 2025, to February 6, 2025, you bought 50 shares of substantially identical stock." Those buys land 5, 6, 7 and 8 days after the sale. The window ends on February 28, 2025, so all four are inside. The IRS says "You cannot deduct your $1,000 loss."
Calendar days or trading days?
Publication 550 says "30 days." In its first example it says "within 30 days from the sale." It does not say "calendar days," "trading days" or "business days."
The Canada Revenue Agency does say it. Its guide describes a period "starting 30 calendar days before the sale and ending 30 calendar days after the sale."
We count every calendar day, weekends and holidays too.
The last trading day of every month in 2027
A sale on the last trading day of a month is common, and year end gets the most attention. Here is the window for each one. I skipped the 10 days the NYSE is closed in 2027.
| Sale on | Window opens | Window closes | First clear day |
|---|---|---|---|
| Fri Jan 29, 2027 | Wed Dec 30, 2026 | Sun Feb 28, 2027 | Mon Mar 1, 2027 |
| Fri Feb 26, 2027 | Wed Jan 27, 2027 | Sun Mar 28, 2027 | Mon Mar 29, 2027 |
| Wed Mar 31, 2027 | Mon Mar 1, 2027 | Fri Apr 30, 2027 | Sat May 1, 2027 |
| Fri Apr 30, 2027 | Wed Mar 31, 2027 | Sun May 30, 2027 | Mon May 31, 2027 |
| Fri May 28, 2027 | Wed Apr 28, 2027 | Sun Jun 27, 2027 | Mon Jun 28, 2027 |
| Wed Jun 30, 2027 | Mon May 31, 2027 | Fri Jul 30, 2027 | Sat Jul 31, 2027 |
| Fri Jul 30, 2027 | Wed Jun 30, 2027 | Sun Aug 29, 2027 | Mon Aug 30, 2027 |
| Tue Aug 31, 2027 | Sun Aug 1, 2027 | Thu Sep 30, 2027 | Fri Oct 1, 2027 |
| Thu Sep 30, 2027 | Tue Aug 31, 2027 | Sat Oct 30, 2027 | Sun Oct 31, 2027 |
| Fri Oct 29, 2027 | Wed Sep 29, 2027 | Sun Nov 28, 2027 | Mon Nov 29, 2027 |
| Tue Nov 30, 2027 | Sun Oct 31, 2027 | Thu Dec 30, 2027 | Fri Dec 31, 2027 |
| Fri Dec 31, 2027 | Wed Dec 1, 2027 | Sun Jan 30, 2028 | Mon Jan 31, 2028 |
First, the clear day often lands on a weekend. When the market is closed on the first clear day, the first day you can place a trade is the next open day. After the May 1, 2027 clear day, that is Monday, May 3. Second, a December sale reaches into the next year: the December 31, 2027 window runs to January 30, 2028.
Hypothetical dated examples
These are made-up trades to show the dates. They are not trades anyone took.
A year-end sale. You sell at a loss on Tuesday, December 15, 2026. The window is November 15, 2026 to January 14, 2027. A buy-back on Monday, January 4, 2027, is 20 days after the sale. That is inside the window, even though it is in a new year. The first clear day is Friday, January 15, 2027.
A buy before the sale. You add shares on Friday, November 20, 2026. On Thursday, December 10, 2026, you sell other shares of the same stock at a loss. The buy was 20 days before the sale, so it is inside the window. The window runs November 10, 2026 to January 9, 2027.
A leap year. The same sale date ends one calendar date earlier when the window crosses February 29.
| Sale on | Window closes | First clear day |
|---|---|---|
| Mon Feb 1, 2027 | Wed Mar 3, 2027 | Thu Mar 4, 2027 |
| Tue Feb 1, 2028 | Thu Mar 2, 2028 | Fri Mar 3, 2028 |
Why: 2028 has a February 29, so 30 days after February 1 comes one date sooner.
Is there a window when you sell at a gain?
No. The IRS writes the rule about losses. It says a wash sale "occurs when you sell or trade stock or securities at a loss." A sale at a gain has no wash sale window. The calculator has a box for it: pick "At a gain" and it says so.
What the IRS text names, and digital assets
Publication 550's wash sale section says the rules "apply to losses from sales or trades of contracts and options to acquire or sell stock or securities." It also says they "do not apply to losses from sales or trades of commodity futures contracts and foreign currencies."
Crypto and other digital assets are covered in a different part of the same publication. It says a digital asset "is treated as property." The wash sale section talks about stock and securities. It does not name digital assets.
The Canadian version, same dates
The CRA's superficial loss rule uses the same 30-day window on each side. It adds a second test. You or a person tied to you must still own the shares, or a right to buy them, "30 calendar days after the sale." In the calculator, switch to Canada and it shows that day. See the superficial loss rule with options.
Where to go next
- Dollars, not dates: the wash sale calculator works out the disallowed loss and the new cost basis.
- Options: the wash sale rule with options, in worked examples.
- Reinvested dividends: wash sale and dividend reinvestment.
- Tax-loss dates for the year: last day to sell for a tax loss.
Questions
How many days is the wash sale rule?
The window is 61 days: 30 days before the sale, the sale day, and 30 days after. IRS Publication 550 says "within 30 days before or after the sale."
Is the wash sale rule 30 calendar days or 30 trading days?
Publication 550 says "30 days" and does not say which kind. The CRA says "30 calendar days." Our calculator counts every calendar day, weekends included.
When can I buy back without a wash sale?
The first day outside the window is the sale day plus 31 days. If you sold on January 3, 2025, the first clear day is February 3, 2025.
Does the wash sale rule apply to gains?
No. The IRS describes a wash sale as selling or trading "at a loss." A sale at a gain has no window.
Does the 30 days before the sale count?
Yes. In the IRS's own example, buys on December 13 and December 20, 2024 came before a January 3, 2025 sale. They are inside the window.
Does the wash sale rule apply to crypto?
The wash sale section of Publication 550 talks about "stock or securities" and does not name digital assets. The publication does say a digital asset "is treated as property."
The Options Wheel System · for StructureX members
Learn the whole wheel, step by step. Use it for life.
44 plain-English modules take you from zero to running the wheel: covered calls, cash-secured puts, assignment, rolling, the math and the risk rules. A scored quiz after every part. Members of StructureX Foundations, my 50-lesson course, add it in one click, with the AI Research Desk.
See What’s Inside the Course $34.99 a month · Cancel anytimeFollow along