Tax-Loss Harvesting Calculator

Tax-loss harvesting is the practice of selling investments that have declined in value to realise a capital loss, which can then be used to offset capital gains and, up to a limit, ordinary income. The IRS netting rules require you to offset short-term losses against short-term gains first and long-term losses against long-term gains first, with any net loss in one category then available to offset gains in the other. If total capital losses still exceed total capital gains after all netting, you can deduct up to $3,000 of net capital losses against ordinary income per year ($1,500 if married filing separately), saving you tax at your ordinary marginal rate. Net capital losses exceeding $3,000 carry forward indefinitely to future tax years, where they again offset gains dollar for dollar before potentially reaching the ordinary income deduction limit. The wash-sale rule prevents claiming a loss if you purchase substantially identical securities within 30 days before or after the sale, so reinvestment timing matters. This calculator applies the IRS capital loss netting rules, computes the ordinary income deduction, shows the tax saving from harvesting at your short-term and long-term rates, and tracks carryforward losses for future years so you can evaluate whether selling a losing position now is worth the transaction cost.

With short-term gains of $8,000, long-term gains of $15,000, and losses available of $15,000, you can harvest losses to save -- in federal tax this year, with -- in losses available next year.

Formula: IRS netting rules (short-term vs long-term, cross-netting, 3,000 annual limit). Source: IRS Publication 550 (Investment Income and Expenses), as at 13 June 2026.

Gains on securities held 1 year or less
Gains on securities held more than 1 year
Losses on securities held 1 year or less
Losses on securities held more than 1 year
Wages, interest, dividends and other ordinary income
For marginal tax rate determination
Unused capital losses from prior years
Your federal tax bracket (or long-term capital gains rate)
Net short-term gain/loss--
Net long-term gain/loss--
Combined net capital gain/loss--
Ordinary income reduction (max 3,000)--
Net capital gain taxable this year--
Tax savings from harvesting--
Loss carryforward to next year--

How tax-loss harvesting is calculated

Tax-loss harvesting uses the IRS netting rules to calculate your net capital gain or loss for the year. The calculation follows a strict order: short-term losses first offset short-term gains, then long-term losses offset long-term gains. If one category has a net loss and the other a net gain, they can cross-net. The resulting net capital loss (if any) can offset up to 3,000 of ordinary income, with the remainder carrying forward indefinitely.

net ST gain = ST gains - ST losses
net LT gain = LT gains - LT losses
combined = net ST gain + net LT gain
if combined negative:
  ordinary income offset = min(3000, abs(combined)) + carryforward
  carryforward next year = max(0, abs(combined) - 3000)
tax savings = ordinary income offset x (marginal rate / 100)

Worked example

ST gains $8,000, LT gains $15,000, ST losses $5,000, LT losses $10,000, ordinary income $95,000, federal rate 24%:

  1. Net ST gain = 8,000 - 5,000 = $3,000
  2. Net LT gain = 15,000 - 10,000 = $5,000
  3. Combined = 3,000 + 5,000 = $8,000 net gain
  4. No loss to offset ordinary income. All $8,000 is taxable capital gain.
  5. Tax on $8,000 capital gain at 24% = $1,920

Worked example with net loss

Same as above but with $25,000 LT losses instead of $10,000:

  1. Net ST gain = 8,000 - 5,000 = $3,000
  2. Net LT gain = 15,000 - 25,000 = -$10,000
  3. Combined = 3,000 - 10,000 = -$7,000 net loss
  4. Ordinary income offset = min(3,000, 7,000) = $3,000
  5. Carryforward to next year = 7,000 - 3,000 = $4,000
  6. Tax savings = 3,000 x 0.24 = $720

Key rules and timing considerations

Tax-loss harvesting is most effective when you have capital gains in the same year. If you have no gains, you can still use losses to reduce ordinary income by up to 3,000, but this is a slower process if you have large losses. The strategy works best for investors with diversified portfolios, because some holdings will often be down while others are up, allowing you to harvest losses without dismantling your asset allocation.

Timing is critical because capital losses are per-calendar-year. December harvesting decisions are final once the year ends. If you think you will have more gains later in the year, it may be worth waiting to harvest in December when you know your full picture. Conversely, if you have a quiet market, do not forget to harvest losses before December 31st.

The wash-sale rule is enforced by the IRS. If you sell a security at a loss on December 15 and buy it back on December 20, the loss is disallowed. The 30-day window covers 30 days before the sale and 30 days after (61 days total). To avoid triggering the rule, use a similar but substantially different security (e.g., a different fund in the same asset class or a different issuer). Your tax professional can advise on what qualifies as substantially identical.

Tax-loss harvesting: frequently asked questions

What is tax-loss harvesting?

Tax-loss harvesting is the deliberate sale of an investment at a loss to realize the loss for tax purposes. The loss is then used to offset capital gains from other investments or (if losses exceed gains) up to 3,000 of ordinary income in a tax year. Any excess loss carries forward indefinitely to future years. The goal is to reduce your total tax bill while maintaining your desired portfolio allocation.

Why can I only deduct 3,000 in net capital losses against ordinary income?

IRC Section 1211(b) limits net capital losses to 3,000 per tax year when offsetting ordinary income. This limitation was intended to prevent high-income taxpayers from using large investment losses to wipe out all their wages. Any losses beyond the 3,000 cap carry forward indefinitely to the next year, where they can be used again (subject to the same 3,000 limit). This carry-forward right means no loss is ever truly wasted.

What is the wash-sale rule?

The wash-sale rule (IRC Section 1091) disallows a loss on a security if you buy the same or substantially identical security within 30 days before or after the loss sale. The 30-day window is 30 days before the sale and 30 days after (a 61-day window total). The disallowed loss is not lost; instead, it is added to the cost basis of the replacement shares, so you recover the tax benefit when those shares are eventually sold. To cleanly harvest a loss, wait at least 31 days after selling before repurchasing.

How does the netting order work?

The IRS uses a specific order: short-term losses offset short-term gains first, then long-term losses offset long-term gains. If one category has a net loss and the other a net gain, they net together. The combined result is your net capital gain or loss for the year. If the result is a net loss, you can deduct up to 3,000 against ordinary income, and the remainder carries forward.

What investments can I harvest losses from?

You can harvest losses from any investment you own: stocks, ETFs, mutual funds, bonds, or any other security. The capital asset must be a capital asset held in an investment account. You cannot harvest losses from a personal residence, vehicles or property held for personal use (those are not capital assets). Losses from inherited investments are treated the same way as any other capital loss.

Should I reinvest the proceeds from a loss harvest?

Yes, most investors who use tax-loss harvesting do reinvest the proceeds to maintain their target asset allocation. The tax savings effectively become a gift to the portfolio. For example, if you sell 10,000 of a security at an 8,000 loss and reinvest the 10,000 proceeds in a similar (but not substantially identical) security, you harvest the 8,000 loss tax-free while staying fully invested. Some investors use that savings to rebalance into an underweight position.

Official sources

Reviewed by the CalculatorHub team, edited by James Graham, 13 June 2026. See our methodology. General information, not financial or tax advice.