Every investor eventually owns a position that loses value, and while nobody enjoys watching a holding drop, that decline can be turned into a genuine tax benefit. Tax-loss harvesting is one of the few strategies that lets you extract value from a losing investment without changing your long-term financial plan. Understanding the mechanics, and the rules that limit abuse, helps you use it correctly instead of accidentally disqualifying the deduction.
What Tax-Loss Harvesting Actually Means
Tax-loss harvesting is the practice of selling an investment at a loss in a taxable brokerage account, then using that loss to offset capital gains elsewhere in your portfolio or, within limits, your ordinary income. The loss is “realized” the moment you sell, which is what makes it usable on your tax return. Unrealized losses sitting in a portfolio you haven’t sold provide no tax benefit at all.
This strategy only applies to taxable accounts. Losses inside a 401(k), traditional IRA, or Roth IRA have no tax consequence because those accounts are already tax-advantaged, so there’s nothing to harvest.
How the Offset Actually Works
Once you sell an investment at a loss, the loss first offsets capital gains of the same type in the same tax year. Short-term losses offset short-term gains, and long-term losses offset long-term gains, before any leftover amount crosses over to the other category.
- Short-term losses offset short-term gains first
- Remaining short-term losses offset long-term gains
- Long-term losses offset long-term gains first, then short-term gains
- If losses exceed all capital gains, up to $3,000 per year ($1,500 if married filing separately) can offset ordinary income
- Any loss beyond that annual limit carries forward indefinitely to future tax years
That carryforward feature matters more than people realize. A large loss harvested during a market downturn can keep reducing your tax bill for years afterward, even if markets recover quickly.
The Wash-Sale Rule
The IRS does not allow you to sell an investment for a loss and then immediately buy it back to manufacture a tax deduction while keeping your market exposure unchanged. This is called the wash-sale rule, and violating it disallows the loss for tax purposes.
The rule blocks the loss 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 in total. This applies across all your accounts, including your spouse’s accounts and even your IRA, not just the account where the sale occurred.
| Wash-Sale Scenario | Loss Allowed? |
|---|---|
| Sell fund at a loss, buy the identical fund 10 days later | No |
| Sell fund at a loss, buy a similar but not identical fund in the same category | Usually yes |
| Sell stock at a loss in a taxable account, buy it back in your IRA within 30 days | No |
| Sell fund at a loss, wait 31+ days before repurchasing | Yes |
Avoiding a Wash Sale While Staying Invested
Most investors don’t want to sit in cash for a month just to harvest a loss, since that risks missing a rebound. The common workaround is swapping into a similar but not “substantially identical” fund immediately after selling.
- Sell a total US stock market index fund, buy a different provider’s total market fund
- Sell an S&P 500 ETF, buy a total market or extended market ETF instead
- Sell an individual stock, buy a sector ETF that holds it among many others
- Wait at least 31 days before repurchasing the original security if you want to return to it exactly
This keeps your portfolio’s overall risk exposure roughly intact while the loss remains deductible.
Beyond Individual Sales: Ongoing Harvesting
Some investors harvest losses opportunistically only during sharp downturns, while others harvest continuously throughout the year whenever an individual lot dips below its purchase price. Robo-advisors and some brokerage platforms now offer automated tax-loss harvesting that scans for opportunities daily.
Continuous harvesting tends to generate more cumulative losses over time, especially in volatile markets, but it also adds complexity to your cost-basis tracking. Specific-lot identification, where you choose exactly which purchase lots to sell rather than using average cost, is essential for precise harvesting.
Record-Keeping and Cost Basis
Accurate records matter enormously here. Your brokerage typically reports cost basis to the IRS on Form 1099-B, but if you’ve transferred assets between brokers or hold older positions, basis information can be incomplete. Keep your own records of purchase dates, prices, and any wash-sale adjustments so you can verify what your broker reports.
Frequently Asked Questions
Does tax-loss harvesting work in a 401(k) or IRA?
No. Because those accounts already grow tax-deferred or tax-free, losses inside them have no tax consequence and cannot be harvested.
How much can I deduct against ordinary income each year?
Up to $3,000 per year ($1,500 if married filing separately) after offsetting all capital gains. Excess losses carry forward to future years indefinitely.
Is tax-loss harvesting worth it for small losses?
It can still be worthwhile since losses carry forward, but the benefit scales with your tax bracket and the size of the loss. For very small amounts, transaction costs and complexity may outweigh the benefit.
Can I harvest a loss and buy back the same stock the next day?
No, doing so within 30 days triggers the wash-sale rule and disallows the loss. You would need to wait at least 31 days or purchase a different, non-identical investment.
Final Thoughts
Tax-loss harvesting is a legitimate way to turn market volatility into a real financial benefit, but it only works if you respect the wash-sale rule and keep clean records. This article is for general education only and is not personalized tax or legal advice; consult a qualified tax professional to see how harvesting fits your specific situation before making trades based on tax considerations.
By XWealth Hub Editorial · Updated July 10, 2026
- tax-loss harvesting
- wash-sale rule
- capital gains tax
- investment taxes
- tax planning