Tax Loss Harvesting: How to Make Losing Money Work in Your Favor

Let’s be honest: very few people find joy in losing money. But what if losing money in one place could actually save you money somewhere else? That’s the peculiar magic of tax loss harvesting, a strategy that sounds like something a medieval wizard would do with a scythe and a spreadsheet, but is actually a perfectly legal way to reduce your tax bill. Welcome to one of the rare occasions where the IRS, however reluctantly, gives you something back.

So What Exactly Is Tax Loss Harvesting?

Tax loss harvesting is the practice of selling investments that have declined in value to realize a capital loss, which you can then use to offset capital gains you have earned elsewhere in your portfolio. In plain English: you sell your losers to cancel out the tax liability from your winners.

Say you sold shares of a high-flying tech company this year and made a $10,000 profit. Congratulations! Unfortunately, the IRS would like their cut of that. But if you also happen to be holding shares of, say, a promising renewable energy company that has spent the year falling off a cliff, you can sell those shares at a loss. If that loss is $10,000, your net capital gains are now zero, and your capital gains tax bill is nothing. This is the core idea: turn lemons into a tax deduction.

And it gets better. If your capital losses exceed your capital gains in a given year, you can use up to $3,000 of that excess loss to offset ordinary income (like your salary). Any losses beyond that can be carried forward into future tax years indefinitely. The IRS giveth, and then it giveth again, just more slowly.

Why Would Anyone Want to Do This?

The short answer is: to keep more of your money. Capital gains taxes can be significant. Long-term capital gains (on assets held more than one year) are taxed at 0%, 15%, or 20% depending on your income level. Short-term capital gains (assets held one year or less) are taxed as ordinary income, which could mean a rate as high as 37% for high earners. If you are in the 37% ordinary income bracket and you can offset $50,000 in short-term gains, you have just saved yourself up to $18,500 in taxes. That is not a rounding error. That is a very nice vacation, or several years of coffee.

Tax loss harvesting is also valuable as a portfolio management tool. It gives you a disciplined reason to prune underperforming positions that you might otherwise hold onto out of inertia or misplaced emotional attachment. Yes, people do get emotionally attached to stocks. It’s not healthy, but it happens.

The Wash Sale Rule: The IRS Closes the Obvious Loophole

Now, you might be thinking: this sounds almost too good. Can I just sell my declining stock, claim the loss, and then immediately buy it back so I still own it? Congratulations, you have just independently invented the scheme the IRS specifically designed a rule to prevent.

The wash sale rule, established under Internal Revenue Code Section 1091, states that if you sell a security at a loss and then purchase the same or a substantially identical security within 30 days before or after the sale, your loss is disallowed for tax purposes. Note the crucial phrase: 30 days before OR after. The window is actually 61 days total, centered on the date of the sale. The IRS did not just close the obvious loophole; they put a fence around it and added a moat.

The disallowed loss does not disappear entirely, it gets added to the cost basis of the replacement security, which means you may eventually recapture it when you sell that security later. But for the current tax year, you are out of luck if you trigger the wash sale rule.

The phrase “substantially identical” is where things get interesting and occasionally frustrating. The IRS has not provided an exhaustive definition, which means tax professionals spend considerable time debating the edges. What is clear: selling one share class of a stock and buying another share class of the same company is likely a wash sale. Selling a mutual fund and buying an ETF that tracks the identical index is also likely a wash sale. Selling a stock and buying a different company in the same industry, however, is generally considered acceptable.

One important and often overlooked wrinkle: the wash sale rule applies across all of your accounts. If you sell a stock at a loss in your taxable brokerage account and then buy the same stock in your IRA within the 61-day window, the loss is disallowed and, worse, you cannot add it back to the cost basis inside the IRA since that account operates under different tax rules. You simply lose the deduction entirely. This is not a trap set for the unwary, except that it absolutely is.

Other Caveats Worth Knowing Before You Start Selling Everything

Short-term versus long-term losses: Not all losses are created equal in the eyes of the tax code. Short-term losses first offset short-term gains (taxed at ordinary income rates), and long-term losses first offset long-term gains (taxed at the lower preferential rates). Ideally, you want to use short-term losses to offset short-term gains, since that produces the greatest tax savings. The mechanics of netting can get complicated when you have a mix of gains and losses of different types, so it pays to model this out before acting.

