Tax-loss harvesting means selling an investment that's down, on purpose, so you can use the loss to lower your tax bill. It sounds like a trick, but it's a completely legal, IRS-sanctioned move available to anyone with a taxable brokerage account. The part most people get wrong isn't the concept, it's the wash sale rule, a 30-day trap that can quietly erase the entire deduction if you buy the same investment back too soon. Here's how the math actually works, and how to harvest a loss without accidentally throwing away the benefit.
What Tax-Loss Harvesting Actually Does
When you sell an investment for less than you paid, that's a capital loss. The IRS lets you use that loss in two ways: first, to cancel out capital gains you realized elsewhere in the same tax year, dollar for dollar, with no limit. Second, if your losses are bigger than your gains, up to $3,000 of the leftover loss can offset your ordinary income for the year ($1,500 if you're married filing separately). Anything left after that doesn't disappear, it carries forward to next year and keeps offsetting gains or income until it's used up.
This only works inside a taxable brokerage account. A loss inside an IRA or 401(k) has no tax value at all, because those accounts aren't taxed on gains or losses year to year in the first place. That's one of the real trade-offs between account types, the same tension our post on Roth IRA vs. Traditional IRA gets into when it comes to what each account actually shelters you from.
The Wash Sale Rule: The 30-Day Trap That Kills the Deduction
Here's the catch. The IRS doesn't let you sell an investment at a loss, claim the deduction, and then immediately buy the same thing right back, because that would let you keep your position while manufacturing a tax break out of nothing. The wash sale rule disallows the loss if you buy the same or a "substantially identical" security within 30 days before or after the sale, a 61-day window total counting the sale date itself.
If you trigger it, the loss isn't gone forever, but it is gone for now. It gets added to the cost basis of the shares you repurchased, meaning you'll eventually recapture some benefit when you sell those new shares, just not this year, and not on your terms. If you're trying to use a loss to offset a gain you realized this year, a wash sale means that gain stays fully taxable.
The practical fix is simple: if you want to stay invested in the same part of the market, sell the fund that's down and buy something similar but not identical. Selling a total U.S. stock market index fund and buying an S&P 500 fund instead keeps you invested in roughly the same exposure without being the same security, so the wash sale rule doesn't apply. Buying back the exact same fund you just sold, even from a different brokerage, does trigger it.
The Real Math: What a Harvested Loss Is Actually Worth
Say you sold some stock earlier this year and realized an $8,000 long-term capital gain. You're also holding an index fund position that's down, you bought $12,000 worth and it's now worth $7,000, a $5,000 unrealized loss. If you do nothing, you owe long-term capital gains tax on the full $8,000 gain. At the 15% rate that applies to most middle- and upper-middle-income filers, that's $1,200.
Now harvest the loss. You sell the fund, realize the $5,000 loss, and use it to offset the gain. Your taxable gain drops from $8,000 to $3,000. Tax owed drops from $1,200 to $450. You just saved $750, and you still have the $5,000 in cash to reinvest, ideally into a similar-but-not-identical fund so you're not sitting in cash and missing the market.
Now take a different case: no gains to offset at all, just a $5,000 loss sitting in a taxable account. You can still apply $3,000 of it against your ordinary income this year. If you're in the 24% federal bracket, that's a $720 reduction in your tax bill. The remaining $2,000 doesn't vanish, it carries forward and offsets next year's gains or income. Either way, the loss has real cash value, it just depends on what it's offsetting.
What This Doesn't Mean
Tax-loss harvesting isn't a reason to sell a good long-term holding just because it's temporarily down. The tax savings are real but usually modest relative to the value of staying invested through a downturn, especially the kind of broad-market, buy-and-hold approach our post on index funds for people who hate investing makes the case for. This is a tool for managing a taxable account you already hold, not a reason to trade more.
It also isn't free of complexity. Tracking cost basis, wash sale windows across multiple accounts (including your spouse's accounts and even your IRA, which counts too), and carryforward losses year over year is exactly the kind of bookkeeping that gets messy fast if you're doing it by hand across several brokerages. Most major brokerages now offer automated tax-loss harvesting inside their software for exactly this reason.
What to Actually Do With This
- Only harvest losses in taxable brokerage accounts. A loss inside an IRA or 401(k) has zero tax value, there's nothing to harvest there.
- Wait at least 31 days before repurchasing the same security if you want to keep the loss. If you want to stay invested immediately, buy something similar but not identical instead.
- Check your gains first. The dollar value of harvesting depends entirely on what you're offsetting, a capital gain, ordinary income up to $3,000, or a loss you're banking for a future year.
- Remember the IRA wash sale trap. Buying the same security in your IRA within the 30-day window still triggers a wash sale on a brokerage account sale, even though the two accounts are taxed completely differently.
- Don't let the tax tail wag the investing dog. A few hundred dollars in tax savings shouldn't override a sound long-term allocation you were planning to hold anyway.
Tax-loss harvesting isn't complicated once you see the mechanics, sell at a loss, use it against gains or income, avoid buying the same thing back too soon. The value is real money, not a rounding error, but only if you actually respect the 30-day window instead of finding out about it after the fact.
—
Spicy Investing