b2KIT

Tax-Loss Harvesting Calculator

Calculate tax savings from harvesting investment losses against gains with wash sale rules, carryover limits, and optimal pairing.

Tested tool guide Tested browser tools Checked August 16, 2026

What Tax-Loss Harvesting Calculator does, with a checked example

Selling a losing investment is only worth it if you know what the loss is actually worth, and most people guess wrong: the loss does not save you its full value, and the wash sale rule can silently erase it. The tool nets your realized gains and losses for the year, applies the $3,000 annual cap on deductions against ordinary income, carries the remainder into future years, and flags any repurchase inside the 30-day wash sale window. It also shows which losses to realize first, because a loss offsets short-term gains taxed at ordinary rates before it touches lower-taxed long-term gains.

Worked example

A concrete input and expected output from the current implementation.

Input

Long-term gains: $6,000
Long-term losses: $10,000
Short-term gains: $0
Short-term losses: $0
Filing status: Single
Taxable income: $80,000

Expected output

Net long-term loss: $4,000. Deductible against ordinary income this year: $3,000 at your 22% marginal rate = $660 tax saved. Carryover to future years: $1,000 (worth about $220 at the same rate). Wash sale check: no repurchase of the sold positions within 30 days of the sale - no issues.

The $10,000 loss first cancels the $6,000 long-term gain, leaving a $4,000 net loss. Only $3,000 can be deducted against ordinary income per year, so the saving is $3,000 times the 22% marginal rate for a single filer at $80,000 taxable income, and the remaining $1,000 carries forward.

How the result is produced

1

Netting order and the $3,000 cap

Short-term losses first offset short-term gains and long-term losses offset long-term gains; a net loss of one type then offsets gains of the other. The tool applies the remaining net loss against ordinary income up to $3,000 per year ($1,500 married filing separately) and carries the rest forward indefinitely, using short-term carryovers first. Tax saved is the deducted amount times your marginal ordinary rate.

2

Wash sale window

A loss is disallowed if you acquire substantially identical securities 30 days before through 30 days after the sale - a 61-day window. The tool flags any harvest with a repurchase inside the window, counting both sides of the sale date. The disallowed loss is not forfeited: it is added to the replacement shares' cost basis and comes back when you eventually sell those shares.

Good uses

  • Late in the year, after selling a big winner, to figure out which losing positions to sell - and how much of them - so realized losses cancel the tax on the gain without creating a wash sale.
  • When a holding has fallen sharply and you want out anyway: sell it now to bank the loss, and if you still want the position, buy it back 31 days later.
  • When your losses run far ahead of your gains, to see how many years the carryover will last at the $3,000-per-year pace and what it is worth each year.

Limits and checks

  • Everything depends on your year-end numbers. Taxable income, and any gains you realize later, can change your marginal rate or consume the $3,000 cap differently than planned, so a mid-year estimate is provisional.
  • Substantially identical has no bright-line test. The same stock or fund clearly qualifies, but borderline cases - an ETF versus the mutual fund tracking the same index - are decided case by case by the IRS, and no calculator can guarantee the outcome.
  • The headline savings assumes your marginal rate holds. If the loss pushes you into a lower bracket, the last dollars save less. State treatment also diverges: New Jersey allows losses only against gains, and Pennsylvania does not allow the deduction at all, so the federal figure overstates the benefit there.

Common questions

I sold a losing stock on Monday. When can I buy it back and still claim the loss?

Not for 30 days after the sale. Buying substantially identical shares any time from 30 days before to 30 days after the sale triggers the wash sale rule, and the loss is disallowed for this year. It is not gone - it attaches to the new shares' basis - but if you want the deduction now, wait 31 days after selling.

What happens to losses I can't use this year?

They carry forward to future years with no expiration. Carryover losses offset future capital gains first, then up to $3,000 of ordinary income per year, with short-term carryovers used before long-term ones. A big harvest can take years to pay off at that pace, which is worth weighing before you sell.

References and verification

The example and behavioral notes were checked against the browser implementation. Standards and primary references below define the relevant format, formula, or platform behavior.

Related Tools