← Back to calculator
Tax Strategy · 2026

Tax-Loss Harvesting: The Complete Guide

Tax-loss harvesting is the rare tax strategy that pays you for something that already went wrong. A position dropped below what you paid for it. That decline is a real economic loss whether you sell or not — but only a realized loss shows up on your tax return. Harvesting converts paper red ink into a deduction that offsets gains dollar-for-dollar, and it does so without necessarily changing your investment posture at all.

The concept is simple enough to explain in a sentence. Executing it correctly is where investors lose money: a mistimed repurchase, a forgotten dividend reinvestment, or a replacement fund that is a little too similar can void the entire deduction. This guide covers the mechanics, the netting rules that determine how much you actually save, the wash sale rule in detail, a full worked example with real figures, and the situations where harvesting is not worth doing.

Start with your baseline. Harvesting only helps if you have gains or income to offset. Run your numbers in our calculator first so you know your marginal capital gains rate — that rate is exactly what each harvested dollar is worth to you.

What tax-loss harvesting actually is

When you sell an investment for less than its cost basis, you realize a capital loss. The IRS lets you subtract that loss from capital gains you realized during the same tax year. If losses exceed gains, you may deduct up to $3,000 of the excess against ordinary income (wages, interest, self-employment income), and carry the remainder forward to future tax years without expiration.

The strategy is called harvesting because the loss is deliberately gathered rather than passively accepted. You are not selling because you have given up on the asset class. You are selling to capture a tax attribute, then immediately re-establishing similar exposure with different securities so the portfolio's risk and return profile stays effectively unchanged. Done well, you keep your market position and pick up a deduction. That gap between the two is what practitioners call tax alpha.

One point deserves emphasis up front, because it is the most common misconception: harvesting is primarily a deferral, not a permanent elimination. Selling at a loss and reinvesting resets your cost basis to the lower current price, which means a larger taxable gain later if the position recovers. The benefit is real, but it comes from three sources — the time value of deducting now and paying later, the possibility of converting a high-rate short-term gain into a low-rate long-term gain, and the chance that the deferred gain is eventually taxed at 0%, offset by future losses, donated to charity, or wiped out by a stepped-up basis at death.

How a harvest actually runs, start to finish 123 IdentifyRealizeReplace Find lots trading belowtheir cost basis Sell before Dec 31 — apaper loss is not a loss Wait 31 days, or buy asimilar fund right away Wash sale window: 30 days before + 30 days after the sale (IRC §1091) Repurchasing a substantially identical security inside that window disallows the loss.
The three steps of a harvest. Step 3 is where most of the money is lost: buying the same security back too early disallows the deduction, so either wait out the 61-day window or switch to a similar but not identical fund.

How losses offset gains: the netting order

The IRS applies a specific sequence when combining gains and losses, and the order matters a great deal because short-term gains are taxed at ordinary income rates up to 37% while long-term gains top out at 20%. Losses are matched within their own category first.

StepWhat happensWhy it matters
1Short-term losses offset short-term gainsShelters your highest-taxed gains first
2Long-term losses offset long-term gainsReduces gains taxed at 0/15/20%
3Any excess in one category crosses over to the otherA leftover long-term loss can shelter short-term gains
4Net loss offsets ordinary income, capped at $3,000Worth your full marginal rate — up to 37%
5Remainder carries forward indefinitelyKeeps its short/long character in future years

There is no cap on using losses against gains. A $250,000 loss can eliminate a $250,000 gain in a single year. The famous $3,000 limit applies only at step 4, when losses exceed gains and you start reaching into ordinary income. Married filing separately halves that to $1,500 each. For how the underlying rates differ, see our guides on short-term capital gains and long-term capital gains.

Why short-term losses are the most valuable

A short-term loss that offsets a short-term gain saves you your full ordinary marginal rate. For a single filer with $180,000 of taxable income in 2026, that is 24 cents per dollar. The same dollar applied against a long-term gain saves only 15 cents. If you have a choice of which lots to sell, harvesting short-term losses while short-term gains exist is the highest-value move available.

Worked example: a $34,500 harvest

