Companies cannot pay for placement in our rankings. DollarVisor is funded by advertising, never by commissions on what we recommend.

Investing Q&A

The Wash Sale Rule, Explained With Examples

The wash sale rule blocks your tax deduction when you sell a security at a loss and buy a substantially identical one within 30 days before or after the sale. The loss is not destroyed. It g…

TL;DR: The wash sale rule blocks your tax deduction when you sell a security at a loss and buy a substantially identical one within 30 days before or after the sale. The loss is not destroyed. It gets added to the cost of the replacement shares. Our verdict: for most investors a wash sale costs between $0 and about $430 in delay, but the same mistake made inside an IRA costs the entire loss forever.

1. What the wash sale rule actually says

Quick Answer: A wash sale happens when you sell securities at a loss and, within 30 days before or after, buy substantially identical ones. The loss is disallowed for that year. It is not deleted, it moves into the cost basis of the shares you bought. The rule sits in Section 1091.

Three things must line up.

  • You sold at a loss. A sale at a gain is never a wash sale.
  • You bought a replacement. Buying, trading into, or acquiring an option to buy the same security all count, per IRS Publication 550.
  • The purchase landed inside the window. Thirty days before the sale, or thirty days after.

The word people get wrong is “before.” The clock starts a month before you sell. Buy shares in late November, sell an older lot at a loss in mid-December, and you have a wash sale looking backward. That half of the window catches automatic monthly investors most often.

Key takeaway: This is a timing rule, not a penalty. It decides which tax year your loss lands in, and in one case whether it lands.

A short walkthrough before the numbers.

Video: Wash Sale Rule Explained: Tax Loss Harvesting for Stocks and Crypto

2. The 61-day window, day by day

Quick Answer: The window is 61 calendar days: the 30 days before the sale, the sale date, and the 30 days after. Sell on December 15, 2026 and it runs through January 14, 2027. Weekends and holidays count, so that is roughly 42 trading days.

Five purchase dates against one loss sale. Only the two outside the window keep the deduction.

Wash Sale Window for a December 15, 2026 Loss Sale
Purchase dates around a December 2026 loss sale and which fall inside the window.
Date you buy the replacement Days from sale Inside the window? Loss deductible in 2026?
Fri, Nov 13, 2026 32 before No Yes
Mon, Nov 16, 2026 29 before Yes No
Tue, Dec 15, 2026 Sale date Yes No
Thu, Jan 14, 2027 30 after Yes No
Fri, Jan 15, 2027 31 after No Yes

Source: DollarVisor calculation using the Section 1091 window in IRS Publication 550, 2026 calendar.

Notice the edge. The safe zone opens on day 31, not day 30. Counting to exactly 30 and buying that morning still lands inside the window, the off-by-one error readers ask about most.

Key takeaway: Wait 31 days, not 30, and count from the trade date rather than the settlement date.

Not sure whether a trade you already made counts?

Our investing hub covers the account types, tax rules and broker features that decide it. Browse the investing guides →


3. Three worked examples, start to finish

Quick Answer: The rule is easiest to see in dollars. In all three cases the investor sells 100 shares bought at $60 for $45, a $1,500 loss. What they do next decides whether the $1,500 reaches this year’s capital gains calculation.

  • Maria, the clean sale. She sells on December 15 and buys nothing similar until February. Her $1,500 loss is deductible in 2026.
  • David, the classic wash sale. He buys 100 shares back at $46 on December 28. The $1,500 loss is disallowed and his basis becomes $6,100 rather than the $4,600 he paid. He also inherits the old holding period.
  • Priya, the partial wash sale. She buys only 40 shares back inside the window, so 40 percent of the loss is disallowed. She deducts $900 now and rolls $600 into the basis of those 40 shares.
Key takeaway: Disallowance is proportional. Buying back a quarter of the position disallows a quarter of the loss.

4. What “substantially identical” really means

Quick Answer: Congress never defined “substantially identical,” and neither has the IRS. The safe reading: the same ticker always counts, two funds tracking one index are risky, and two different companies do not count even in one industry. Publication 550 says one corporation’s stock is generally not identical to another’s.

The grid sorts common swaps into three risk bands. This is the judgment layer, where tax preparers disagree most.

Replacement Swap Risk Under the Wash Sale Rule
Replacement purchases grouped by how likely each is to count as substantially identical.
Risk band What you buy after the loss sale Why
Certain wash sale The exact same ticker, any account you control Identical by definition
A call option on the same stock An option to buy counts
Unsettled, treat as risky A different issuer’s fund tracking the same index Same holdings, no ruling either way
Generally safe A total-market fund replacing a large-cap index fund Different index and holdings
A competitor’s stock in the same industry Different corporation, per Publication 550

Source: DollarVisor classification from IRS Publication 550 and Investor.gov, 2026.

The middle band is uncomfortable on purpose. Two S&P 500 funds from different issuers hold the same 500 companies in the same proportions, and no ruling says whether that counts. If you hold mostly index funds and ETFs, dropping a risk band is cheap insurance.

