A concrete example of tax loss harvesting
Tax loss harvesting means selling an investment at a loss to offset gains you made elsewhere. Here is how it works in practice: You bought 100 shares of Stock A for $5,000 in January. By November, those shares are worth $3,500. You also own Stock B, which you bought for $2,000 and is now worth $4,000—a $2,000 gain. If you sell Stock B, you owe taxes on that $2,000 profit. But if you also sell Stock A, you lock in a $1,500 loss. That loss cancels out $1,500 of your $2,000 gain, so you only pay taxes on $500 instead of $2,000.
The mechanics are straightforward: you execute both sales in the same tax year, report both the loss and the gain on your tax return, and the loss reduces your taxable income. The IRS allows you to use losses to offset gains dollar-for-dollar. If your losses exceed your gains in a year, you can also deduct up to $3,000 of the excess loss against your ordinary income (like wages or salary), and carry any remaining loss forward to future years.
Key Takeaways
- You sell a losing investment to create a loss that cancels out a gain from a winning investment, reducing the taxes you owe on that gain.
- Losses offset gains first; if losses exceed gains, you can deduct up to $3,000 against ordinary income in the current year.
- You must wait 30 days before buying the same or substantially identical security again, or the loss is disallowed under the wash-sale rule.
- Tax loss harvesting only works if you have gains to offset or ordinary income to reduce—it creates no benefit in years when you have no gains and no income to shelter.
Why the wash-sale rule matters in this example
In the Stock A example above, you cannot simply buy Stock A back the next day. The wash-sale rule says that if you sell a security at a loss and buy the same or substantially identical security within 30 days before or after the sale, the loss is disallowed. The IRS treats the two transactions as a wash—no loss is recognized.
If you sold Stock A on November 15 at a $1,500 loss, you cannot buy Stock A again until December 16 (30 days later). If you buy it back on December 10, the entire $1,500 loss is erased, and you get no tax benefit. The cost basis of the new shares is adjusted upward to preserve the loss for the future, but you cannot use it this year. This rule exists to prevent people from selling and immediately repurchasing the same investment just to claim a loss without actually changing their portfolio.
What happens when losses exceed gains
Suppose you harvest $5,000 in losses but only have $2,000 in gains. The $2,000 gain is fully offset. You still have $3,000 in unused losses. You can deduct $3,000 of that against your ordinary income—wages, salary, interest, or other non-investment income. This reduces your taxable income for the year.
If you have $6,000 in losses and $2,000 in gains, you offset the gain and have $4,000 left over. You deduct $3,000 against ordinary income this year. The remaining $1,000 carries forward to next year, where it can offset gains or ordinary income again. You can carry forward losses indefinitely until they are used up, so no loss is ever truly wasted—it just may take multiple years to realize the benefit.
A multi-year example with carryforward losses
Year 1: You harvest $8,000 in losses. You have no gains that year. You deduct $3,000 against ordinary income. You carry forward $5,000 to Year 2.
Year 2: You harvest $2,000 in new losses and have $4,000 in gains. The $2,000 new loss plus $4,000 of your carryforward loss ($6,000 total) offset the $4,000 gain completely. You have $2,000 in losses left over ($6,000 used minus $4,000 gain). You deduct $2,000 against ordinary income. You carry forward $1,000 to Year 3 ($5,000 carryforward minus $4,000 used).
Year 3: You have $1,000 in carryforward losses and $1,500 in gains. The $1,000 loss offsets $1,000 of the gain. You pay taxes on $500 of gain. Your carryforward is now zero.
Tax loss harvesting with mutual funds and ETFs
The wash-sale rule applies to mutual funds and exchange-traded funds (ETFs) the same way it applies to individual stocks. If you own a fund that tracks the S&P 500 and you sell it at a loss, you cannot buy the same fund back within 30 days. However, you can buy a different S&P 500 fund—one with a different name, different expense ratio, or different holdings—and the wash-sale rule does not apply.
For example, you sell Vanguard's S&P 500 ETF (VOO) at a loss on November 15. You can buy iShares' S&P 500 ETF (IVV) on November 16 without triggering the wash-sale rule, because they are not substantially identical. Both track the same index, but they are different securities. This is a common strategy: harvest the loss, stay invested in the same market segment, and avoid the 30-day waiting period. You can switch back to the original fund after 30 days if you prefer.
When tax loss harvesting provides no benefit
Tax loss harvesting only reduces taxes if you have gains to offset or income to shelter. If you have no investment gains and your income is below the threshold where you owe federal income tax, harvesting losses does nothing for you in that year. The loss still carries forward, but it provides no immediate tax savings.
Similarly, if you are in a very low tax bracket or have no tax liability, the value of the deduction is minimal. A $3,000 deduction is worth $450 in taxes saved if your tax rate is 15%, but only $300 if your rate is 10%. The higher your tax bracket, the more valuable the loss. This is why tax loss harvesting is most useful for people with significant investment gains or high income in the current year.
Frequently Asked Questions
Can I harvest losses in a retirement account like a 401(k) or IRA?
No. Tax loss harvesting only works in taxable brokerage accounts. Retirement accounts are tax-deferred or tax-free, so losses inside them provide no tax benefit. You cannot harvest losses in a 401(k), traditional IRA, Roth IRA, or other may have access to retirement plan.
What counts as a substantially identical security under the wash-sale rule?
The IRS does not publish a precise definition, but generally, different funds tracking the same index are not substantially identical. A fund with a different name, different expense ratio, or different holdings is usually safe. Buying the same security under a different account or in a different form (like converting shares to ADRs) may still trigger the rule. When in doubt, consult a tax professional before buying a replacement security.
If I harvest a loss, do I have to report it to the IRS?
Yes. You report the sale on Schedule D (Capital Gains and Losses) when you file your tax return. Your brokerage sends you a Form 1099-B showing all sales for the year. The IRS matches this to your return, so the loss must be reported. Failing to report it can trigger an audit or penalty.
Can I use losses from one brokerage account to offset gains in another?
Yes. When you file your tax return, you report all capital gains and losses from all accounts on a single Schedule D. Losses from one brokerage offset gains from another. The wash-sale rule, however, applies across all your accounts—if you sell a security at a loss in one account and buy it in another within 30 days, the loss is still disallowed.
What if I sell at a loss and the stock price drops further after the sale?
You still get the loss deduction based on the price at which you sold. If you sold at $3,500 and it later drops to $2,000, you do not get an additional loss. The loss is locked in at the sale price. This is why timing matters: harvesting losses early in a decline can be valuable, but waiting too long means missing the opportunity if the price recovers.