Can You Sell at a Loss and Rebuy the Same Stock? (w/Examples) + FAQs

This article reflects federal rules and general state rules as of June 2026 and covers tax year 2025 (the 2026 filing season). Tax law changes — confirm current figures before you file.

Quick Answer

Yes — you can sell a stock at a loss and rebuy it, but if you rebuy the same or a “substantially identical” stock within 30 days before or after the sale, the IRS “wash sale” rule disallows your loss for that year (tax year 2025). The loss is not lost; it moves into the new shares’ cost basis.

So the trade itself is always legal. What you lose is the immediate tax deduction, not the money and not the loss forever. Under IRC Section 1091, the loss gets parked in the cost basis of your replacement shares, and you claim it later when you finally sell those shares without rebuying.

The stakes are real because most people sell at a loss in December to cut their tax bill, then buy back in January when they feel the price will recover — landing them squarely inside the 30-day trap. For the 2025 tax year, the maximum net capital loss you can deduct against ordinary income is $3,000 ($1,500 if married filing separately), and a botched wash sale can wipe out the very deduction you were chasing. Roughly half of U.S. households own stock either directly or through funds, per Gallup’s 2025 stock ownership data, so this rule reaches far more people than most realize.

Here is what you will learn:

  • 🧮 Exactly how the 61-day wash sale window works, with the calendar math spelled out.
  • 💸 How a disallowed loss moves into your replacement shares’ cost basis — and how to get it back.
  • 🪙 Why crypto, IRAs, and your spouse’s account each change the answer.
  • 📄 How to report a wash sale on Form 8949 with code “W,” line by line.
  • ⚠️ The seven costly mistakes that turn a smart tax move into a denied deduction.

What “Selling at a Loss and Rebuying” Actually Means

Selling a stock at a loss and buying it back is a normal, legal trade. People do it to “harvest” a tax loss — they lock in a paper loss to offset gains or income, while staying invested for the rebound. Nothing in the tax code stops you from doing this.

The catch is timing. The IRS does not want you claiming a tax loss on a sale that did not really change your investment position. If you sell and rebuy almost immediately, you still own the same thing — so the agency treats the loss as artificial and refuses the deduction for that year.

This is the wash sale rule, found in IRC Section 1091. In plain words: sell at a loss, rebuy the same or a “substantially identical” security too soon, and the loss is disallowed for now. The word “disallowed” scares people, but it does not mean “destroyed.” The loss is deferred — postponed into the future, not erased.

Three ideas drive everything in this article. First is the 61-day window (30 days before, the sale day, and 30 days after). Second is “substantially identical,” the phrase that decides whether your rebuy triggers the rule. Third is the basis adjustment, the mechanism that saves your loss for later. Master those three, and you control the outcome.

The 61-Day Window: How the Timing Works

The wash sale rule covers a 61-day period: the 30 calendar days before your loss sale, the day of the sale itself, and the 30 calendar days after, as Charles Schwab explains in its primer. Most people only watch the days after the sale. That is half the trap.

A purchase before your sale counts too. If you bought more shares on December 1 and then sold older shares at a loss on December 20, that earlier buy can trigger the rule, because it falls inside the 30 days before. The consequence is a disallowed loss you never saw coming. The fix is simple: count both directions before you sell.

The days are calendar days, not trading days. Weekends and holidays count. To be fully clear of the rule, you must wait 31 days after the sale before you rebuy, which puts you on day 31 — outside the 30-day “after” window. Buying on day 30 still triggers it; buying on day 31 is safe.

A Worked Calendar Example

Say you sell shares at a loss on Tuesday, December 9, 2025. Count 30 days forward. Day 30 lands on January 8, 2026. So the danger zone runs through January 8. The earliest safe rebuy date is January 9, 2026 (day 31). If you buy back on January 8, the loss is disallowed; one day later, it is fully deductible. This single-day difference is why a calendar matters more than instinct here.

“Substantially Identical”: The Phrase That Decides Everything

The rule only bites if your replacement is the same security or one that is “substantially identical.” The IRS has never published a bright-line list, which makes this the grayest area in the whole topic. But clear patterns exist.

The same stock — selling Apple and rebuying Apple — is obviously identical and always triggers the rule. So does buying a call option or a contract to acquire that same stock, as Fidelity notes in its wash sale guide. Even automatic dividend reinvestments count as a repurchase, which is how many investors trip the rule by accident.

Two different index funds that track the exact same index are widely treated as substantially identical — for example, two S&P 500 funds from different companies, as discussed in this 2026 wash sale guide. But funds in the same sector that track different indexes are generally not substantially identical. That distinction is the heart of legal tax-loss harvesting.

Bonds and preferred shares of the same company are usually not substantially identical to its common stock if their terms differ enough. Stock in two different companies — even close competitors like Coca-Cola and PepsiCo — is never substantially identical. So you can sell one and buy the other freely.

