If your investment portfolio has positions that are currently worth less than you paid for them, those losses have a hidden value: they can offset capital gains elsewhere in your portfolio and reduce your federal tax bill. This strategy is called tax-loss harvesting, and it is one of the few ways investors can actively reduce taxes within a taxable brokerage account.
What Is Tax-Loss Harvesting?
Tax-loss harvesting means selling an investment that has declined in value to realize a capital loss. That loss can then be used to offset capital gains you have realized -- or up to $3,000 of ordinary income per year if your losses exceed your gains. Losses that exceed the annual limit carry forward to future tax years indefinitely.
The key mechanic: capital losses first offset capital gains of the same type (short-term losses offset short-term gains, long-term losses offset long-term gains), then cross-offset. Any remaining net loss after all gains are eliminated offsets up to $3,000 of ordinary income.
A Worked Example
Suppose you have the following activity in a taxable brokerage account in 2026:
- Sold Stock A for a $8,000 long-term gain
- Sold Stock B for a $3,000 short-term gain
- Stock C is sitting at a $7,000 unrealized loss
Without harvesting, you owe tax on $11,000 of gains. If you sell Stock C before December 31 to realize the $7,000 loss:
- $7,000 loss offsets $7,000 of gains (long-term first: $8,000 - $7,000 = $1,000 long-term gain remaining)
- You now owe tax on $1,000 long-term gain + $3,000 short-term gain = $4,000 total
- At a 15% long-term rate and 22% short-term rate, you have saved roughly $1,050 in tax compared to the no-harvest scenario
The Wash-Sale Rule -- The Critical Trap
The IRS wash-sale rule (IRC Section 1091) disallows a loss if you buy a "substantially identical" security within 30 days before or after the sale. The 61-day window (30 days before sale + sale date + 30 days after) is strict. If you trigger a wash sale, the disallowed loss is added to the cost basis of the replacement shares -- you do not lose it permanently, but you do lose the timing benefit.
What counts as substantially identical? The same stock or fund. Switching from a mutual fund to an ETF tracking the same index is generally treated similarly. Most tax advisors treat two funds tracking the same index from different providers as acceptable substitutes, though the IRS has not published definitive guidance.
When Tax-Loss Harvesting Makes Sense
The strategy is most valuable when:
- You have realized capital gains elsewhere in the portfolio that year
- You are in a higher tax bracket (22% or above for ordinary income, 15% or above for long-term gains)
- The position can be replaced with a similar but not substantially identical investment to maintain your target allocation
- Transaction costs are low (most major brokers have eliminated per-trade commissions)
It makes less sense if you are in the 0% capital gains bracket (taxable income below $48,350 for single filers in 2026), if the loss is small and you would need to stay out of the position for 31 days in a rising market, or if the investment is inside a tax-advantaged account (losses in IRAs and 401(k)s do not generate deductible losses).
Practical Year-End Checklist
- Review your taxable accounts for unrealized losses in November and early December
- Identify offsetting gains already realized that year
- Check the 30-day window -- did you buy the same position recently?
- Identify a replacement security that maintains your allocation without triggering wash-sale rules
- Confirm the trade settles before December 31 (most brokers require trades placed by December 29 or 30)
Use the capital gains tax calculator to estimate your current-year gain exposure and see how harvested losses would change your bill. For more on how long-term and short-term rates differ, see the 2025 capital gains tax rates guide.
Source
IRS Publication 550 (Investment Income and Expenses); IRS Topic No. 409 (Capital Gains and Losses); IRC Section 1091 (Wash Sales).