Guide ยท Taxes

Tax-loss harvesting and the wash-sale rule: a CPA's guide

Tax-loss harvesting basically just means selling an investment that's down so the loss lowers your tax bill. For 2026, you have until Thursday, December 31 to do it. Here's what a loss is actually worth, how much of it counts this year, and the rule that can take it away if you buy back too soon.

Last reviewed Nov 10, 2026 by Blake, CPA.

I'm a CPA, but I'm not your CPA. This guide explains the federal rules, but it can't see your gains, your losses or your other accounts, so check your own situation with whoever does your taxes before you sell. State taxes aren't covered here.

I made a video on this in November 2026: Tax-Loss Harvesting: What a $6,000 Loss Can Actually Save You. I'll point you to the spot in the video for each idea, and the sources for every rule and number are listed at the bottom.

What a harvested loss is

A loss on your brokerage screen doesn't count for taxes. It only becomes a loss you can use when you sell. (Video at 0:53.)

The loss is what you paid for the shares, including commissions, minus what you sold them for. What you paid is called your cost basis, which basically just means your starting number for figuring gain or loss.

This only works in a regular taxable brokerage account. Inside an IRA or 401(k), selling doesn't create a capital gains tax bill, as I explain in this video at 2:51, so a loss in there doesn't lower your taxes either.

Short-term, long-term, and the netting order

Short term means you held the investment one year or less. Long term means more than one year. Short-term gains are taxed at the same rates as your paycheck, and long-term gains get lower rates of 0%, 15% or 20%, depending on your taxable income.

For 2026, the 0% long-term rate applies up to $49,450 of taxable income if you're single and $98,900 if you're married filing jointly. The 15% rate runs up to $545,500 single and $613,700 joint, and 20% is above that. Those come from IRS Rev. Proc. 2025-32, and they're all on my tax numbers page.

At tax time, Schedule D nets everything in this order:

  1. Short-term losses against short-term gains.
  2. Long-term losses against long-term gains.
  3. Then those two results against each other.

There's no cap on how much gain your losses can cancel. The cap is only on what spills over onto your other income. (Video at 1:18.)

One thing people miss: the netting isn't optional. If your long-term gains would have been taxed at 0% anyway, a loss still has to cancel them first, so those dollars of loss don't save you anything.

The $3,000 limit and carryforwards

If your losses are bigger than your gains for the year, up to $3,000 of the net loss comes off your other income, like your wages. It's $1,500 if you're married filing separately. The limit is written into the tax code as a flat dollar amount, so it isn't adjusted for inflation and it's $3,000 again for 2027.

I had to file married filing separately for a couple of years because of student loans, and as I say in the video at 1:29, that status cuts into almost every tax break, this one included.

Anything over the limit isn't wasted. It carries forward to next year, and the year after that, until it's used up. (Video at 1:48.)

All three of those are in IRS Publication 550, under Capital Losses.

What a loss is actually worth, with real numbers

A deduction isn't a refund check. It lowers the income you pay tax on, so a loss is worth the tax rate on whatever it cancels. (Video at 2:14.)

Let's say you're single. Back in March you sold a stock you'd owned for three years at a $4,000 long-term gain, and with that gain your 2026 taxable income is $80,000. In December you sell a different stock you've owned for eight months at a $6,000 loss.

StepAmount
Long-term gain from March$4,000
Short-term loss you harvest in December−$6,000
Net capital loss−$2,000
Tax saved on the cancelled gain (15% of $4,000)$600
Tax saved on the $2,000 off your other income (22% of $2,000)$440
Federal tax saved for 2026$1,040

Why 15% and 22%: for a single filer in 2026, the 22% bracket covers taxable income from $50,400 to $105,700, and long-term gains above $49,450 of taxable income are taxed at 15%. At $80,000, you're in both.

If the loss had been $11,000 instead, it would cancel the same $4,000 gain, take the full $3,000 off your other income, and carry the last $4,000 into 2027 as a short-term loss. That's $600 plus $660, or $1,260 saved for 2026, with the carryforward still to use. I walk through the same example in the video at 2:04.

Said another way, the most valuable dollars of loss are the ones that cancel short-term gains or come off your other income, because those are taxed at your regular rate. If your modified adjusted gross income is over $200,000 single or $250,000 joint, gains also carry the 3.8% net investment income tax, and a loss can trim that too.

The tax-loss harvesting estimator runs this with your own numbers.

The wash-sale rule

Here's the catch. The wash-sale rule says that if you sell at a loss and, within 30 days before or after the sale, you buy the same thing or something substantially identical, you can't deduct the loss right now. (Video at 2:34.)

Publication 550 says you have a wash sale if, within that window, you:

It's also a wash sale if your spouse, or a corporation you control, buys them. Counting the day of the sale, that's a 61-day window. And it only applies to losses... selling at a gain and buying right back doesn't trigger it.

The 30-day window runs both ways

Most people know not to buy it back for 30 days after the sale. Fewer people know the window also looks back 30 days before it. (Video at 3:03.)

So if you buy more shares in early December to "average down" and then sell your original shares at a loss, the December shares can trigger the rule.

For a sale on Thursday, December 31, 2026, the window runs from December 1, 2026 through January 30, 2027. January 30 is a Saturday, so the first trading day you could buy it back without a wash sale is Monday, February 1, 2027. (Video at 3:10.)

And a January buyback still costs you the deduction on your 2026 return. The window doesn't care that it crosses New Year's.

