Tax-Loss Harvesting Explained
Tax-loss harvesting means selling losing positions to offset capital gains and reduce your tax bill. Learn how it works, the wash-sale rule, and common mistakes to avoid.
Tax-Loss Harvesting Turns a Losing Position Into a Tax Benefit
Tax-loss harvesting is the practice of selling an investment that has lost value in order to realize (or "harvest") a capital loss, which can then offset capital gains elsewhere in your portfolio and reduce your taxable income. It doesn't make a losing trade a winning one, but it recovers some value from a position that didn't work out — turning an otherwise pure loss into a partial tax benefit.
This applies in taxable brokerage accounts. It does not apply to tax-advantaged accounts like 401(k)s or IRAs, since gains and losses inside those accounts aren't taxed on an ongoing basis.
How the Mechanics Work
- You hold a position that has an unrealized loss (current value below your cost basis)
- You sell it, converting the unrealized loss into a realized capital loss
- That realized loss is first used to offset any realized capital gains you have elsewhere in the same tax year
- If losses exceed gains, in the U.S. up to $3,000 of the excess can offset ordinary income per year, with any remainder carried forward to future tax years indefinitely
A Simple Example
| Position | Outcome | Realized Gain/Loss |
|---|---|---|
| Stock A | Sold at a profit | +$8,000 |
| Stock B | Sold at a loss (harvested) | -$5,000 |
| Net taxable capital gain | $3,000 |
Without harvesting the loss in Stock B, the full $8,000 gain would be taxable. By realizing the loss, taxable capital gains drop to $3,000 — the loss directly reduced the tax bill for the year.
Short-Term vs Long-Term Gains and Losses
Tax treatment differs based on how long a position was held (in the U.S., the threshold is one year):
- Short-term gains/losses (held ≤ 1 year) are typically taxed at ordinary income rates, which are usually higher
- Long-term gains/losses (held > 1 year) typically receive preferential, lower tax rates
Short-term losses offset short-term gains first, and long-term losses offset long-term gains first, before any excess crosses over to offset the other category. This means a short-term loss is often more valuable to harvest than a long-term loss of the same dollar size, because it's more likely to be offsetting a gain taxed at a higher rate. Tax rules vary by jurisdiction — this reflects general U.S. federal treatment, and the specifics should be confirmed with a tax professional for your situation.
The Wash-Sale Rule: The Biggest Trap
The wash-sale rule disallows the tax loss if you buy the same security, or one the IRS considers "substantially identical," within 30 days before or after the sale — a 61-day window in total. If triggered, the loss is disallowed for the current tax year and instead added to the cost basis of the repurchased shares, deferring rather than eliminating the benefit.
This rule exists specifically to prevent the naive version of this strategy: selling a stock at a loss for the tax benefit and immediately buying it back to maintain the exact same position.
How Traders Work Around It Without Losing Market Exposure
A common approach is to sell the losing position and simultaneously buy a similar (but not "substantially identical") security to maintain market exposure during the 30-day window — for example, selling one large-cap tech ETF and buying a different large-cap tech ETF that tracks a similar but distinct index. This preserves the loss for tax purposes while avoiding a meaningful gap in market exposure.
| Action | Wash-Sale Risk |
|---|---|
| Sell Stock X, buy back Stock X within 30 days | Triggers wash sale |
| Sell Stock X, buy a call option on Stock X within 30 days | Can trigger wash sale (options on the same underlying count) |
| Sell ETF tracking Index A, buy a different ETF tracking a similar but distinct Index B | Generally does not trigger wash sale, though it depends on how similar the funds are |
| Sell Stock X, wait 31+ days, then buy back | Does not trigger wash sale |
Common Mistakes
Harvesting Losses in Tax-Advantaged Accounts
Selling at a loss inside an IRA or 401(k) provides no tax benefit, since those accounts aren't taxed on realized gains and losses year to year. Harvesting only makes sense in taxable accounts.
Triggering a Wash Sale Across Accounts
The wash-sale rule applies across all of your accounts, including your spouse's accounts and IRAs, not just the account where the sale happened. Buying back the same stock in an IRA shortly after selling it at a loss in a taxable account still triggers a wash sale.
Letting Tax Strategy Drive Investment Decisions
Harvesting a loss is a tax optimization on a position you've already decided to exit or reduce — it shouldn't be the reason you sell a position you otherwise still believe in. Selling a fundamentally sound holding purely to harvest a small loss, and taking on wash-sale complexity and market-exposure risk to do it, is often not worth the tax benefit.
Ignoring Transaction Costs and Bid-Ask Spreads
For small positions, the tax benefit from harvesting a modest loss can be smaller than the trading costs incurred to sell and re-establish similar exposure. This matters less with commission-free trading but bid-ask spreads on less liquid securities are still a real cost.
When Tax-Loss Harvesting Is Most Valuable
- Late in the tax year, when you have a clearer picture of total realized gains and can harvest exactly enough losses to offset them
- In volatile years, when temporary drawdowns in otherwise sound long-term holdings create harvestable losses without requiring you to permanently exit a position (using the similar-but-not-identical substitute approach)
- When you have large realized gains elsewhere that would otherwise be taxed at a high rate
Summary
| Concept | Takeaway |
|---|---|
| Tax-loss harvesting | Selling a losing position to realize a capital loss that offsets capital gains |
| Applies to | Taxable brokerage accounts only, not IRAs/401(k)s |
| Wash-sale rule | Disallows the loss if you buy the same or substantially identical security within 30 days |
| Workaround | Swap into a similar but distinct security to preserve exposure |
| Biggest mistake | Letting tax optimization override sound investment decisions |
Tax-loss harvesting is a genuine, legal way to reduce the drag of taxes on portfolio returns, but it's a secondary optimization — it works best layered on top of decisions you'd already be making about position exits, not as the primary reason to sell.
This article is educational and not tax advice. Consult a tax professional for guidance specific to your situation and jurisdiction.
Related reading:
- Dollar-Cost Averaging vs Lump Sum Investing — another portfolio-level decision that interacts with tax timing
- Portfolio Diversification: How Many Stocks Is Enough? — building a portfolio structure that harvesting fits into
- Growth vs Value Investing: Which Wins Long-Term? — long-term holding strategies where tax treatment matters most
We're Cooking Something Great.
Revealing Soon.
TradeThesis is being rebuilt from the ground up. The 5-agent AI research pipeline is coming back sharper than before.
No sign-up needed. Just watch this space.