The misconception here is that “similar” equals “identical.” It does not. A different fund tracking a different index, even in the same industry, is the standard, legal way to stay invested without triggering the rule. The consequence of guessing wrong is a denied loss, so when the call is close, write down your reasoning and keep it.

How the Loss Is Saved: The Basis Adjustment

A wash sale does not destroy your loss — it moves it. The disallowed loss is added to the cost basis of your replacement shares, per IRC Section 1091. Cost basis is simply what the IRS treats as your purchase price. A higher basis means a smaller taxable gain — or a bigger loss — when you finally sell those replacement shares.

There is a second gift hidden here. The holding period of your original shares “tacks on” to the replacement shares, under IRC Section 1223. So time you already held the old stock counts toward long-term status on the new stock. This can turn what looks like a short-term holding into a long-term one, taxed at lower rates.

A Worked Dollar Example

Maria buys 100 shares of XYZ for $5,000. She sells them for $4,000, a $1,000 loss. Eight days later she rebuys 100 shares for $4,200. Because she rebought inside 30 days, the $1,000 loss is disallowed now.

That $1,000 gets added to her new basis: $4,200 + $1,000 = $5,200 cost basis. Later, she sells the replacement shares for $6,000. Her taxable gain is $6,000 − $5,200 = $800, not the $1,800 it would have been without the adjustment. The $1,000 loss came back — it just lowered her future gain instead of her current income. The lesson: the math evens out as long as the rebuy stays in a taxable account.

Which Situation Applies to You?

The answer changes based on where and what you rebuy. Find your case below, then read the matching detail.

  • You rebuy the same stock in the same taxable brokerage account — classic wash sale; loss deferred into new basis. This is the standard case the examples above cover.
  • You rebuy in an IRA or Roth IRA — the harshest outcome; your loss is permanently destroyed. See the IRA section below.
  • Your spouse (or your other account) rebuys — still a wash sale; the IRS links your accounts. See the spouse section.
  • You buy a similar but not identical fund — generally legal and the core harvesting move. See “substantially identical” above.
  • You sell crypto at a loss and rebuy — the wash sale rule does not apply to most crypto for 2025. See the crypto section.

The IRA Trap (Loss Gone Forever)

If you sell a stock at a loss in your taxable account and rebuy it — or buy a substantially identical one — in your IRA or Roth IRA within the window, the loss is disallowed and there is no basis to add it to. The IRS confirmed in Revenue Ruling 2008-5 that your IRA basis is not increased. The consequence is severe: the loss vanishes permanently. To avoid it, never let an IRA buy the replacement during the 61-day window.

The Spouse and Multi-Account Rule

The IRS treats a rebuy in your spouse’s account or a different account of your own as your purchase, as NerdWallet explains. So you cannot dodge the rule by selling in one account and buying in another. The consequence is a disallowed loss you might miss entirely, because each broker only tracks its own account on your 1099-B. You must combine all family accounts yourself when checking the window.

Crypto: The Big Exception (For Now)

As of the close of 2025, the wash sale rule does not apply to most cryptocurrency, because the IRS classifies crypto as property, not a security, per Brager Tax Law. That means you can sell Bitcoin at a loss, claim the deduction, and rebuy it the same day — something stock investors cannot do.

This is a genuine planning edge, but watch two limits. First, crypto exchange-traded products and tokenized securities may be treated as securities and can fall under the rule, as a 2025 Yahoo Finance segment notes. Second, Congress has tried repeatedly to close this loophole, and the new Form 1099-DA already includes a wash sale box (1i), hinting the change is coming. Treat this exception as temporary and confirm the law in the year you act.

Three Common Scenarios

Below are the three situations most readers face, each with the action and its tax result.

Scenario 1 — Year-End Harvest, January Rebuy

What You Do What Happens on Your 2025 Return
Sell ABC at a $2,000 loss on Dec. 18, 2025, then rebuy ABC on Jan. 5, 2026 Loss disallowed (rebuy is day 18, inside the window); $2,000 shifts into the new shares’ basis
Sell ABC at a $2,000 loss on Dec. 18, 2025, then rebuy on Jan. 19, 2026 Loss fully deductible (rebuy is day 32, outside the window)

Scenario 2 — Swap Into a Similar Fund

What You Do What Happens on Your 2025 Return
Sell an S&P 500 fund at a loss, immediately buy a total-market fund tracking a different index Loss generally allowed; the funds track different indexes, so they are not substantially identical
Sell an S&P 500 fund at a loss, immediately buy another S&P 500 fund tracking the same index Loss likely disallowed; same index can be treated as substantially identical

Scenario 3 — The Hidden Pre-Sale Buy

