Solved.tools: Free Online Calculators & Tools

We use cookies for analytics and advertising. Learn more about our cookie policy

Tax-Loss Harvesting Calculator

Last updated: 5 July 2026

Reviewed by Gavin Meiring, Lead research and primary author ยท Doctoral Candidate (Corporate Governance) ยท Research and drafting assisted by AI

Was this helpful?


Tax Loss Harvesting Calculator

A tax loss harvesting calculator works out the realized losses available to offset capital gains and ordinary income when you sell an investment at a loss. It is used by taxable investors, robo-advisors with tax-loss features, financial advisors managing client portfolios, and active traders seeking to reduce their tax burden through strategic loss realization.

Tax loss harvesting is the practice of intentionally realizing losses on investments to offset capital gains elsewhere in the portfolio, plus up to $3,000 of ordinary income per year, with excess losses carried forward to future years. The benefit is highest in taxable accounts during high-income years when offsetting gains or income at high marginal tax rates. The risk is the IRS "wash sale" rule, which disallows the loss if you buy the same or substantially identical security within 30 days.

How to Use the Tax Loss Harvesting Calculator

  1. Enter your realized capital gains for the year (from sales of appreciated positions).
  2. Enter your realized capital losses for the year (from sales of depreciated positions).
  3. The calculator nets the gains and losses: short-term against short-term, long-term against long-term, then short-term against long-term if there's a net in either category.
  4. It computes the net capital loss available to offset ordinary income (capped at $3,000 per year, $1,500 if married filing separately).
  5. It shows the carryforward for any losses beyond the $3,000 ordinary income offset, which can be used in future years.
  6. Optionally, enter your marginal tax rate to estimate the tax savings from harvesting.

The Formula

Net Capital Loss = (Short-term Gains - Short-term Losses) + (Long-term Gains - Long-term Losses)

If both net results are losses:

  • Short-term loss offsets long-term gain first
  • Up to $3,000 of net capital loss can offset ordinary income ($1,500 if married filing separately)
  • Excess loss carries forward indefinitely

If you have net capital gain (gains exceed losses):

  • Short-term gains taxed at ordinary income rates
  • Long-term gains taxed at 0%, 15%, or 20% depending on income

The Wash Sale Rule

The IRS wash sale rule disallows a loss if you buy the same or "substantially identical" security within 30 days before or after the sale. This means you can't sell an S&P 500 index fund at a loss and immediately buy the same fund, the loss is disallowed and added to the cost basis of the new shares.