Key takeaway: When two funds track the same index, assume the rule applies. The clean move is a different index, not a different brand.

5. Your loss is not gone, it just moves

Quick Answer: A disallowed loss is added to the cost of the replacement shares, raising your basis and shrinking your future taxable gain by the same amount. The old holding period carries over too. Publication 550 calls this postponing the deduction, not denying it.

Two adjustments happen at once. The second is rarely mentioned:

  • Basis rises by the disallowed loss. David’s $4,600 repurchase carries a $6,100 basis, so a later sale at $7,000 is a $900 gain, not $2,400.
  • The holding period carries over. Ten months on the old shares becomes ten months on the new ones, which can reach long-term rates sooner.

In a normal taxable account, a wash sale delays your deduction. It almost never destroys it.

So it deserves attention, not panic. Sell at a loss in December, buy back too soon, then sell the replacement shares before the next December 31, and the loss lands on the next return.

Key takeaway: Higher basis plus an inherited holding period means the deduction usually shifts by months, not decades.

6. The one place the loss dies for good

Quick Answer: Sell at a loss in a taxable account and buy the same security inside a traditional IRA or Roth IRA within the window, and the loss is disallowed with no basis adjustment anywhere. Revenue Ruling 2008-5 confirms IRA basis does not increase. The deduction is gone for good.

This is the only version that costs the whole loss instead of the timing. The basis adjustment that normally rescues the deduction has nowhere to land, because IRA basis does not work like taxable basis.

The IRS set this out in Revenue Ruling 2008-5, covering someone who sells in a brokerage account and has the IRA buy the replacement. The same logic reaches a Roth. If you fund an IRA automatically each month, that scheduled buy is a live trigger for any loss sale in the surrounding 30 days.

Employer plans sit in a grayer zone. The ruling addresses IRAs, and many advisors apply the same caution to a 401(k) buying the identical fund. Either way: pause the contribution, or harvest when the plan is not buying what you just sold.

Key takeaway: Check your retirement account’s automatic buys before harvesting. This is the only unrecoverable version.

Planning a December loss sale this year?

Our companion guide covers the offset order, the $3,000 income cap and the December 31 deadline. Read the tax-loss harvesting rules →


7. What a wash sale actually costs you

Quick Answer: On a $10,000 disallowed loss worth $2,400 in federal tax, damage runs from $0 to the full $2,400. Sell the replacement shares the same tax year and you lose nothing. Push the loss a year and you lose about $92 in time value. Do it inside an IRA and you lose all of it.

The chart models a single filer with $120,000 of other income, a $10,000 loss against a short-term gain taxed at 24 percent, and a 4 percent discount rate.

Real Cost of a $10,000 Disallowed Loss by Scenario
Modeled cost of a ten thousand dollar wash sale under four outcomes.
Scenario Relative cost Cost
Replacement sold in the same tax year $0
Loss pushed one year $92
Loss pushed five years $427
Replacement bought inside an IRA $2,400

Modeled scenario. Rate from the IRS 2026 adjustments; bars scale to $2,400.

The spread between the first row and the last is the lesson. Three outcomes are annoyances. One is a $2,400 mistake, made quietly by an automatic contribution nobody watched.

Key takeaway: The IRA version costs about 26 times more than the one-year delay most investors worry about.

8. How your state treats the same disallowed loss

Quick Answer: Most states begin with your federal figure, so a delayed loss reaches the state return when the federal one does. Pennsylvania is the exception: the federal wash sale provisions do not apply there. Texas and Florida have no income tax, so the state layer is moot.

The table prices the delay itself: one year of lost use on the state tax a $10,000 loss saves.

State Treatment of a Disallowed Loss in Ten States (2026)
State rate, wash sale conformity and the cost of a one-year delay in ten states.
State Rate on the loss Wash sale rule applies? Cost of a one-year delay
Pennsylvania 3.07% No $0
California 9.3% Yes $36
New York 5.9% Yes $23
Georgia 5.19% Yes $20
Illinois 4.95% Yes $19
Michigan 4.25% Yes $16
North Carolina 3.99% Yes $15
Ohio 2.75% Yes $11
Texas 0% No income tax $0
Florida 0% No income tax $0

Source: rates from Tax Foundation, 2026; Pennsylvania treatment from the Pennsylvania Department of Revenue. Delay costed at 4 percent.

Pennsylvania is worth reading twice. Its Department of Revenue says the federal wash sale provisions do not apply there, and that every transaction is treated as separate and independent. A loss your federal return refuses can still be claimed on the PA return in the year you sell.

The catch sits elsewhere. Pennsylvania allows no carryover between years and no offset against another class of income, not even between spouses. New Jersey draws its own line: Form NJ-1040 says losses cannot be carried back or forward. In both states a loss must meet a gain in the same year or it is gone. National averages erase details like that, which is why our methodology reports state by state.

Key takeaway: Federal timing is half the picture. In Pennsylvania and New Jersey a loss must meet a gain the same year or the state deduction disappears.

9. The accounts and people the rule follows