What You Do What Happens on Your 2025 Return
Buy 50 more shares of DEF on Nov. 1, then sell your original DEF shares at a loss on Nov. 20 Loss on shares matched to the Nov. 1 buy is disallowed; the earlier purchase is inside the 30-days-before window
Sell all DEF at a loss on Nov. 20 with no purchase 30 days before or after Loss fully allowed; no triggering rebuy exists

Named Examples

David wants to lock in losses but stay invested. He sells his energy ETF at a $4,000 loss and the same day buys a different energy ETF tracking a different index. Because the two funds are not substantially identical, his $4,000 loss is allowed, and he keeps energy exposure. This is textbook legal harvesting.

Priya sells 200 shares of a tech stock at a $3,000 loss in her brokerage account on December 22, 2025. Three days later, her automatic IRA contribution buys the same stock. Under Rev. Rul. 2008-5, her loss is disallowed and permanently lost, because IRA basis is not adjusted. She turns off auto-invest during her harvest window the next year.

Carlos sells a stock at a $1,500 loss on January 10 and rebuys it on January 12. The loss is disallowed, but the $1,500 lifts his new basis, and his old holding period tacks on. When he sells nine months later without rebuying, the deferred loss reduces his gain, and the tacked holding period makes it long-term. He recovers the full benefit.

How to Report a Wash Sale on Form 8949

You report sales of stock on Form 8949 and carry the totals to Schedule D. A wash sale gets special coding so the IRS sees the disallowed amount. For step-by-step help with the form itself, see a dedicated How to Fill Out Form 8949 guide.

Here is the line-level walkthrough for a single wash sale entry:

  • Columns (a)–(e): Enter the security name, dates, proceeds, and cost basis as usual.
  • Column (f): Enter the code “W” to flag the transaction as a wash sale, as this Form 8949 guide explains.
  • Column (g): Enter the disallowed loss as a positive number — this is the amount from Box 1g of your 1099-B.
  • Column (h): The gain/loss after the adjustment, which removes the disallowed portion from your deductible loss.

If your broker already flagged the wash sale, the disallowed amount appears in Box 1g of Form 1099-B, and tax software lets you enter it as code “W,” as noted in this TaxSlayer Pro article. The consequence of skipping this entry is a mismatch with IRS records, which can trigger a notice. The deadline is your normal filing date — April 15, 2026 for the 2025 tax year.

Deadlines, Costs, and Timing

The harvest itself must happen by December 31 to count for that tax year — a loss sold January 2 belongs to the next year. The reporting deadline is your April 15 filing date (with extensions available to October). The wait to safely rebuy is always 31 days after the loss sale.

Cost-wise, doing this yourself with tax software runs roughly $0–$130 for the 2025 season, since brokers report wash sales on the 1099-B. If you have dozens of trades across multiple accounts, hiring a CPA typically runs $300–$700 and is worth it once the math gets tangled.

Mistakes to Avoid

  • Counting only the days after the sale. A purchase up to 30 days before also triggers the rule, disallowing a loss you thought was clean.
  • Forgetting dividend reinvestment (DRIP). An automatic reinvest counts as a rebuy and can disallow part of your loss without any action from you.
  • Rebuying in your IRA or Roth IRA. This destroys the loss permanently under Rev. Rul. 2008-5 — the worst outcome possible.
  • Assuming your spouse’s account is separate. The IRS combines spousal accounts, so a spouse’s rebuy still triggers the rule.
  • Treating two same-index funds as different. Two S&P 500 funds can be substantially identical, disallowing the loss you tried to harvest.
  • Rebuying on day 30 instead of day 31. One day early keeps you inside the window and kills the deduction.
  • Trusting a single broker’s 1099-B as complete. Each broker only tracks its own accounts, so cross-account wash sales go unreported and can surface in an IRS notice.

Do’s and Don’ts

  • Do wait at least 31 calendar days to rebuy the same stock — it is the only certain way to clear the window.
  • Do swap into a similar-but-not-identical fund if you want to stay invested, because that loss is generally allowed.
  • Do turn off automatic dividend reinvestment during your harvest window, so a DRIP does not silently trigger the rule.
  • Do track all your accounts and your spouse’s together, since the IRS treats them as one for this rule.
  • Do keep records of why a replacement fund is not substantially identical, in case the IRS asks.
  • Don’t rebuy the loss stock in any IRA — the loss disappears forever with no basis offset.
  • Don’t rely on instinct for the calendar; count the days, because a single day decides the outcome.
  • Don’t ignore Box 1g on your 1099-B — the disallowed amount must flow to Form 8949.
  • Don’t assume “similar” means “identical”; different competitors and different indexes are fine to buy.
  • Don’t treat the crypto exception as permanent, because Congress and the IRS are moving to close it.