To avoid wash sales while still harvesting losses, buy a similar but not identical security. For example, if you sell SPY (State Street's S&P 500 ETF) at a loss, you can buy VOO (Vanguard's S&P 500 ETF) or IVV (iShares' S&P 500 ETF), these track the same index but are different securities, so the wash sale rule doesn't apply.

When to Harvest Losses

The optimal times to harvest losses:

  • Year-end: Many gains have accumulated; harvesting creates offset
  • Portfolio rebalancing: If you wanted to reduce a position anyway, selling at a loss has a tax benefit
  • Market downturns: Broad market drops create loss-harvesting opportunities across many positions
  • Concentration reduction: If a position has grown too large, selling some at a loss reduces both concentration and tax

The downside: you lose the potential rebound of the sold position. The math is favorable if the tax savings exceed the expected foregone appreciation.

Frequently Asked Questions

How much can I deduct from capital losses? You can offset all capital gains with capital losses, and up to $3,000 of ordinary income per year ($1,500 if married filing separately). Excess losses carry forward indefinitely to future tax years, where they can offset gains or another $3,000 of ordinary income.

What is the wash sale rule? The wash sale rule disallows a capital loss if you buy the same or "substantially identical" security within 30 days before or after the loss sale. The disallowed loss is added to the cost basis of the replacement security, deferring the benefit until you eventually sell the replacement. The rule applies across accounts, a loss sale in one account with a buy in another account (or your spouse's account or IRA) can trigger the rule.

How much in tax savings from harvesting? Tax savings equal the harvested loss times your marginal tax rate. Harvesting $5,000 in long-term losses when your long-term capital gains rate is 15% saves $750. Harvesting $5,000 in short-term losses at a 32% marginal rate saves $1,600. The savings are realized when you file your tax return, but only if you can use the losses (offsetting gains or within the $3,000 ordinary income limit).

Can I harvest losses in my IRA? Losses in a traditional IRA are not tax-deductible (the IRA contribution may be, but realized losses inside the IRA are not). Roth IRA losses are also not tax-deductible. Tax loss harvesting only works in taxable brokerage accounts, not in retirement accounts.

Is tax loss harvesting worth the hassle? For taxable accounts with $50,000+ in unrealized losses and the investor in a high tax bracket, harvesting can save $1,000 to $5,000+ per year. For smaller accounts or lower brackets, the savings may not justify the tracking complexity. Most robo-advisors (Wealthfront, Betterment, Schwab) automate tax loss harvesting for accounts over $50,000.

How do I track the cost basis across many lots? Most brokers track cost basis automatically and report it on Form 1099-B. For specific lot identification, you can specify which lots to sell at the time of sale (specific share identification) rather than defaulting to first-in-first-out. This lets you harvest specific lots with losses while keeping lots with the lowest unrealized gains. Specific share identification requires notifying your broker at the time of sale, not at tax filing time, most brokers allow this via their online trading platform's "tax lot selection" feature. For mutual fund positions, similar rules apply: you can specify which shares to redeem (typically by date or by dollar amount). Keep records of all purchase lots (date, price, quantity) and sale lots (date, price, quantity, which purchase lot matched) for at least 3 years after the tax year of the sale. The wash sale rule also requires tracking purchases within 30 days of the loss sale to ensure the loss is not disallowed.

Are cryptocurrency losses harvestable? Yes, since the IRS classifies crypto as property, losses on crypto are capital losses and can be harvested under the same rules as stocks. However, crypto-specific complications: (1) Crypto exchanges have varying 1099-B reporting quality; some don't report at all, requiring manual tracking. (2) Crypto-to-crypto trades are taxable events (creating capital gains or losses), not just crypto-to-fiat trades. (3) Staking rewards and airdrops are taxable as ordinary income at receipt, with cost basis = fair market value at receipt. (4) Defi and NFT transactions have ambiguous tax treatment, the IRS hasn't issued clear guidance, so consult a tax professional. The high volatility of crypto creates more harvesting opportunities than traditional stocks but also more tracking complexity.

Inputs and Their Effects

Each field on the Tax Loss Harvesting Calculator form plays a distinct part in the calculation.

  • your realized capital gains for the year (from sales of appreciated positions) - this value feeds the Tax Loss Harvesting Calculator directly and shows up in the result.
  • your realized capital losses for the year (from sales of depreciated positions) - this value feeds the Tax Loss Harvesting Calculator directly and shows up in the result.
  • It computes the net capital loss available to offset ordinary income (capped at $3,000 per year, $1,500 if married filing separately) - this value feeds the Tax Loss Harvesting Calculator directly and shows up in the result. Editing one field of the Tax Loss Harvesting Calculator changes the output in line with the formula, so a misplaced value is visible in the answer.

Common Mistakes to Avoid

The errors that come up most often with the Tax Loss Harvesting Calculator are easy to spot once you know them:

  • Entering a value in the wrong unit for your realized capital gains for the year (from sales of appreciated positions); the Tax Loss Harvesting Calculator answer is only right when the unit matches the label.
  • Mixing conventions, such as percentages and decimals, where the Tax Loss Harvesting Calculator formula expects one form.
  • Rounding the inputs before the Tax Loss Harvesting Calculator runs; keep the full values and let the tool round the final answer.
  • Treating the Tax Loss Harvesting Calculator result as exact when the inputs themselves were estimates.

When to Use the Tax Loss Harvesting Calculator

Use the Tax Loss Harvesting Calculator whenever you need a quick, reliable answer that fits the tool's scope. Common situations for the Tax Loss Harvesting Calculator include homework and study, on-the-job quick checks, sanity-checking a more complex calculation, or exploring a scenario for personal interest. If the Tax Loss Harvesting Calculator answer will be used for a decision that has legal, medical, or financial consequences, treat the result as a starting point and verify it with a qualified professional.

How the Math Works

The calculation behind the Tax Loss Harvesting Calculator follows the standard form for this kind of problem: Net Capital Loss = (Short-term Gains - Short-term Losses) + (Long-term Gains - Long-term Losses) If both net results are losses: Short-term loss offsets long-term gain first Up to $3,000 of net capital loss can offset ordinary income ($1,50 The Tax Loss Harvesting Calculator applies that relationship in the order the algebra prescribes, converting inputs to consistent units first where the formula needs them.

Practical Tips

A few habits keep the Tax Loss Harvesting Calculator results reliable:

  • Confirm each input matches the label, especially your realized capital gains for the year (from sales of appreciated positions) and your realized capital losses for the year (from sales of depreciated positions) if both are present.
  • Work in one unit system throughout the Tax Loss Harvesting Calculator instead of converting mid-way by hand.
  • Sanity-check the Tax Loss Harvesting Calculator output against a rough estimate before relying on it.
  • Keep a note of the values you used so the Tax Loss Harvesting Calculator calculation can be reproduced later.

Worked Examples

A typical Tax Loss Harvesting Calculator run takes reasonable inputs, produces a sensible answer, and returns it in a single click. Example: Beyond the worked examples earlier in this page, a few additional cases illustrate how the Tax Loss Harvesting Calculator behaves at the edges of its input range. Boundary inputs. Entering the smallest sensible value or the largest sensible value for a numeric input should produce a result at the corresponding end of the output range, not a runaway value

References