MarklyFinance
    Taxes

    Tax-Loss Harvesting: How to Reduce Your Tax Bill

    Tax-loss harvesting turns market downturns into tax savings by selling losing investments to offset gains. Here's how it works — and the rules that trip up investors who get it wrong.

    James MitchellJames Mitchell · Updated 2026-08-28 · 12 min read
    Tax-loss harvesting concept with green downward chart and a tax reduction symbol over navy background

    What Is Tax-Loss Harvesting?

    Tax-loss harvesting is the practice of selling investments at a loss to offset capital gains and reduce your tax bill. When you sell an investment for less than you paid, you realize a capital loss. These losses can offset capital gains dollar-for-dollar, and up to $3,000 of ordinary income per year, reducing the taxes you owe.

    The strategy is powerful because it turns an unpleasant event — watching an investment fall — into a tangible tax benefit. Rather than holding a losing position and hoping it recovers, you sell it, bank the loss for tax purposes, and reinvest the proceeds in a similar (but not "substantially identical") investment to stay invested and capture the recovery.

    Tax-loss harvesting is most valuable in taxable brokerage accounts. Losses in tax-advantaged accounts like IRAs and 401(k)s have no tax benefit, since those accounts are tax-deferred or tax-free. Always harvest losses only in taxable accounts.

    The long-term payoff is meaningful. A study by Vanguard estimated that systematic tax-loss harvesting can add roughly 0.5% to 1% of after-tax return per year for taxable investors — a meaningful edge compounded over decades. Over a 30-year investing lifetime, that can translate into tens of thousands of dollars in extra wealth, simply for selling losing positions you were probably going to sell eventually anyway.

    How It Works

    The mechanics are straightforward. Consider a simple example. You hold two investments in a taxable account: Investment A has a $10,000 unrealized gain; Investment B has an $8,000 unrealized loss. If you sell Investment A to realize the gain, you owe capital gains tax on $10,000. But if you also sell Investment B to realize the $8,000 loss, the loss offsets $8,000 of the gain — you're taxed on only $2,000 of net gains, a dramatic reduction.

    This works for both short-term and long-term losses and gains, though with a hierarchy: short-term losses offset short-term gains first, long-term losses offset long-term gains first, then any remaining net losses offset the other type. The matching matters because short-term gains are taxed at higher ordinary rates, so using short-term losses against them is most valuable.

    After harvesting the loss, you reinvest the proceeds. The goal is to stay invested so you participate in the market's recovery, while keeping your allocation roughly intact. The key constraint — and the rule that trips up most investors — is the wash-sale rule.

    The Wash-Sale Rule

    The wash-sale rule prevents you from claiming a loss if you buy the same or a "substantially identical" security within 30 days before or after the sale — a 61-day window in total. If you violate the wash-sale rule, the loss is disallowed and added to the cost basis of the replacement shares, effectively deferring the loss rather than eliminating it.

    The rule applies to you, your spouse, and (for some accounts) your controlled entities. It applies across all your accounts, including IRAs and 401(k)s in some cases. The practical effect: you cannot simply sell a stock at a loss and immediately buy it back to claim the loss.

    How to stay invested without triggering a wash sale:

    • Buy a similar but not identical fund. If you sold an S&P 500 fund, buy a total market fund or a different S&P 500 fund from another provider. These are similar but not "substantially identical," so the wash-sale rule generally doesn't apply. Wait 31 days, then switch back if desired.
    • Wait 31 days. Simply wait out the 30-day window before repurchasing the same security. The risk is that the market rises during the wait, costing you the recovery.
    • Use a different asset class temporarily. Buy a bond fund or a different stock sector for the waiting period, then switch back.

    The IRS has not precisely defined "substantially identical," but it generally means the same security or one that is economically equivalent (e.g., the same stock, or the same options contract). Different index funds tracking similar but not identical indexes are usually considered not substantially identical, though the IRS could challenge aggressive strategies. When in doubt, consult a tax professional. See our capital gains tax guide for how harvesting fits into the broader capital gains picture.

    The $3,000 Annual Limit

    Capital losses first offset capital gains of the same type (short or long), then the other type. If your total losses exceed your total gains, you have a net capital loss. You can use up to $3,000 ($1,500 if married filing separately) of net capital loss to offset ordinary income each year.

    Any remaining net loss above $3,000 is carried forward to future years indefinitely. There's no expiration on the carryforward — you can apply $3,000 per year against ordinary income until the loss is exhausted, while using any remaining losses to offset future capital gains in full.

    A worked example: you harvest $20,000 of losses this year and have $5,000 of capital gains. The $20,000 loss offsets the $5,000 of gains, leaving $15,000 of net loss. You apply $3,000 against this year's ordinary income, and carry forward $12,000 to next year. Next year, you can offset up to $3,000 of ordinary income again, plus any future gains, until the $12,000 is used. Use our capital gains tax calculator to model your own situation.

    This carryforward is why tax-loss harvesting is valuable even in years when you have no gains — the losses become a future tax asset you can deploy whenever you do realize gains. Many investors build up a "loss bank" during bear markets and draw it down for years afterward.

    Best Practices

    Harvest losses opportunistically. Market downturns, sector rotations, and individual losers all create opportunities. Review your taxable account during down periods and at year-end. The best time to harvest is when the market has fallen broadly, because almost every position will show a loss, giving you maximum flexibility.

    Mind your asset location. Only harvest in taxable accounts; losses in IRAs and 401(k)s provide no tax benefit. If you hold the same fund in both a taxable and tax-advantaged account, be careful — selling at a loss in the taxable account while the tax-advantaged account buys the same fund within 30 days can trigger the wash-sale rule and permanently disallow the loss.

    Don't let the tax tail wag the investment dog. Harvesting a loss on a fund you still believe in is fine (and you can rebuy a similar fund); selling a quality long-term holding permanently just for a tax loss may be unwise. Stay invested.

    Replace with a similar but not identical fund. Keep your allocation roughly intact by buying a comparable fund during the wash-sale window, so you don't miss a recovery. For example, swap an S&P 500 fund for a total stock market fund, or a total international fund for a developed-markets fund.

    Track your carryforwards. Your broker reports realized gains and losses on Form 1099-B each year, and your tax software tracks carryforwards. Keep prior-year tax returns to substantiate carryforwards — the IRS doesn't send you a statement of your remaining loss balance.

    Coordinate with rebalancing. Year-end rebalancing is a natural time to harvest losses — selling losers to rebalance and bank the tax benefit simultaneously. This turns a routine portfolio maintenance task into a tax-saving opportunity.

    Consider transaction costs. Frequent harvesting can generate trading costs and bid-ask spreads; weigh the tax benefit against the cost. For most index fund investors, costs are negligible at commission-free brokers.

    When Not to Harvest Losses

    Tax-loss harvesting is not always the right move.

    In tax-advantaged accounts, it provides no benefit — don't bother. When you have no taxable account, there's nothing to harvest. When you'd exit a great long-term holding permanently, the investment merits may outweigh the tax benefit. When the wash-sale rule would force an unfavorable replacement, and you can't find a suitable substitute, the cost may exceed the benefit. When you expect to need the loss offset soon, remember the $3,000 limit and the carryforward mechanic — plan multi-year.

    For most taxable-account investors with broad index funds, harvesting losses during downturns is nearly always worthwhile, because you can replace the sold fund with a similar one and stay invested. The tax benefit is essentially free money.

    Advanced Harvesting Strategies

    Beyond the basics, several advanced techniques can increase the value of loss harvesting.

    Direct indexing — rather than holding an index fund, you hold the individual stocks that make up the index. This lets you harvest losses on individual stocks that fall, even when the index as a whole is up. Studies suggest direct indexing can add 1% to 2% per year in after-tax return for large accounts, though it requires more capital and complexity.

    Tax-loss harvesting with ETFs — ETFs are particularly well-suited to harvesting because there are often multiple ETFs tracking similar indexes from different providers, making it easy to find a non-substantially-identical replacement.

    Pair harvesting — if you hold both a fund and a similar fund from a different provider, you can alternate between them, harvesting losses in whichever is down without ever leaving the asset class.

    Loss harvesting in down years without gains — even if you have no gains this year, harvesting still banks the $3,000 ordinary income offset and builds a carryforward for future gains. Over a long investing career, you'll eventually realize gains (rebalancing, withdrawals, etc.), and a banked loss offsets them tax-free.

    A Real-World Example

    Consider an investor with a $500,000 taxable portfolio split between a U.S. total market fund and an international fund. During a market correction, the U.S. fund is down 12% and the international fund is down 8%. The investor:

    1. Sells the U.S. fund, realizing a $30,000 loss.
    2. Buys a similar but not identical U.S. fund (e.g., swapping a total market fund for an S&P 500 fund) to stay invested.
    3. Has $10,000 of capital gains from rebalancing earlier in the year.

    Result: the $30,000 loss offsets the $10,000 of gains entirely, leaving $20,000 of net loss. The investor applies $3,000 against ordinary income this year (saving roughly $720 at a 24% bracket) and carries forward $17,000 to offset future gains and income. The investor stayed fully invested, captured the recovery, and banked a meaningful tax asset — all for a few minutes of trading.

    For official guidance, the IRS provides detailed, up-to-date information.

    The Bottom Line

    Tax-loss harvesting is one of the few genuine "free lunches" in investing — it converts market declines into tax savings without requiring you to leave the market. Harvest losses in taxable accounts during downturns, mind the wash-sale rule, reinvest in similar but not identical funds, and let unused losses carry forward to offset future gains. Over an investing lifetime, disciplined loss harvesting can save a meaningful sum in taxes. Pair it with our capital gains tax guide and tax planning guide for a complete tax-efficient investing strategy.

    Expert Insight

    Tax-loss harvesting is one of the highest-ROI tax strategies for investors with taxable accounts, yet many clients don't realize it exists. The beauty is that it's nearly free — you sell a losing fund, buy a similar one, stay invested, and bank the loss. Over a lifetime, those harvested losses can offset tens of thousands of dollars of gains. The one rule I hammer home: never trigger a wash sale. Use a similar-but-not-identical fund as your replacement, and you stay invested and compliant.

    — James Mitchell, Senior Financial Analyst & Personal Finance Expert

    Key Takeaways

    • Tax-loss harvesting sells losing investments to offset capital gains and up to $3,000 of ordinary income per year.
    • Unused losses carry forward indefinitely to offset future gains and income.
    • The wash-sale rule disallows losses if you buy a 'substantially identical' security within 30 days.
    • Only harvest in taxable accounts — losses in IRAs and 401(k)s provide no tax benefit.
    • Replace sold funds with similar but not identical funds to stay invested and compliant.

    Frequently Asked Questions

    What is the wash-sale rule?

    The wash-sale rule disallows a capital loss if you buy the same or a 'substantially identical' security within 30 days before or after the sale — a 61-day window. If triggered, the loss is deferred (added to the replacement's cost basis) rather than lost, but you can't claim it this year. Avoid the rule by buying a similar but not identical fund.

    How much loss can I deduct per year?

    Capital losses first offset capital gains dollar-for-dollar. Up to $3,000 ($1,500 if married filing separately) of net loss can offset ordinary income each year. Any remaining loss carries forward indefinitely to future years, offsetting future gains and up to $3,000 of income per year.

    Can I tax-loss harvest in my IRA or 401(k)?

    No. Losses in tax-advantaged accounts provide no tax benefit, since these accounts are tax-deferred or tax-free. Only harvest losses in taxable brokerage accounts, where gains and losses affect your tax bill.

    What does 'substantially identical' mean for the wash-sale rule?

    The IRS hasn't precisely defined it, but it generally means the same security (same stock, or the same options contract) or one that is economically equivalent. Different index funds tracking similar but not identical indexes are usually considered not substantially identical, letting you switch funds to avoid the rule.

    Should I sell a good investment just to harvest a loss?

    If you still want the investment, sell it and buy a similar but not identical fund, then switch back after 31 days if desired. This keeps you invested while banking the loss. If you no longer believe in the investment, selling for the loss is fine. Don't let the tax benefit override sound investment judgment.

    When is the best time to harvest tax losses?

    During market downturns and at year-end. Downturns create the largest losses to harvest; year-end lets you assess your full-year gains and coordinate with rebalancing. But you can harvest any time — any loss banked now is a loss available to offset future gains.

    Do harvested losses expire?

    No. Unused net capital losses carry forward indefinitely. You can apply $3,000 per year against ordinary income and use any remaining amount to offset future capital gains in full until the loss is exhausted. Keep prior-year tax returns to substantiate carryforwards.

    Does tax-loss harvesting work for mutual funds and ETFs?

    Yes, and ETFs are especially convenient because multiple providers offer funds tracking similar indexes, making it easy to find a non-substantially-identical replacement. Mutual funds work too, but check whether the replacement is considered substantially identical to the one you sold.

    References & Further Reading

    Related Resources

    James Mitchell, Senior Financial Analyst & Personal Finance Expert

    Written by

    James Mitchell

    Senior Financial Analyst & Personal Finance Expert

    James Mitchell is a Certified Financial Planner with over 12 years of experience helping individuals and families achieve their financial goals. He specializes in retirement planning, investment strategies, and tax optimization. James holds an MBA in Finance from the University of Chicago and has been featured in major financial publications. His mission is to make complex financial concepts accessible to everyone.

    Certified Financial Planner (CFP) • MBA in Finance, University of Chicago Booth School of Business

    Related Articles

    Abstract financial growth chart in green over a dark navy background representing capital gains
    Taxes

    Capital Gains Tax: Everything You Need to Know

    Selling an investment for a profit triggers a capital gains tax — but how much you pay depends on how long you held it and your income. Here's everything you need to know to minimize it.

    2026-08-2810 min read
    Abstract financial chart in green over navy representing tax planning for high earners
    Taxes

    Tax Planning Strategies for High Earners

    High earners face the steepest tax bills — and the greatest opportunities to reduce them legally. Here are the most effective tax planning strategies for high-income professionals.

    2026-08-2811 min read