Consider Dana, a single filer in California with $180,000 of taxable income — a 24% ordinary bracket, the 15% long-term capital gains bracket, and below the $200,000 NIIT threshold, so no 3.8% surtax. During 2026 Dana realized:

In November, Dana reviews the portfolio and finds three positions trading below cost:

PositionCost basisCurrent valueLossHolding period
Small-cap value ETF$60,000$46,000$14,000Long-term
Intermediate bond fund$80,000$71,500$8,500Long-term
Biotech stock (4 months)$25,000$13,000$12,000Short-term
Total harvested$165,000$130,500$34,500

Dana sells all three and immediately reinvests the $130,500 in replacements that are similar but not substantially identical: a small-cap blend ETF from a different issuer tracking a different index, a bond fund of comparable duration from another fund family, and a broad biotech sector ETF instead of the single stock. Market exposure is preserved; the wash sale rule is not triggered.

Applying the netting rules

Short-term first: $18,000 gain − $12,000 loss = $6,000 net short-term gain. Long-term next: $42,000 gain − $22,500 loss = $19,500 net long-term gain. Both categories remain positive, so nothing crosses over and no ordinary income deduction applies this year.

Tax componentWithout harvestingWith harvestingSavings
Short-term gain taxed @ 24%$18,000 → $4,320$6,000 → $1,440$2,880
Long-term gain taxed @ 15%$42,000 → $6,300$19,500 → $2,925$3,375
Federal subtotal$10,620$4,365$6,255
California @ 9.3% (no preferential rate)$5,580$2,372$3,208
Total tax$16,200$6,737$9,463

A $34,500 harvest produced $9,463 in combined federal and state savings — an effective benefit of roughly 27 cents per dollar harvested, driven largely by California's lack of a preferential capital gains rate. An investor in Florida or Texas would keep only the $6,255 federal portion. State treatment is the single largest swing factor; check your own in our state capital gains tax directory or the detailed California breakdown.

The deferral side of the ledger. Dana's replacement positions now carry a $34,500 lower basis. If they recover fully and are sold at a 15% federal rate, roughly $5,175 of federal tax comes back. Dana still nets ahead — $6,255 saved now versus $5,175 owed years later, plus the short-term-to-long-term rate conversion — but the benefit is smaller than the headline number suggests. Anyone claiming harvesting is "free money" is ignoring this column.

What happens when losses exceed gains

Suppose instead Dana harvested $60,000 in losses against only $20,000 in gains. The gains are wiped out entirely, $3,000 of the remaining $40,000 is deducted against ordinary income — worth $720 at a 24% rate — and $37,000 carries forward. That carryforward keeps its character and sits ready to absorb a future gain, which makes it genuinely valuable if a large sale is coming. It is worth much less if it will only ever drain away at $3,000 per year.

The wash sale rule, in detail

Under IRC §1091, a loss is disallowed if you acquire the same or a substantially identical security within 30 days before or 30 days after the sale. Counting the sale date itself, that is a 61-day window. The "before" half surprises people constantly: buying more shares on December 5 and selling your older lot at a loss on December 20 triggers the rule even though the purchase came first.

A wash sale does not destroy the loss. The disallowed amount is added to the cost basis of the replacement shares, and the old holding period tacks onto the new one. The deduction is deferred, not forfeited.

How the basis adjustment works

You bought 100 shares at $50 ($5,000 basis) and sold them at $30 for $3,000, a $2,000 loss. Eleven days later you repurchase 100 shares at $32 ($3,200). The $2,000 loss is disallowed and added to the new basis: $3,200 + $2,000 = $5,200. Sell later at $45 and you report a $700 loss rather than a $1,300 gain. The economics catch up eventually — you simply lost the use of the deduction in the year you wanted it.

The IRA trap is the one that permanently costs you. Under Rev. Rul. 2008-5, buying the replacement security inside your traditional or Roth IRA triggers the wash sale rule, and because IRA basis cannot generate a future capital loss, the disallowed deduction is gone forever. The same logic reaches your spouse's accounts and entities you control. Never repurchase in a retirement account within the 61-day window.

What counts as substantially identical

The IRS has never published a bright-line definition, which leaves a practical spectrum rather than a rule. The safe and unsafe ends are reasonably well settled.