Pros and Cons of Selling at a Loss and Rebuying

  • Pro — Tax savings. A harvested loss offsets gains and up to $3,000 of ordinary income for 2025, lowering your bill.
  • Pro — Stay invested. Swapping into a similar fund keeps your market exposure while still booking the loss.
  • Pro — Loss is never wasted. Even in a wash sale, the loss shifts into your new basis and returns later.
  • Pro — Carryforward. Net losses above the annual cap carry forward indefinitely until used.
  • Pro — Holding period tacks on. The old holding period carries to replacement shares, helping long-term rates.
  • Con — Wash sale risk. Rebuy too soon and you lose the current-year deduction you wanted.
  • Con — IRA loss is permanent. A rebuy in a retirement account destroys the loss with no recovery.
  • Con — Tracking burden. You must monitor every account, DRIP, and date across the 61-day window.
  • Con — Gray areas. “Substantially identical” has no IRS list, so close calls carry uncertainty.
  • Con — Transaction costs and drift. Selling and rebuying can mean spreads, taxes on gains in other lots, and price movement against you.

State Tax Conformity

Start with federal law: the wash sale rule is federal, under IRC Section 1091. The next question is “does my state follow this?” Most states that tax income use your federal capital gain or loss as the starting point, so they conform to the wash sale treatment automatically.

A handful of states — including Florida, Texas, Washington, Nevada, South Dakota, Wyoming, Alaska, and Tennessee — have no broad personal income tax, so the wash sale rule has no state effect there at all; that complete answer is valuable on its own. A few states with income taxes use their own rules for certain items, so if you live in a state with unusual treatment, confirm with your state’s department of revenue before filing.

What to Do Next

  1. List every loss position you are considering selling before December 31, 2025.
  2. Check all accounts — yours, your spouse’s, and any IRA — for purchases of the same security in the 30 days before and plan the 31-day wait after.
  3. Turn off dividend reinvestment on those holdings during the window.
  4. Decide your replacement — wait 31 days for the same stock, or buy a different-index fund now to stay invested.
  5. Save your 1099-B and report any Box 1g amount on Form 8949 with code “W” by April 15, 2026.
  6. Call a CPA or tax attorney if you have many lots, cross-account trades, or a close “substantially identical” call — that judgment is worth professional review.

This article is educational and not a substitute for advice from a licensed tax professional for your specific situation.

FAQs

Can I sell a stock at a loss and buy it back the same day?

Yes, the trade is legal, but the wash sale rule disallows the loss for tax year 2025 because you rebought inside 30 days. The loss shifts into your replacement shares’ cost basis and returns when you later sell.

How long must I wait to rebuy and keep the loss?

31 days. Wait at least 31 calendar days after the loss sale to rebuy the same or a substantially identical security. Buying on day 30 still triggers the rule; day 31 is safe.

Does the wash sale rule apply to crypto?

No, not for most cryptocurrency as of late 2025, because the IRS treats crypto as property, not a security. Crypto ETPs and tokenized securities can be exceptions, and the law may change soon.

Is the loss gone forever in a wash sale?

No, in a taxable account the loss is only deferred — it adds to your replacement shares’ cost basis. The exception is a rebuy in an IRA, where the loss is permanently lost.

What does “substantially identical” mean?

It means the same or nearly interchangeable securities, like the same stock or two funds tracking the same index. Different companies or different-index funds are not substantially identical, so buying them is allowed.

Does it count if my spouse rebuys the stock?

Yes. The IRS treats your spouse’s purchase and your other accounts as yours, so a spousal rebuy within the window triggers the wash sale rule just as your own would.

How much capital loss can I deduct in 2025?

$3,000 ($1,500 if married filing separately) against ordinary income for tax year 2025. Losses above that offset capital gains without limit and carry forward indefinitely.

Do automatic dividend reinvestments trigger a wash sale?

Yes. An automatic reinvestment counts as buying substantially identical shares, so it can disallow part of your loss if it falls inside the 61-day window. Turn off DRIP during a harvest.

How do I report a wash sale on my taxes?

On Form 8949 with code “W.” Enter the disallowed loss from Box 1g of your 1099-B as a positive number in column (g), then carry totals to Schedule D by April 15, 2026.

Can I avoid the rule by buying a similar ETF?

Yes, usually — if the replacement fund tracks a different index, it is generally not substantially identical, so the loss is allowed. Two funds tracking the same index can still trigger the rule.

Does buying before I sell trigger the rule?

Yes. A purchase up to 30 days before the loss sale counts inside the 61-day window and can disallow the loss, even though most people only watch the days after.

What happens if I rebuy the loss stock in my IRA?

The loss is permanently destroyed. Under Revenue Ruling 2008-5, the disallowed loss is not added to your IRA basis, so unlike a taxable account, you never recover it.