The trade that looks free but isn't
Tax-loss harvesting is a simple idea: sell an investment that's currently worth less than you paid for it, realize the loss on paper, and use that loss to reduce your tax bill. You can then buy something similar to stay invested, so your portfolio's overall exposure barely changes. Done correctly, it's one of the few tax moves that costs you almost nothing and gives you something real back.
Done incorrectly, mostly by buying back the same investment too soon, the IRS disallows the loss entirely under what's called the wash-sale rule, and you're left with the same portfolio, no deduction, and a more complicated tax return. This post covers how tax-loss harvesting actually works, exactly where the wash-sale line is, and a worked example with real numbers.
What a capital loss is worth to you
When you sell an investment for less than you paid, the difference is a capital loss. The IRS lets you use that loss in two ways, in this order.
First, losses offset gains. If you harvested a $4,000 loss and also sold something else for a $4,000 gain this year, the two cancel out. No tax on the gain, and the loss is now used up.
Second, leftover losses offset up to $3,000 of ordinary income per year ($1,500 if you're married filing separately). This limit is set by the tax code and hasn't changed since 1978, so it isn't adjusted for inflation the way most tax figures are. If your losses exceed what you can use against gains and the $3,000 cap combined, the rest carries forward to future tax years indefinitely, keeping its short-term or long-term character, until it's fully used up (IRC Section 1212(b)).
A worked example. Say you harvest $12,000 in losses this year and have no capital gains to offset. You deduct $3,000 against your ordinary income this year, worth roughly $720 to $1,110 in actual tax savings depending on your marginal bracket (a 24% bracket saves $720, a 32% bracket saves $960, a 37% top bracket saves $1,110). The remaining $9,000 carries forward. Next year, if you realize a $9,000 capital gain elsewhere, say from rebalancing or selling a stock that's finally recovered, that carried-forward loss offsets it dollar for dollar, and you owe no capital gains tax on that sale at all.
This is why tax-loss harvesting compounds in value over a multi-year investing career. A loss harvested in a down year doesn't just save you money that year. It sits on your tax return as a credit against a future gain, sometimes years later.
The wash-sale rule, precisely
Here's where people trip up. The wash-sale rule says: if you sell a security at a loss and buy the same or a "substantially identical" security within 30 days before or after the sale, the loss is disallowed for tax purposes. That's a 61-day window in total, counting the sale date itself.
A few specifics that matter in practice:
The 61-day window runs both directions. You can trigger a wash sale by buying the replacement security before you sell the original, not just after. Selling on a Tuesday and having bought the same fund the prior Friday still counts.
"Substantially identical" is narrower than "similar." The same stock, or the same mutual fund or ETF, is substantially identical to itself. A fund tracking a different index generally is not, even if it holds many of the same underlying companies. Selling a total-market S&P 500 index fund and buying a total-market Russell 1000 fund from a different provider is a common, IRS-accepted way to harvest a loss while staying invested in something economically similar, without buying back the identical security.
Dividend reinvestment can trigger an accidental wash sale. If you have automatic dividend reinvestment turned on for a fund you're harvesting a loss in, and a dividend reinvests within the 30-day window, that small purchase counts. Many people harvest a loss, forget their DRIP setting, and unknowingly wash out part of the loss on a handful of shares. Turn off automatic reinvestment on any position you're planning to harvest, at least until the window closes.
The rule applies across all your accounts, including retirement accounts. This surprises people. If you sell a losing position in your taxable brokerage account and your spouse, or you personally in an IRA or 401(k), buys the same security within the window, the wash-sale rule still applies and disallows the loss. This cross-account application comes from IRS guidance (Revenue Ruling 2008-5), and it means "I'll just buy it back in my Roth IRA instead" doesn't work as a workaround.
A disallowed loss isn't gone, but it isn't usable now either. When a wash sale is triggered, the disallowed loss gets added to the cost basis of the replacement shares you bought. You'll eventually benefit from it when you sell those replacement shares, assuming they're not also caught in a wash sale at that point, but you don't get to use it this year, which defeats the point of harvesting in a year you actually wanted the deduction.
How to harvest a loss without triggering the rule
The standard approach is to sell the losing position and immediately buy a different fund that's similar in market exposure but not "substantially identical," then wait at least 31 days before considering a move back to the original fund, if you want to move back at all.
A concrete swap example. You hold Vanguard's Total Stock Market ETF (VTI), and it's down $5,000 from your purchase price. Selling VTI and buying iShares' Core S&P Total U.S. Stock Market ETF (ITOT), a different fund from a different provider tracking a different (though similar) index, keeps you invested in broad U.S. equities with no meaningful gap in market exposure, while avoiding the wash-sale rule because the two funds are not the same security. After 31 days, you could swap back to VTI if you wanted to, though many people simply hold the replacement fund going forward since the two are functionally similar for a long-term investor.
Time it around a real loss, not a hoped-for one. Tax-loss harvesting only works on a position that has actually declined in value from your cost basis. If you have multiple lots of the same fund purchased at different times, some lots might show a loss while others show a gain (a mismatch called "specific lot" variance). Most brokerages let you select specific tax lots to sell, so you can harvest exactly the lots that are underwater and leave the profitable lots untouched.
Check your automatic dividend reinvestment settings before you sell, not after, since turning it off after the fact doesn't undo a reinvestment that already happened inside the window.
When it's worth the effort
Tax-loss harvesting adds real value in a taxable brokerage account, since retirement accounts like a 401(k) or IRA don't have capital gains taxes to offset in the first place, so there's nothing to harvest there. It matters most in years with genuine market volatility, when at least some of your holdings have dipped below your purchase price, and for investors who hold individual stocks or sector-specific funds where one position can lag the broader market while others recover.
For someone with a simple, all-index-fund portfolio that rarely has an underwater position for long, the opportunity to harvest is smaller and less frequent, though even index investors saw real harvesting opportunities during the market drops of 2022 and again in early 2025. It's worth checking your positions against your cost basis whenever the market has a rough quarter, rather than only thinking about taxes in April.
None of this changes your overall investment strategy. The goal is staying invested with roughly the same market exposure the whole time, using the tax code's own mechanics to your advantage while you do it. If you're rebalancing anyway, whether after reviewing your net worth for the year or as part of a routine investment fee audit, a down position is worth a second look before you simply hold and wait for it to recover.
Where this actually shows up is at tax time, when a carried-forward loss quietly offsets a gain you'd otherwise owe tax on. It's one more item worth including on your own tax map alongside contribution limits and account types, since a loss harvested this year can still be paying off on a return you file three years from now.
Tracking your net worth doesn't require tracking every tax lot, but seeing your investment accounts drop in a given month is often the first signal that a harvesting opportunity exists. A monthly snapshot that shows a brokerage account down for the quarter is a good prompt to check your cost basis before assuming the dip is just noise to ride out.
Frequently asked questions
Can I harvest a loss and buy back the exact same stock the next day?
No. Buying back the same security within 30 days of the sale, in either direction, triggers the wash-sale rule and disallows the loss. You'd need to wait at least 31 days, or buy a different, non-identical security in the meantime.
Does the wash-sale rule apply if I sell in a taxable account and rebuy in my IRA?
Yes. The IRS applies the wash-sale rule across all of your accounts, including tax-advantaged ones like IRAs and 401(k)s, and this extends to a spouse's accounts as well. There's no workaround by moving the repurchase into a different account type.
What happens to a loss that gets disallowed by the wash-sale rule?
It isn't lost permanently. The disallowed amount is added to the cost basis of the replacement shares you purchased, which reduces your taxable gain (or increases a future loss) whenever you eventually sell those replacement shares. You just don't get to use it in the year you originally intended.
How much of a capital loss can I actually deduct each year?
You can use losses to offset capital gains dollar for dollar with no limit, and then deduct up to $3,000 of any remaining net loss against your ordinary income each year ($1,500 if married filing separately). Anything beyond that carries forward to future tax years indefinitely.
Is tax-loss harvesting worth doing in a small taxable account?
It scales with your account size and your marginal tax bracket, since the dollar benefit is proportional to both. For a small taxable account, the savings might be modest in any single year, but a disciplined habit of checking for harvestable losses during down markets adds up over a multi-decade investing career, and the mechanics don't get more complicated just because the dollar amounts are smaller.
Ready to see your full financial picture?
Try Pro free for 30 days. No bank login required. No credit card.
Create your free dashboard