
Tax-Loss Harvesting
GPF 204 · Tax Strategy
Tax-loss harvesting uses investment losses in taxable accounts to offset gains and sometimes ordinary income. This lesson explains how harvesting works, the wash sale rule, and when the strategy is useful.
Key terms
Net Capital Gain = Capital Gains − Capital LossesTax Avoided ≈ Offset Gain × Capital Gains Tax RateFuture Capital Gain = Future Sale Price − New Cost BasisLearning objectives
- Explain how tax-loss harvesting can offset capital gains.
- Calculate net capital gain after applying a realized loss.
- Identify wash sale risks and practical safeguards.
Tax-loss harvesting is the strategy of selling an investment at a loss in a taxable account so the loss can offset capital gains and potentially a limited amount of ordinary income. It can improve after-tax returns, but it must be done carefully and only applies to taxable accounts, not most retirement accounts.
What Tax-Loss Harvesting Does
Investments do not always rise smoothly. In a taxable brokerage account, a temporary decline can create a tax planning opportunity. If you sell an investment for less than your cost basis, you realize a capital loss. That loss may reduce taxable gains from other investments.
The basic formula is:
If losses equal gains, the net gain may be zero. If losses exceed gains, a limited amount may be deductible against ordinary income, and unused losses may carry forward under tax rules.
Tax-loss harvesting does not make a bad investment good. It simply uses the tax code to reduce the tax drag from losses that already happened.
| Situation | Tax Result |
|---|---|
| $5,000 gain and no losses | $5,000 taxable gain |
| $5,000 gain and $5,000 loss | $0 net capital gain |
| $2,000 gain and $5,000 loss | Gain offset plus possible remaining loss treatment |
Required Worked Example: $5,000 Loss Offsets $5,000 Gain
Suppose you sell Fund A for a $5,000 long-term capital gain. You also own Fund B, which has fallen below your purchase price. If you sell Fund B and realize a $5,000 loss, the loss can offset the gain.
| Transaction | Amount |
|---|---|
| Fund A realized gain | $5,000 |
| Fund B realized loss | -$5,000 |
| Net capital gain | $0 |
The math is:
\5,000 - $5,000 = $0$
If your long-term capital gains tax rate would have been 15%, the avoided federal tax on the $5,000 gain is:
\5,000 \times 0.15 = $750$
This is a simplified example. State taxes, income thresholds, and investment details can change the result.
Staying Invested After Harvesting
The point of tax-loss harvesting is usually not to exit the market. If you sell an investment at a loss and sit in cash, you might miss a recovery. Many investors replace the sold investment with a similar but not substantially identical investment to maintain market exposure.
For example, if you sell one broad U.S. stock market ETF at a loss, you might buy a different broad U.S. stock fund that tracks a different index. The replacement should keep your portfolio aligned without violating wash sale rules.
The wash sale rule
The wash sale rule generally disallows a loss if you sell an investment at a loss and buy the same or a substantially identical investment within a 61-day window: 30 days before the sale, the sale day, and 30 days after.
| Action | Possible Issue |
|---|---|
| Sell Fund A at a loss and immediately rebuy Fund A | Likely wash sale problem |
| Sell Fund A and buy a substantially identical fund | Possible wash sale problem |
| Sell Fund A and buy a different fund tracking a different index | Often used to maintain exposure |
| Sell in taxable account and rebuy in IRA | Can still create wash sale concerns |
The wash sale rule is one reason tax-loss harvesting requires careful tracking. Automated dividend reinvestment can also accidentally create replacement purchases.
When Tax-Loss Harvesting Helps Most
Tax-loss harvesting is most useful in taxable brokerage accounts with investments that have declined below cost basis. It may help investors who have capital gains, concentrated positions, rebalancing needs, or high taxable income.
It may be useful when:
- You have realized capital gains this year.
- You need to rebalance a taxable portfolio.
- Markets have fallen and some holdings are below basis.
- You can switch to a suitable replacement investment.
- You understand the wash sale rule.
- Transaction costs are low.
It may be less useful when:
- All investing is inside retirement accounts.
- You have no taxable gains and little taxable income benefit.
- Selling creates portfolio confusion.
- The replacement investment changes your risk too much.
- You might violate wash sale rules.
Tax-loss harvesting is not tax avoidance forever
Harvesting can lower taxes now, but it may also reduce your cost basis in the replacement investment. That can increase future gains if the investment rises. This is still valuable because deferring taxes can be useful, but it is not magic.
For example, if you sell a fund at $8,000 after buying it for $10,000, you harvest a $2,000 loss. If you buy a replacement at $8,000 and later sell it for $12,000, your future gain is:
\12,000 - $8,000 = $4,000$
You received a tax benefit earlier, but future gains still matter.
Practical Harvesting Checklist
Use this checklist before harvesting:
- Confirm the investment is in a taxable account.
- Identify the cost basis and unrealized loss.
- Check realized gains for the year.
- Choose a replacement investment before selling.
- Review wash sale risk across all accounts.
- Turn off automatic reinvestment if needed.
- Keep records of sale, loss, and replacement.
- Make sure the move still fits your investment plan.
Tax-loss harvesting should support the portfolio, not drive it. Do not sell a good long-term investment solely for a small tax benefit if the replacement is worse or the process creates confusion.
Common Mistakes
Avoid these mistakes:
- Trying to harvest losses inside a 401(k) or IRA, where capital gains rules generally do not apply.
- Rebuying the same investment too soon.
- Forgetting that spouse or IRA transactions may matter.
- Letting taxes override investment quality.
- Ignoring state taxes.
- Assuming all losses are immediately fully deductible.
Tax-loss harvesting is a useful intermediate strategy, but beginners should first focus on saving, investing consistently, using tax-advantaged accounts, and keeping costs low.
Key Takeaways
- Tax-loss harvesting uses realized losses in taxable accounts to offset capital gains.
- A $5,000 loss can offset a $5,000 gain, creating $0 net capital gain in a simplified example.
- The wash sale rule can disallow a loss if you buy the same or substantially identical investment too soon.
- Harvesting should usually maintain market exposure through a suitable replacement investment.
- This strategy is useful, but it should not override a sound long-term investment plan.
Sign in to track your progress.
Ask your AI guide
Ask anything about Taxes & Tax Planning — Tax-Loss Harvesting, or choose a suggested question below.
Finance chat is for educational purposes only and does not constitute financial advice. Press Enter to send, Shift+Enter for new line.