Tax-Loss Harvesting Savings Calculator

Realising a loss is only worth doing if you know what it offsets. This calculator applies the netting order the Internal Revenue Code actually requires — short-term against short-term, long-term against long-term, then across — caps the deduction against ordinary income at $3,000 ($1,500 if married filing separately), and reports the tax you save this year and the loss that carries forward with its character intact. Enter your realised positions, the losses you are considering harvesting, and your rates.

Calculator

This calculator runs in your browser. Enable JavaScript for live results — the inputs, formula and worked example below remain fully readable without it.

Inputs this calculator takes, with typical values
InputWhat to enterExample
Net short-term gains realised so farGains on positions held one year or less, net of short-term losses already realised. Enter a negative number if you are already net short-term negative.6000 $
Net long-term gains realised so farGains on positions held more than one year, net of long-term losses already realised. Include capital gain distributions from funds.12000 $
Short-term losses you plan to harvestUnrealised losses on positions held one year or less that you could sell before year end. Enter as a positive number.8000 $
Long-term losses you plan to harvestUnrealised losses on positions held more than one year. Enter as a positive number.4000 $
Marginal ordinary income tax rateYour federal marginal rate on ordinary income. Short-term gains and the annual capital loss deduction are both valued at this rate.32 %
Long-term capital gains rateThe statutory long-term rate that applies to you: 0%, 15% or 20% federally, before the net investment income tax.15 %
Subject to the 3.8% net investment income taxApplies once modified AGI exceeds $200,000 single or $250,000 married filing jointly, and is added to both capital gains rates.Yes
Married filing separatelyHalves the annual capital loss deduction against ordinary income from $3,000 to $1,500.No
Short-term loss carried forward from prior yearsFrom line 6 of Schedule D, entered as a positive number. It keeps its short-term character indefinitely.0 $
Long-term loss carried forward from prior yearsFrom line 14 of Schedule D, entered as a positive number. It keeps its long-term character indefinitely.0 $

It returns

  • Tax saved this year — Tax owed without harvesting minus tax owed with it, at the rates you entered.
  • Capital gains tax without harvesting
  • Capital gains tax after harvesting
  • Net capital gain or loss after harvesting
  • Loss deducted against ordinary income
  • Short-term loss carried to next year
  • Long-term loss carried to next year

The formula

Saving=TbeforeTafter
Dord=min(L,3000)

In plain text: Saving = Tax(gains as they stand) − Tax(gains after netting the harvested losses)

  • TTax on net capital gains, less the ordinary-income deduction valued at the ordinary rate ($)
  • t_ordMarginal ordinary rate — applies to short-term gains and to the annual deduction (decimal)
  • t_ltLong-term capital gains rate (decimal)
  • NIIT3.8% surtax added to both capital gains rates above the MAGI thresholds (decimal)
  • LAnnual limit on the deduction against ordinary income: $3,000, or $1,500 if married filing separately ($)

The netting order is set by §1211(b) and §1212(b): net within each holding-period class first, then apply any remaining loss of one class against a net gain of the other, then deduct up to the annual limit against ordinary income — short-term losses first — and carry the rest forward with its character preserved.

Updated Category Performance, Risk & Investment Costs Verified against published test cases Reading time 12 min

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.

  1. Tax as things stand. Short-term: $6,000 × 35.8% = $2,148. Long-term: $12,000 × 18.8% = $2,256. Total $4,404.
  2. Net within classes after harvesting. Short-term becomes 6,000 − 8,000 = −$2,000. Long-term becomes 12,000 − 4,000 = $8,000.
  3. 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.
  4. Tax after harvesting. $6,000 × 18.8% = $1,128.
  5. 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

Federal tax saved in the year of harvest, at a 32% ordinary rate, a 15% long-term rate and the 3.8% net investment income tax, giving 35.8% short-term and 18.8% long-term.
The loss offsetsRate appliedTax saved this yearCarried forward
$10,000 of short-term gains35.8%$3,580$0
$10,000 of long-term gains18.8%$1,880$0
$5,000 short-term + $5,000 long-term35.8% / 18.8%$2,730$0
$7,000 of long-term gains, no other gains18.8% then 32%$2,276$0
Nothing — no gains at all32% 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.

Frequently asked questions

How much of a capital loss can I deduct in one year?

Capital losses offset capital gains without limit — a $200,000 loss fully cancels a $200,000 gain. Only the excess is capped: up to $3,000 of net capital loss may be deducted against ordinary income each year, or $1,500 if you are married filing separately. Anything beyond that carries forward indefinitely and keeps its short-term or long-term character. The $3,000 figure is set by §1211(b) and is not indexed for inflation.

Do capital loss carryforwards expire?

No. For an individual taxpayer a capital loss carryforward lasts indefinitely and is carried on Schedule D year after year until it is used up. It does not, however, survive you: unused carryforwards are lost at death rather than passing to your estate or heirs. That is one reason very large carryforwards held by older taxpayers are sometimes worth accelerating against realised gains.

What is the wash sale rule?

Section 1091 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. The rule applies across all your accounts and your spouse's, and it is triggered by automatic dividend reinvestment. In an ordinary taxable account the disallowed loss is added to the basis of the replacement shares, so it is deferred rather than destroyed; if the repurchase happens inside an IRA, IRS guidance treats the loss as permanently lost.

Can I buy a similar fund instead of waiting 31 days?

Yes, provided it is not substantially identical. Two funds tracking different indices with different holdings are generally accepted as distinct even when their returns are highly correlated; two share classes of the same fund are not. The IRS has never issued a bright-line test for mutual funds and ETFs, so the common practice is to move to a fund tracking a genuinely different index and to keep the swap documented. Discuss anything borderline with your tax adviser.

Does tax-loss harvesting actually save tax, or just delay it?

Mostly it delays it. Selling at a loss and buying a replacement resets your basis lower, so the eventual gain is larger by the amount harvested. The deferral is worth the return you earn on the tax you did not pay, for as long as you do not pay it. It becomes a genuine saving in three cases: when a short-term loss offsets a short-term gain and the eventual gain is long-term, when your future rate is lower than today's, and when the replacement position is held until death and receives a stepped-up basis.

Should I harvest a short-term or a long-term loss first?

Short-term losses are generally more valuable, because they first offset short-term gains taxed at ordinary rates of up to 37% plus the 3.8% surtax, whereas long-term losses first meet gains taxed at 0%, 15% or 20%. The netting order enforces that matching, so a short-term loss used against a long-term gain gives up most of its value. Where you can choose which tax lots to sell, match character to character.

Does harvesting work in an IRA or 401(k)?

No. Nothing inside a tax-deferred or Roth account produces a reportable capital gain or loss, so there is nothing to harvest. Worse, buying the replacement security inside an IRA within the wash sale window can permanently disallow a loss you harvested in your taxable account, with no basis adjustment to recover it later. Keep the two sides of a harvest entirely inside the taxable account.

Is there a deadline for harvesting losses?

The trade must settle as a sale in the tax year, so the practical deadline is the last trading day of the year for the loss to count against that year's gains. Because the wash sale window extends 30 days after the sale, a late-December harvest constrains what you can buy well into January. Harvesting opportunities also appear throughout the year during market declines, and there is no requirement to wait for December.

How do prior-year carryforwards interact with this year's harvesting?

They enter the netting as though they were realised this year, keeping their original character: a prior short-term carryforward joins your short-term column and a long-term one joins the long-term column. Because they are applied alongside current losses, a large existing carryforward can leave new harvesting worth nothing this year, since the gains have already been absorbed. Enter yours in the fields above to see whether that is your situation.

References