SwapTreatmentNotes
Same ticker repurchasedWash saleUnambiguous
Different share class of the same fundWash saleSame underlying portfolio
Call options or futures on the sold stockWash saleContracts to acquire count
Two funds tracking the same indexGray areaMany advisors avoid this
S&P 500 fund → total market fund, different issuerGenerally acceptableDifferent index, different holdings
Single stock → sector ETFGenerally acceptableClearly different security
Corporate bond fund → different issuer, similar durationGenerally acceptableDifferent holdings entirely
Waiting 31+ days, then repurchasingCleanAccepts 31 days of tracking risk

Stock sales are governed by the trade date, not settlement, so a December 31 trade counts for that tax year. That said, brokers close out for the year early and pricing gets thin, so treat mid-December as your practical deadline rather than New Year's Eve.

Step-by-step: how to run a harvest

1 Total your realized gains for the year so far. Pull the realized gain/loss report from every taxable account, separated into short-term and long-term. This is the target you are trying to offset. Do not forget mutual fund capital gain distributions, which arrive in December whether you sold anything or not.

2 Identify unrealized losses at the lot level. Switch your broker's cost basis method to specific lot identification. A position that is up overall may still contain individual lots purchased at higher prices, and those lots can be harvested while you keep the rest. Averaging hides these opportunities.

3 Check for wash sale exposure before selling. Look back 30 days for any purchase in the same security across every account you and your spouse control — including automatic dividend reinvestment, 401(k) contributions, and DRIP purchases. Turn off automatic reinvestment on the position before you sell.

4 Choose the replacement security in advance. Decide what you are buying before you sell, so the switch happens same-day and you are never out of the market. Sitting in cash for 31 days to be safe is a real risk: broad markets rise in most months, and one strong month can dwarf the tax benefit.

5 Execute the sale and the purchase together, and document it. Record the trade date, lots sold, loss realized, and the replacement purchased. Your 1099-B will flag wash sales it can see, but brokers only track within their own institution and only for identical securities. Cross-broker and cross-account wash sales are your responsibility to report.

6 Report on Form 8949 and Schedule D. Each disposition goes on Form 8949, with wash sale adjustments coded W and the disallowed amount in the adjustment column. Totals flow to Schedule D, which also carries forward unused losses. Keep the carryforward figure somewhere you will find it next year — it is the most commonly abandoned tax asset there is.

7 Guard the 30-day window after the sale. Set a calendar reminder. Do not let a rebalance, a standing limit order, or a payroll-driven 401(k) purchase pull the sold security back into any of your accounts before the window closes.

Common mistakes that erase the benefit

Forgetting dividend reinvestment. The single most frequent wash sale trigger. A $40 automatic reinvestment inside the window taints the sale. Under the IRS's proportional approach only the loss attributable to the replaced shares is disallowed, so a small reinvestment usually spoils only a small slice — but it still requires a W adjustment and clean records.

Harvesting when you have no gains and no meaningful income to offset. If you end up with a large carryforward you can only unwind $3,000 at a time, you traded a permanent basis reduction for a very slow deduction. Harvest into a known use.

Letting the tax tail wag the investment dog. A 27% tax benefit on a loss cannot rescue a bad reinvestment decision. If the replacement has materially higher fees, worse liquidity, or exposure you did not intend, the harvest was not worth it. Similarity of exposure is the constraint, not an afterthought.

Harvesting inside a retirement account. Losses in an IRA or 401(k) produce no deduction whatsoever. Harvesting only exists in taxable accounts.

Ignoring state rules. Most states follow federal treatment, but not all mirror the $3,000 ordinary offset or allow carryforwards identically. New Jersey, for example, does not permit capital losses to offset other income categories. Verify your state before assuming the federal answer applies.

Harvesting a position you would have sold anyway, and calling it a strategy. Selling a loser you no longer want is fine — but that is portfolio maintenance. The tax benefit is a bonus, not a justification, and conflating the two makes it hard to evaluate either decision honestly.

Assuming the broker's 1099-B is complete. Wash sales spanning two brokerages, or involving similar-but-not-identical securities, will not appear. Reconcile manually if you trade across institutions.

When harvesting is worth it — and when it is not