Quick Answer: The rule looks at you, not at one account. It reaches every brokerage you own, your IRA and Roth IRA, and your spouse’s purchases. Publication 550 confirms it applies to a spouse’s buy even on separate returns.

Three boundaries people assume exist, but do not:

  • Two brokers are not two taxpayers. Selling at one firm and buying at another is still a wash sale. Neither brokerage sees the other’s trades, but you must report it.
  • Your spouse counts as you. A purchase in their account inside the window triggers the rule, filing status notwithstanding.
  • A company you control counts as you. Buying the replacement through a corporation you control is the same as buying it personally.

What the rule does not reach, as of August 2026, is cryptocurrency. Digital assets are property rather than securities, so a same-day sell and rebuy of Bitcoin creates no wash sale. Bills to close that gap keep appearing and none has passed, so treat it as current law, not settled.

Key takeaway: Inventory every household account before harvesting, including your spouse’s and any automated retirement buys.

10. How to sell at a loss without tripping the rule

Quick Answer: Two clean paths. Sit in cash or a clearly different fund for 31 days, then buy back. Or swap straight into a fund tracking a different index so you stay invested. The second suits anyone worried about missing a rebound.

How to harvest a loss without a wash sale

Run these five steps before placing the sell order.

  1. Turn off automatic buys. Pause dividend reinvestment and any scheduled contribution buying that security, taxable or retirement.
  2. Look back 30 days. Check every household account for a purchase of that security. A buy in the past month disallows part of the loss whatever you do next.
  3. Choose the replacement before you sell. Pick a fund tracking a different index, not a different brand of the same index.
  4. Sell and buy the replacement the same day. Market exposure stays intact and no new clock starts, because the replacement is not substantially identical.
  5. Mark day 31. If you want the original holding back, that is the first safe day to buy it.

One sequencing note: if you plan to rebalance your portfolio the same month, rebalance first and harvest second. Rebalancing often buys the fund you were about to sell.

Key takeaway: Dividend reinvestment is the quietest trigger of all. A $12 reinvested dividend inside the window can disallow part of a $12,000 loss.

Wondering how the payouts themselves get taxed?

Reinvested dividends are taxable income before they become a wash sale problem. See how dividends are taxed →


11. What your broker’s 1099-B will miss

Quick Answer: Your broker flags wash sales only for identical securities inside that one account. It cannot see your other brokerage, your IRA, or your spouse’s trades. Anything it misses is still yours to report on Form 8949 with code W.

Reporting is mechanical once you know the codes. On Form 8949 you enter “W” in column (f) and the nondeductible loss as a positive number in column (g). That cancels the loss on Schedule D and preserves the trail for your basis.

Keep your own record of that adjusted basis. Brokers do not track cross-account adjustments, so years later the 1099-B may show the purchase price instead of the basis you are entitled to. Without your own note, you overpay.

Key takeaway: A clean 1099-B is not proof that no wash sale happened. It only proves none happened at that one broker.

12. Our verdict, by situation

Quick Answer: Treat this as a checklist item, not a reason to avoid harvesting losses. Buy-and-hold investors should pause reinvestment and swap indexes. Active traders should track basis carefully. Pennsylvania and New Jersey filers should never let a loss slide into next year.

If this is you Do this
Index investor with automatic contributions Pause reinvestment, harvest, swap to a different index the same day
Frequent trader in single stocks Expect wash sales, track adjusted basis lot by lot, close positions before year end
Anyone funding an IRA monthly Never hold the same fund in taxable and IRA if you plan to harvest
Pennsylvania or New Jersey filer Match losses to gains within the same calendar year, every year

The bottom line: the wash sale rule punishes carelessness, not strategy. Investors lose money to it two ways only, by letting the deduction drift into a year where it is worth less, and by letting a retirement account buy the replacement. Both are avoidable with a calendar and a five-minute account check. The rest is bookkeeping, and DollarVisor would rather you spend the attention on costs and allocation.


13. Frequently Asked Questions

1. How long do I have to wait to buy back a stock after selling at a loss?

Thirty-one days. The window covers the 30 days before the sale and the 30 after, so the first safe purchase date is day 31 from the trade date. Buying on day 30 still lands inside it.

2. Does the wash sale rule apply if I sell at a gain?

No. The rule only restricts losses. You can sell a winner and buy it back the same minute, with no consequence beyond reporting the gain. Some investors do this to reset basis higher.

3. What happens to the disallowed loss?

It is added to the cost basis of the replacement shares, and the holding period carries over, so the deduction waits until you sell those shares. The exception is a purchase inside an IRA or Roth IRA, where the loss is permanently disallowed.

4. Does the wash sale rule apply to crypto?

Not under current law as of August 2026. Digital assets are property rather than securities, so Section 1091 does not reach them. Several bills have proposed changing that, so check before relying on it next year.

Want the rest of the tax picture before you trade?

DollarVisor publishes the state-level numbers behind every investing decision, with the math shown and no paid placements. Tell us what you are working out and we will point you to the right guide.

Get in touch →

Educational information, not tax or investment advice. Outcomes depend on your facts and state rules change. See our disclaimer.