State taxes: Some states do not conform to federal capital gains tax treatment, or have their own rules about loss carryforwards. Residents of high-tax states like California need to be especially attentive here, since the state may not allow the same deductions as the federal government.

The Alternative Minimum Tax (AMT): High earners subject to the AMT may find that some of the tax benefits from harvesting losses are reduced or eliminated under that parallel tax system. If you are in AMT territory, consult a tax professional before assuming the math works the way you expect.

Tax deferral, not tax elimination: This is a critically important conceptual point. In most cases, tax loss harvesting defers your tax liability rather than eliminating it. When you sell at a loss and rebuy a similar asset, your new cost basis is lower, which means future gains will be larger and taxed accordingly. The strategy is most powerful when the deferral is very long (decades), when you are in a lower tax bracket later in life, or when the deferred amount passes to heirs who receive a step-up in cost basis at death. For investors with a short time horizon, the benefit can be minimal or even counterproductive.

Record keeping: The IRS expects you to be able to document every lot of every security you have ever purchased, at what price, and when. If your brokerage does not automatically track cost basis for you, this becomes a serious administrative undertaking. Losing track of your cost basis is how people end up paying taxes on gains they technically never realized. Organized record keeping is not glamorous, but neither is a surprise tax bill.

When Tax Loss Harvesting Makes Sense

Tax loss harvesting works best in specific circumstances. You have significant capital gains in a taxable account in the same year, whether from active trading, rebalancing, or selling property. You are in a high marginal tax bracket, meaning each dollar of capital gains costs you more in taxes and each dollar of losses saves you more. You have a long investment time horizon, which maximizes the value of deferring taxes into the future. You have unrealized losses sitting in your portfolio that are not serving any current purpose. And you have the discipline to manage the wash sale rule carefully, either manually or through an automated service.

Investors who hold diversified portfolios with many individual securities will find more frequent and more substantial harvesting opportunities than those who hold a handful of broad index funds. Volatility is actually your friend here: the more the market gyrates, the more chances you have to harvest losses at various points throughout the year, not just in December when everyone else remembers this strategy exists. However, this is not an invitation to start investing in individual stocks, just so you can hope for a loss to harvest!

When Tax Loss Harvesting Does Not Make Sense

The strategy is considerably less useful in several situations. If you are in the 0% long-term capital gains bracket (which applies to single filers with taxable income below roughly $48,350 or married filing jointly with taxable income up to $96,700 in 2025), you may have no tax liability to offset in the first place. Harvesting losses when you owe nothing is like using a coupon at a store that is giving everything away for free.

Tax-advantaged accounts such as IRAs, 401(k)s, and Roth IRAs are not eligible for tax loss harvesting. Since gains and losses inside these accounts are already sheltered from current taxation, selling at a loss provides no deductible benefit. Do not waste your time harvesting losses in accounts where the harvest goes directly into the compost with no tax benefit.

If you expect to be in a significantly higher tax bracket in future years, deferring gains could actually cost you more over time. The math of tax deferral assumes your future rate will be equal to or lower than your current rate. If you are early in your career and expect substantial income growth, this assumption may not hold.

Finally, if the transaction costs and complexity of the strategy exceed the tax benefit, the whole exercise is not worth it. For small portfolios with modest gains, the incremental benefit can be quite small, especially after accounting for the time spent managing wash sale windows and maintaining detailed records.

The Bottom Line

Tax loss harvesting is a legitimate, well-established strategy that can meaningfully improve after-tax investment returns for the right investor in the right situation. It is not a loophole or a trick; it is a feature of the tax code that rewards investors who pay attention. That said, it requires care, discipline, and a clear-eyed understanding of the wash sale rule and its many edge cases.

The best approach is to treat tax loss harvesting as one tool in a broader tax-aware investing strategy, not as an end in itself. Never let the tax tail wag the investment dog. Selling a good long-term investment at a temporary loss just to capture a deduction, and then watching it double in value during your 30-day waiting period, is a special kind of frustration that no tax savings can fully compensate for.

As always, consult a qualified tax advisor or financial planner before implementing any of this. Tax law changes frequently, individual circumstances vary enormously, and this article, entertaining as it hopefully has been, is not a substitute for professional advice. The IRS is not known for its sense of humor, and neither are its penalties.