Tax-Loss Harvesting Calculator
Tax-loss harvesting turns a paper loss into a real tax benefit — offsetting gains plus up to $3,000 of ordinary income a year. Here's the math and the wash-sale trap.
Don't have time? Here's what you need to know:
- 1Harvested losses offset capital gains dollar for dollar, then up to $3,000 of ordinary income per year, with the rest carried forward.
- 2Offsetting higher-taxed short-term gains or ordinary income gives a bigger benefit per dollar than offsetting long-term gains.
- 3The wash-sale rule disallows the loss if you buy the same or a substantially identical security within 30 days before or after the sale.
- 4Harvesting mainly defers tax by resetting basis lower, and it applies only to taxable accounts — not IRAs or 401(k)s.
What Tax-Loss Harvesting Actually Does
Tax-loss harvesting means selling an investment that has dropped below your purchase price to lock in, or 'realize,' the loss — then using that loss to reduce your tax bill. The position was a paper loss while you held it; selling converts it into a capital loss the IRS lets you put to work. You typically reinvest the proceeds in a similar (but not identical) fund so you stay in the market.
Under current U.S. rules, realized capital losses first offset your realized capital gains dollar for dollar. If your losses exceed your gains, you can deduct up to $3,000 of the excess against ordinary income each year, and any remaining loss carries forward to future years indefinitely. That carryforward is what makes harvesting in a bad year valuable long after the market recovers.
The Math: What a Calculator Computes
A tax-loss harvesting calculator estimates the tax you save by applying a harvested loss against your gains and income at your tax rates. The benefit is the size of the loss multiplied by the rate it offsets — your short- or long-term capital-gains rate when offsetting gains, or your marginal ordinary-income rate when applying the $3,000 against income (since ordinary rates are usually higher, that $3,000 is often the most valuable slice).
Consider a simple example. Suppose you realize $10,000 of losses and have $7,000 of long-term gains taxed at 15%. The losses wipe out the $7,000 gain, saving 15% of $7,000, or $1,050. The remaining $3,000 of loss offsets ordinary income; at a 24% marginal rate that saves another $720. Total first-year tax saved: about $1,770. The numbers below show how the same loss flows through.
| Step | Amount | Tax effect |
|---|---|---|
| Losses realized | $10,000 | — |
| Offset long-term gains | $7,000 at 15% | Saves $1,050 |
| Offset ordinary income | $3,000 at 24% | Saves $720 |
| First-year total | $10,000 used | Saves ~$1,770 |
Tip: Offsetting short-term gains, which are taxed at higher ordinary rates, gives a bigger benefit per dollar than offsetting long-term gains. Match harvested losses against your most heavily taxed gains first.
The Wash-Sale Rule You Can't Ignore
The catch is the wash-sale rule. If you buy the same or a 'substantially identical' security within 30 days before or after selling at a loss — a 61-day window in total — the IRS disallows the loss for that sale. The disallowed loss is not lost forever; it is added to the cost basis of the replacement shares. But it defeats the point of harvesting this year.
The standard workaround is to reinvest in a similar-but-not-identical fund: sell an S&P 500 fund at a loss and buy a total-market fund, for example, so you keep nearly the same exposure without triggering the rule. Be careful with automatic dividend reinvestment and across all your accounts, including IRAs — a purchase of the identical fund anywhere in that 61-day window can trip the rule.
Important: Buying back the identical fund within 30 days — including via automatic dividend reinvestment or a purchase in your IRA — triggers the wash-sale rule and disallows your loss for that sale. Turn off auto-reinvest on positions you plan to harvest.
Want the full framework? This 2-hour ETF course teaches you exactly how to pick, buy, and hold profitable ETFs — from zero to confident investor. Under $15.
Harvesting Defers Tax, It Doesn't Erase It
It is important to understand what harvesting really gives you. When you sell at a loss and rebuy a similar fund, your cost basis resets lower, so a future sale will show a larger gain. The tax benefit today is largely a deferral — you pay later instead of now. That deferral still has real value because you keep more money invested and compounding in the meantime, and the tax may eventually fall in a lower-rate year.
Two situations make the benefit more than a deferral: if your gains are eventually taxed at a lower rate than the rate at which you harvested, or if the harvested shares ultimately receive a stepped-up basis through inheritance. Harvesting only applies to taxable accounts — there is nothing to harvest in an IRA or 401(k), where gains and losses are not currently taxed. Our tax-efficient ETF investing guide covers how this fits the broader picture.
Frequently Asked Questions
How much can tax-loss harvesting actually save me?
It depends on your loss size and tax rates. Harvested losses offset capital gains at your capital-gains rate, and up to $3,000 of excess loss can offset ordinary income each year at your marginal rate. A $10,000 loss offsetting a 15% long-term gain plus $3,000 of income at a 24% rate could save roughly $1,770 in the first year, with any unused loss carried forward.
What is the wash-sale rule?
If you sell a security at a loss and buy the same or a substantially identical security within 30 days before or after the sale, the IRS disallows the loss for that sale. The disallowed amount is added to the cost basis of the replacement shares. To harvest cleanly, reinvest in a similar but not identical fund and watch for purchases in all your accounts, including IRAs.
Does tax-loss harvesting eliminate taxes or just delay them?
Mostly it defers them. Rebuying a similar fund at a lower price resets your cost basis lower, so a future sale shows a larger gain. The deferral still helps because more money stays invested and compounding, and the future tax may fall in a lower-rate year or be erased by a stepped-up basis at inheritance.
Can I harvest losses in my IRA or 401(k)?
No. Tax-loss harvesting only works in taxable brokerage accounts, where gains and losses are reported each year. Inside an IRA or 401(k), investment gains and losses are not currently taxed, so there is nothing to harvest. Note that selling at a loss in a taxable account while buying the identical fund in your IRA can still trigger the wash-sale rule.
Further Reading
Free Tools
Alex Harrington
CFA Level II Candidate, Finance & Economics
Alex Harrington is an independent ETF researcher and personal finance writer with over 8 years of experience analyzing exchange-traded funds. A CFA Level II candidate with a background in economics, Alex has reviewed 800+ ETFs and helped thousands of beginners build their first investment portfolios through clear, jargon-free education.
This content is for educational purposes only and does not constitute financial advice. Past performance does not guarantee future results. Consult a licensed financial advisor before making investment decisions.