The value of a harvested dollar equals the tax rate it offsets, so the strategy scales directly with your bracket and your realized gains.

SituationWorth harvesting?Reason
Large realized gain this year (business sale, property, concentrated stock)Strongly yesUnlimited offset against gains
High earner with short-term trading gainsStrongly yesOffsets rates up to 37% plus NIIT
Volatile year with wide dispersion across holdingsYesLosers exist even when the index is up
Planning a large sale within a few yearsYesCarryforward has a known use
Taxable income inside the 0% bracket (<$49,450 single / $98,900 MFJ)Usually noOffsetting a 0% gain saves nothing; harvest gains instead
Assets held only in IRAs and 401(k)sNoNo deduction available
Position you intend to hold until deathWeigh carefullyStepped-up basis may erase the gain anyway
Tiny losses in a low bracketRarelyTrading costs and complexity outweigh the benefit

The 0% bracket case is worth dwelling on because it inverts the whole strategy. If your taxable income is below $49,450 (single) or $98,900 (married filing jointly) in 2026, your long-term gains are already untaxed. Harvesting losses there wastes them. The correct move is gain harvesting — deliberately realizing appreciation at 0% and repurchasing immediately to step up your basis. The wash sale rule applies only to losses, so there is no waiting period. Both maneuvers, and six others, are covered in our guide to legally avoiding capital gains tax.

Crypto and other asset classes

Section 1091 speaks to "stock or securities," and the IRS has not treated cryptocurrency as a security for this purpose. In practice that has allowed crypto holders to sell at a loss and repurchase the same token immediately — a meaningfully better deal than equity investors get. Legislation to close this gap has been proposed in multiple sessions of Congress, so do not build a long-term plan around it. Our crypto capital gains guide covers lot tracking and reporting in depth. Real estate cannot be harvested this way at all; losses on investment property follow a different set of rules, discussed in the real estate tax guide.

Timing note for 2026. Bracket thresholds shifted with inflation this year, which changes whether a given harvest crosses a rate boundary. See what changed for 2026, then model the actual dollar impact before you place trades. Estimating a harvest is far cheaper than unwinding a wash sale.

Frequently asked questions

Can I harvest losses and gains in the same year?

Yes, and coordinating them is the point. Many investors realize a gain they wanted to take anyway — rebalancing a concentrated position, for instance — and pair it with an equivalent harvest so the net taxable amount is near zero. Because there is no cap on offsetting gains, the pairing can be arbitrarily large.

Do capital loss carryforwards expire?

No. They carry forward indefinitely and retain their short-term or long-term character. They do not, however, transfer to heirs or to a surviving spouse's separate return, so unused carryforwards are lost at death. If you are sitting on a large carryforward late in life, that is an argument for realizing gains sooner rather than later.

Will harvesting trigger an audit?

No. Tax-loss harvesting is explicitly permitted and extremely common — most robo-advisors do it automatically. What draws scrutiny is sloppy reporting: missing Form 8949 entries, unreported wash sale adjustments, or basis figures that disagree with your 1099-B. Accurate records are the whole defense.

How late in the year can I harvest?

The trade must execute by December 31, since trade date controls. In practice, act by mid-December — liquidity thins near the holidays, and you want room to verify no wash sale exposure exists. Remember the 30-day window extends into January, so a late-December harvest constrains your January trading.

Is it better to harvest a short-term or long-term loss?

Harvest short-term losses first when you have short-term gains to shelter, since those gains are taxed at ordinary rates up to 37%. If you have no short-term gains, the advantage narrows considerably, because a short-term loss will simply flow through to offset long-term gains at 15% or 20% anyway.

Run your own numbers. The value of any harvest depends on your bracket, your state, and whether NIIT applies. Use the free calculator to compare your tax bill with and without a planned harvest — the difference is the actual benefit, and it is usually not what people guess.
CC
CapitalCalc Editorial Team

Our editorial team combines expertise in tax law, financial planning, and software engineering. All content is fact-checked against primary IRS sources (Revenue Procedures, Publications, and Instructions) and reviewed by professionals with backgrounds in public accounting and fintech. We update our guides annually to reflect the latest tax code changes.

About Us → Editorial Policy →