What tax-loss harvesting does
Tax-loss harvesting is selling a position that has fallen, so the loss becomes a realised capital loss you can use, and immediately buying something similar enough to keep your market exposure but different enough to avoid the wash sale rule. Nothing about your portfolio's risk changes materially. What changes is that a loss which existed only on paper now exists on Schedule D.
The loss is worth money because capital losses offset capital gains dollar for dollar, and up to $3,000 a year of any remaining net loss is deductible against ordinary income under §1211(b). At a 35% marginal rate, cancelling a $10,000 short-term gain is worth $3,500 of tax you do not pay this April, and the money stays invested and compounding in the meantime.
What harvesting mostly does not do is eliminate tax. When you sell at a loss and buy a replacement, your basis in the new position is the lower purchase price, so the gain eventually realised is larger by the amount of loss you harvested. The tax is deferred rather than forgiven. That deferral is genuinely valuable — money kept for a decade compounds — and it converts into a permanent saving in three specific situations: when the harvested loss offsets a short-term gain and the eventual gain is long-term, arbitraging the rate difference; when your future marginal rate is lower than today's; and when the position is never sold at all, because the basis steps up at death.
The netting order, which is where people get it wrong
Losses do not simply offset the gain you would most like them to. The Code sets a sequence, and the sequence determines how much your loss is worth.
Step one: net within each holding-period class. All short-term gains and losses combine into one net short-term figure; all long-term gains and losses combine into one net long-term figure. Holding period is measured from the day after acquisition to the day of sale, with more than one year being long-term.
Step two: net across classes, but only if the signs differ. If you have a net short-term loss and a net long-term gain, the loss reduces the gain, and vice versa. If both are gains, they are simply taxed at their own rates; if both are losses, both carry through to step three.
This second step is why the character of a harvested loss matters so much. A short-term loss first offsets short-term gains, which are taxed at your ordinary rate — up to 37% federally, plus 3.8% NIIT. Using a short-term loss against a long-term gain taxed at 15% wastes most of its value. Where you have a choice about which lots to sell, match short-term losses to short-term gains.
Step three: deduct up to $3,000 against ordinary income. If the combined result is a net loss, up to $3,000 ($1,500 married filing separately) reduces ordinary income, which is the most valuable dollar-for-dollar use of a loss available, because ordinary rates are the highest. Section 1212(b) applies short-term losses to this deduction first.
Step four: carry the rest forward. The excess carries to next year with its short-term or long-term character preserved, and it carries forward indefinitely for an individual. It does not expire; it does, however, die with the taxpayer rather than passing to heirs or an estate.
Worked example: $18,000 of gains and $12,000 of harvestable losses
You have realised $6,000 of net short-term gains and $12,000 of net long-term gains this year. Your ordinary rate is 32%, your long-term rate is 15%, and you are above the NIIT thresholds, so the applicable rates are 35.8% short-term and 18.8% long-term. You are considering harvesting $8,000 of short-term losses and $4,000 of long-term losses.
- Tax as things stand. Short-term: $6,000 × 35.8% = $2,148. Long-term: $12,000 × 18.8% = $2,256. Total $4,404.
- Net within classes after harvesting. Short-term becomes 6,000 − 8,000 = −$2,000. Long-term becomes 12,000 − 4,000 = $8,000.
- Net across classes. The $2,000 net short-term loss reduces the $8,000 net long-term gain to $6,000, and the short-term figure goes to zero.
- Tax after harvesting. $6,000 × 18.8% = $1,128.
- Saving. 4,404 − 1,128 = $3,276, with no carryforward and no ordinary-income deduction, because you finish the year in a net gain position.
Notice where the value came from. The $8,000 short-term loss removed $6,000 of short-term gain at 35.8% (worth $2,148) and then spilled $2,000 into long-term at 18.8% (worth $376). The $4,000 long-term loss removed long-term gain at 18.8% (worth $752). Adding those: 2,148 + 376 + 752 = $3,276. The same $12,000 of losses would have been worth only $12,000 × 18.8% = $2,256 had every dollar landed against long-term gains — a difference of $1,020 that comes purely from matching character.
Now change the scenario: suppose you had no gains at all this year and harvested the same $12,000. The deduction against ordinary income is capped at $3,000, worth $3,000 × 32% = $960, and $9,000 carries forward. Identical losses, less than a third of the benefit, entirely because there was nothing to offset.
How to read the result and when the exercise is worth it
Compare the tax saving against three things before acting.
The trading cost and the tracking risk. Selling and rebuying costs spreads, and the replacement security is by definition not identical — that is the point. Over the 31 days you must wait to return, the two can diverge by more than the tax you saved. On a large loss the tax dominates; on a small one it may not.
The basis you give up. Every dollar harvested lowers your basis by a dollar, so the tax is largely borrowed from your future self. Value the deferral honestly: the benefit is the return earned on the deferred tax for however long the deferral lasts, plus any rate difference between then and now. It is not the headline saving.
Your rate trajectory. Harvesting is most valuable when you are in a high bracket now and expect a lower one later — someone in their peak earning years who will draw down in retirement. It can be actively counterproductive if you expect to be in the 0% long-term capital gains bracket later, since you would be converting a future zero-rate gain into a present deduction and a larger future gain that might have been free.
Two structural points that override the arithmetic. Harvesting only makes sense in a taxable account; losses inside an IRA or 401(k) have no tax effect at all. And a loss you harvest is useless if you have nothing to offset and already claim the $3,000 — the carryforward is real but at $3,000 a year a large carryforward takes a long time to consume. Our capital gains tax calculator shows what the gains side of that equation looks like.
What $10,000 of harvested losses is worth, by what it offsets
| The loss offsets | Rate applied | Tax saved this year | Carried forward |
|---|---|---|---|
| $10,000 of short-term gains | 35.8% | $3,580 | $0 |
| $10,000 of long-term gains | 18.8% | $1,880 | $0 |
| $5,000 short-term + $5,000 long-term | 35.8% / 18.8% | $2,730 | $0 |
| $7,000 of long-term gains, no other gains | 18.8% then 32% | $2,276 | $0 |
| Nothing — no gains at all | 32% on $3,000 | $960 | $7,000 |
Row four is $7,000 × 18.8% = $1,316 against the gain, plus the remaining $3,000 deducted against ordinary income at 32% = $960. The same $10,000 of losses is worth between $960 and $3,580 depending only on what it lands against.
The wash sale rule is broader than most people assume
Section 1091 disallows a loss if you acquire the same or a substantially identical security within 30 days before or after the sale — a 61-day window centred on the trade. Three traps catch people every December. It applies across all your accounts, including your spouse's and, per IRS guidance, your IRA — and a loss disallowed because of an IRA purchase is lost permanently rather than added to basis. It is triggered by automatic reinvestment of dividends in the fund you just sold. And it applies to purchases in the 30 days before the sale, so a position you added to in early December cannot be fully harvested in late December. A disallowed loss in an ordinary taxable-account wash sale is not destroyed: it is added to the basis of the replacement shares and the holding period tacks on.
Assumptions and limits of this calculation
- Federal only. States differ: some follow the federal treatment, some cap or disallow the $3,000 deduction, and a few do not permit carryforwards. Check your state's rules before relying on the figure.
- No wash sales are assumed. The calculator has no way to know what you repurchased. If a loss is disallowed, remove it from the harvested amount.
- The 28% collectibles rate and the 25% unrecaptured §1250 rate are not modelled. Gains on collectibles and depreciation recapture on property are taxed at their own rates and net separately.
- The NIIT is applied as a flat surcharge on gains. In reality it applies to the lesser of net investment income and the excess of MAGI over the threshold, so at the margin of the threshold the effective rate is lower than the calculator shows.
- The ordinary-income deduction is valued at your ordinary rate alone. Its interaction with the NIIT base is not modelled.
- Qualified dividends and the capital gains bracket structure are outside the scope. A large harvested loss can move you between the 0%, 15% and 20% brackets, which this calculation does not re-solve for you.
- No time value is applied. The saving shown is this year's cash tax difference, not the present value of a deferral net of the basis reduction.
Where harvesting fits in a taxable-account strategy
Harvesting is one of four things you can do about tax in a taxable account, and it is neither the first nor the largest. Asset location comes first: holding tax-inefficient assets inside sheltered accounts avoids the tax rather than deferring it, and no amount of harvesting recovers a bad location decision. Then comes holding period discipline — letting a gain cross the one-year line converts an ordinary-rate gain into a long-term one, which on a large position dwarfs most harvests.
Then harvesting, then gain harvesting, which is its mirror image: in a year when your taxable income is low enough to sit in the 0% long-term capital gains bracket, deliberately realising gains resets your basis upward at no tax cost. The two strategies are opposites and the right one depends entirely on this year's bracket.
Around all of it sits the question of what tax the portfolio generates in the first place. Fund turnover produces distributions you cannot control, and fees reduce returns before any of this arithmetic applies — see the expense ratio impact calculator. And when you do sell, the character and size of the gain is the input to the investment capital gains tax calculator, while your bracket comes from the marginal versus effective rate calculator.
This tool estimates federal tax at rates you supply and is not tax advice. Netting interacts with state rules, the alternative minimum tax, passive activity limits and the capital gains bracket structure in ways a single calculation cannot capture. Take the result to a CPA before executing a large harvest in December.
