stocktax.tools
HomeGuides › Tax-loss harvesting

Tax-loss harvesting

Tax-loss harvesting turns a losing position into a tax benefit: you realize the loss to offset gains and some income, while staying invested by buying a similar — but not identical — replacement.

Put real numbers on this: Capital Gains Tax Calculator
Open the calculator →

How it works

When you sell a stock or fund for less than you paid, you realize a capital loss. That loss first offsets capital gains of the same type (short against short, long against long), then the other type, dollar for dollar. If losses still remain, you can deduct up to $3,000 against ordinary income per year and carry the rest forward indefinitely. Harvesting is simply choosing to realize losses on purpose to capture that benefit.

Why it is valuable

A harvested loss is a real, immediate tax reduction. Offsetting a $10,000 short-term gain with a $10,000 harvested loss can save $3,200 at a 32% rate. Even with no gains, deducting $3,000 against income saves up to about $1,110 a year, and carryforwards bank losses for future high-gain years. Done routinely, harvesting can meaningfully raise your after-tax return without changing your overall market exposure.

The wash-sale trap

The catch is the wash-sale rule: if you buy the same or a substantially identical security within 30 days before or after the loss sale, the loss is disallowed. To harvest cleanly, either stay out of that exact security for 31 days, or immediately buy a different fund that tracks a similar (but not identical) index so you keep market exposure without triggering the rule. Also avoid re-buying in a spouse's account or your IRA, which the rule covers.

Staying invested with a replacement

The elegant part of harvesting is that you rarely have to sit in cash. Sell a broad U.S. index fund at a loss and buy a different provider's broad U.S. fund tracking a different-but-similar index; your portfolio's exposure is virtually unchanged while you bank the loss. After 31 days you can switch back if you prefer. This is how large advisors harvest continuously without altering a client's allocation.

When it makes sense — and when not

Harvesting helps most in taxable accounts, in volatile years, and for people with gains to offset or high ordinary income. It matters less if you are in the 0% capital-gains bracket (your gains are already untaxed) or investing only in tax-advantaged accounts. Remember harvesting lowers your cost basis in the replacement, so it defers rather than erases tax — the benefit is timing and, ideally, converting short-term offsets into long-term deferral.

A quick example

You have a $10,000 short-term gain from one sale and an unrealized $10,000 loss in another holding. Sell the loser and immediately buy a similar-but-different fund. The harvested loss cancels the gain, so instead of paying roughly $3,200 in tax this year, you pay nothing on that gain — and your money stays invested the whole time.

Frequently asked questions

What is tax-loss harvesting?

Deliberately selling an investment at a loss to offset capital gains and up to $3,000 of ordinary income, lowering your tax bill while typically staying invested through a similar replacement.

How much can tax-loss harvesting save?

A harvested loss offsets gains dollar for dollar, and up to $3,000 per year against ordinary income. At a 32% rate, offsetting a $10,000 short-term gain saves about $3,200; excess losses carry forward.

How do I avoid the wash-sale rule when harvesting?

Do not buy the same or substantially identical security within 30 days before or after the sale. Instead buy a different fund tracking a similar but not identical index, and avoid re-buying in a spouse account or IRA.

Does harvesting eliminate tax or just defer it?

Mostly defers. Buying a replacement lowers your basis, so the tax reappears as a larger future gain — but you gain the time value and can convert short-term offsets into long-term treatment.

Sources & methodology

Based on standard U.S. treatment of capital losses. References: IRS Publication 550, Topic No. 409, Topic No. 419. Educational, not investment advice. Tax year 2026. Last updated 2026-07.

⚠️ Educational content only — not tax advice. Your actual tax depends on your full situation and current law. Confirm with a qualified professional before acting.