Tax-loss harvesting is one of the few genuinely proactive tax strategies available to ordinary investors โ€” deliberately selling an investment at a loss specifically to generate a tax benefit, often while immediately reinvesting in something similar to maintain your overall market position.

How Losses Offset Gains

Capital losses first offset capital gains of the same type: short-term losses offset short-term gains, and long-term losses offset long-term gains. If you have an excess of one type after that first-pass matching, it then offsets the other type โ€” an excess short-term loss can offset a long-term gain, and vice versa. This matters because short-term gains are taxed at your ordinary income rate while long-term gains get the preferential 0/15/20% rates, so which type of gain you're offsetting affects how much tax benefit a given harvested loss actually delivers.

The $3,000 Annual Limit Against Ordinary Income

If your total capital losses for the year exceed your total capital gains, you can deduct up to $3,000 of the excess against your ordinary income ($1,500 if Married Filing Separately). Any remaining excess beyond that $3,000 doesn't disappear โ€” it carries forward indefinitely to future tax years, where it can offset future capital gains or, again, up to $3,000 of ordinary income per year until it's fully used up.

The Wash-Sale Rule: The Trap That Disqualifies a Loss

You cannot claim a loss on a security if you buy the same security, or one the IRS considers "substantially identical," within 30 days before or 30 days after the sale โ€” a 61-day window total. If you trigger a wash sale, the loss isn't lost entirely, but it's disallowed for the current year and instead added to the cost basis of the replacement shares you bought, deferring the benefit rather than eliminating it.

๐Ÿ’ก A common way to harvest a loss without triggering the wash-sale rule while staying invested in a similar asset: sell the losing position and immediately buy a similar-but-not-identical fund (a different S&P 500 index fund from a different provider, for example, rather than buying back the exact same fund), then optionally switch back to your original holding after the 30-day window closes if you prefer it.

Crypto: Currently Outside the Wash-Sale Rule

As covered in our cryptocurrency tax guide, digital assets are not currently subject to the wash-sale rule, since it technically applies to "stock or securities" and crypto has generally not been classified that way. This means you can sell crypto at a loss and immediately repurchase the same asset, claiming the loss right away while maintaining your position โ€” something the wash-sale rule specifically prevents for stocks. This has been a frequent target of proposed legislation to close the gap, so don't assume this distinction is permanent.

Year-End Timing

Tax-loss harvesting is most commonly done in the final weeks of the calendar year, once your realized gains and losses for the year are largely known, so you can strategically decide which additional losses (if any) are worth realizing to offset those gains. That said, harvesting can be done at any point during the year โ€” some investors harvest losses opportunistically whenever a holding dips significantly, rather than waiting until December.

A Worked Example

You have $8,000 in long-term capital gains from selling one stock at a profit this year, and a different stock position is down $12,000 from your purchase price. You sell the losing position, realizing a $12,000 long-term capital loss. That offsets your entire $8,000 gain, and $3,000 of the remaining $4,000 loss offsets your ordinary income this year. The final $1,000 carries forward to next year, available to offset future gains or another $1,000 of ordinary income (subject to the $3,000 annual cap applying to the total across whatever gains/losses arise that year, not a separate cap just for the carryforward amount).

Automated Harvesting

Many robo-advisors and some brokerages now offer automated tax-loss harvesting as a standing feature, continuously monitoring your taxable accounts for harvesting opportunities throughout the year rather than requiring you to manually watch positions and time trades yourself. This can capture more opportunities than manual, once-a-year harvesting, though it's typically only offered on taxable brokerage accounts of a certain minimum size and usually comes with an advisory fee โ€” weigh the added tax benefit against that cost before assuming automation is worth it for a smaller account.

Common Questions

Does tax-loss harvesting work inside a 401(k) or IRA? No โ€” the wash-sale rule and the entire concept of harvesting losses only applies to taxable brokerage accounts. Buying and selling inside a tax-advantaged retirement account has no current-year tax consequence either way, so there's nothing to harvest.

Can I harvest a loss and buy back the same stock in my spouse's account? No โ€” the wash-sale rule applies across accounts you or your spouse control, including a spouse's separate account or an IRA either of you owns, not just the account where the sale occurred.

Is there a limit to how many years I can carry forward an unused loss? No โ€” capital loss carryforwards continue indefinitely until fully used, with no expiration, as long as you keep filing returns that report them.

๐Ÿ’ก Once you know your net capital gain or loss for the year after any harvesting, run it through the Capital Gains preset to see your resulting tax.