Where the disallowed loss goes

"Disallowed" sounds permanent, but in a regular account it's usually a delay. Publication 550 says to add the disallowed loss to the cost of the new shares, and your holding period for the new shares includes the time you held the old ones. (Video at 2:55.)

If you buy back fewer shares than you sold, only part of the loss is disallowed. The IRS matches the shares you bought to the shares you sold, in the order you bought them.

Let's say you paid $10,000 for 100 shares, sold them for $6,000 on November 20, and bought 60 shares back on December 5 at $58 each.

ItemAmount
Loss on the sale ($10,000 − $6,000)$4,000
Shares matched to the buyback60 of 100
Disallowed for now (60% of $4,000)$2,400
Loss you can still deduct for 2026$1,600
Basis of the 60 new shares ($3,480 + $2,400)$5,880, or $98 a share

When you eventually sell those 60 shares, your gain is $2,400 smaller, or your loss $2,400 bigger, than it would have been. That's the starting example in the wash-sale checker, which works out the matching and the new basis for you.

The traps: your IRA, your spouse, and buys you didn't click

Your IRA. If you sell at a loss in your taxable account and buy the same stock in your IRA or Roth IRA inside the window, it's a wash sale. The IRS ruled in 2008 (Rev. Rul. 2008-5) that the loss doesn't get added to the basis of the IRA shares. So that loss isn't delayed. It's just gone. (Video at 4:25.)

Your spouse. If your spouse buys the same stock in their account the day after you sell, Publication 550 treats it as a wash sale. A married couple is basically one investor with two phones. (Video at 4:09.)

Your spouse's IRA. As far as I can find, the IRS hasn't ruled on that exact combination. With the spouse rule and the IRA rule both on the books, I wouldn't risk it. I'd treat it as off limits. (Video at 4:43.)

Purchases you didn't click. Dividend reinvestment and automatic recurring buys are purchases too, even inside your IRA. Publication 550 even has an example where shares an employee gets as a bonus within 30 days of the sale block the loss. (Video at 3:34.)

Your other accounts. The rule follows you, not your account. Selling in one app and buying in another doesn't get around it. (Video at 3:49.)

And your broker probably won't catch it. Under the Form 1099-B instructions, a broker only has to report a wash sale when the sale and the purchase are in the same account and have the same CUSIP, which is just the ID number for a security. A buyback in another account, your spouse's account or your IRA is on you to track. (Video at 3:52.)

"Substantially identical" has no bright-line rule

I want to be plain about this: there's no list and no bright-line test for "substantially identical." Publication 550 says you have to consider all the facts and circumstances in your particular case.

Here's what we do have:

A lot of investors swap into something similar but not a twin, like a total stock market fund in place of an S&P 500 fund. Even that is a judgment call, not an IRS-approved answer. (Video at 5:24.)

The December 31 deadline, and why settlement doesn't matter

The sale has to happen by the last trading day of the year, which for 2026 is Thursday, December 31.

It doesn't have to settle by then. Settlement is when the shares and the cash actually change hands. For stocks and ETFs traded on an exchange, the tax year follows the trade date, not the settlement date, for gains and losses alike (IRS Revenue Ruling 93-84). So a sale on December 31 that settles in January goes on the earlier year's return. (Video at 5:34.)

Most trades now settle one business day after the trade date, a change the SEC made in May 2024. New Year's Day is a market holiday and January 2 and 3 fall on a weekend, so a sale on Thursday, December 31, 2026 won't settle until Monday, January 4, 2027. It still counts as a 2026 loss.

Just don't wait for the last closing bell of the year. If your order doesn't fill or your app freezes, there's no do-over, so give yourself a few days of cushion. (Video at 5:57.)

Choose which shares you sell

If you bought the same stock at different prices, you can often pick which shares you're selling, and the ones you paid the most for make the biggest loss.

Publication 550 calls this adequate identification. If your broker holds the shares, you tell the broker which shares to sell at the time of the sale and get a written confirmation. If you can't identify them, the IRS treats the shares you bought first as the ones you sold. You may not find that detail on your year-end statement, so keep your own record. (Video at 6:46.)

The cost-basis calculator compares the methods.

The honest catch: often you're pushing tax down the road

Here's the strongest argument against all of this, and it's a fair one. When you sell at a loss and buy something similar, your new cost basis is lower, so you'll probably owe more tax when you sell it later. A lot of the time you're not erasing tax, you're delaying it. (Video at 6:04.)

Delaying it can still be a real saving:

If none of those apply, think of the saving as a loan from the IRS with no interest.

The real risk is letting the tax tail wag the dog. If you sell something you believe in, sit in cash for a month, and it jumps 20% while you wait, you paid a lot for a $440 tax break. (Video at 6:29.)

How I'd handle it. This is the list I give in the video at 6:39, with the look-back check from this guide added:

  1. Start with what you've already sold this year, because gains you've already locked in are where losses do the most work.
  2. Before you sell, turn off dividend reinvestment and recurring buys on that investment in every account, including your IRA and your spouse's accounts, and check the 30 days before the sale for purchases.
  3. Sell the loser before the last closing bell of the year, with a few days of cushion.
  4. If you want to stay invested, buy something similar, not identical.
  5. If it's a big number or your situation is messy, run it past a tax professional before you click sell, not after.

And yeah, those are the rules. If you want help with your own return, here's how to find someone.

Sources