Tax-Loss Harvesting Calculator
How much could tax-loss harvesting save you?
This describes the federal rules for individuals. It is not tax advice.
What is tax-loss harvesting?
Tax-loss harvesting is the practice of selling an investment for less than its cost basis and using that realized loss to offset a realized capital gain elsewhere in the same tax year, or, within limits, to offset ordinary income. The loss only counts for tax purposes once the position is actually sold. An unrealized loss sitting in a portfolio does nothing on a tax return until it is locked in by a sale, which is why harvesting is a decision about timing a sale, not a prediction about where a security is headed next. It works the same way whether the loss comes from a single stock, a fund, or a crypto position, since the federal rules apply to capital assets generally.
How losses net against gains
Losses and gains do not net against each other freely. Short-term results, on positions held one year or less, are netted against each other first, producing a single net short-term gain or loss for the year. Long-term results, on positions held more than one year, are netted separately, producing a single net long-term gain or loss. Only after each bucket has its own net figure are the two combined against each other: a net short-term loss offsets a net long-term gain, and a net long-term loss offsets a net short-term gain. The order matters because short-term gains are taxed at ordinary income rates while long-term gains get lower preferential rates, so a dollar of short-term loss is worth more when it offsets a short-term gain than when it offsets a long-term one, and a taxpayer harvesting losses to target a specific gain needs to track which bucket that gain sits in.
The annual deduction limit and carryover
If losses still exceed gains after all of that netting, the remainder can be deducted against ordinary income, but only up to $3,000 a year, or $1,500 for a married individual filing a separate return, under 26 U.S. Code §1211(b). Anything beyond that annual cap is not lost. It carries forward into future tax years, keeping its original short-term or long-term character, under 26 U.S. Code §1212(b), with no limit on how many years it can carry forward. A large loss realized in one year can therefore keep producing deductions and offsets for years afterward, a year at a time.
The wash sale rule
A realized loss can still be disallowed by the wash sale rule. Under 26 U.S. Code §1091, a loss is disallowed if the taxpayer acquires, or enters a contract or option to acquire, substantially identical stock or securities within the 30 days before the sale or the 30 days after it, a 61-day window centered on the sale date. The rule applies across accounts, including an IRA, and to purchases made by a spouse filing jointly, not only the account where the sale happened. A disallowed loss is not erased. It is added to the cost basis of the replacement shares, so it is deferred rather than lost outright. Helm Terminal, the product this calculator is part of, runs this 30-day lookback automatically across the brokerage accounts a user links, as part of its paid Pro plan; this calculator itself is free and needs no account.
Why harvesting mostly defers tax, not eliminates it
Harvesting a loss rarely eliminates a tax bill outright. If the proceeds are reinvested in a similar, but not substantially identical, position to preserve market exposure, that replacement carries the same lower cost basis as the position that was sold. When the replacement is eventually sold at a gain, the built-in gain is measured from that lower basis, so more of the eventual sale price is taxable than it would have been without harvesting. For an investor who keeps reinvesting rather than pulling money out of the market, the practical effect of harvesting is usually to move a tax bill from the current year into a future one, when the deferred gain is finally realized, rather than to remove the bill entirely.
A worked example
An investor who realizes an $8,000 long-term loss and a $5,000 long-term gain in the same year nets them against each other first, leaving a $3,000 net long-term loss. With no other gain that year to absorb it, the full $3,000 is deducted against ordinary income, the maximum allowed under section 1211(b), and nothing carries forward, since the loss and the annual limit happen to match exactly. If the loss had instead been $12,000 against the same $5,000 gain, the net loss would be $7,000: $3,000 deducted against ordinary income this year, and the remaining $4,000 carried forward as a long-term capital loss into next year under section 1212(b), available to offset a future gain or, again subject to the annual limit, more ordinary income.
Frequently asked questions
What is tax-loss harvesting?
Tax-loss harvesting is selling an investment for less than its cost basis and using the realized loss to offset a realized capital gain, or, within limits, ordinary income, in the same tax year. The loss has to be realized through an actual sale; a paper loss on a position still held does not count. It is a federal individual income tax mechanism, not investment advice about which position to sell.
How much capital loss can you deduct per year?
After netting all short-term and long-term gains and losses for the year, up to $3,000 of any remaining net capital loss can be deducted against ordinary income, or $1,500 for a married individual filing a separate return, under section 1211(b). Any loss beyond that annual limit is not lost; it carries forward to future tax years under section 1212(b).
Does tax-loss harvesting reduce taxes or defer them?
For most investors who reinvest the proceeds, harvesting mostly defers tax rather than eliminating it, because the replacement position takes on the same lower cost basis, so a future sale of the replacement produces a larger taxable gain than it otherwise would. The immediate benefit is real: current-year tax is lower. Whether the deferral becomes permanent depends on what happens to the replacement position afterward.
What is the wash sale rule?
The wash sale rule disallows a loss deduction if the taxpayer buys the same security, or one that is substantially identical, within 30 days before or 30 days after the sale that produced the loss, under section 1091. That creates a 61-day window centered on the sale date. A disallowed loss is not lost permanently; it is added to the cost basis of the newly purchased shares.
Can capital losses be carried forward?
Yes. Any net capital loss beyond the annual deduction limit carries forward to future tax years, keeping its short-term or long-term character, under section 1212(b), with no limit on how many years it can be carried forward. It can offset gains in a later year or, again subject to the annual limit, be deducted against ordinary income.
When does tax-loss harvesting produce a saving?
It produces a saving in the year it is used, either by reducing tax on a gain realized that year or by lowering taxable ordinary income up to the annual limit. The saving tends to be larger when it offsets a short-term gain, which is taxed at ordinary rates, than when it offsets a long-term gain taxed at the lower preferential rates. Whether that saving compounds over time depends on what happens to any replacement position bought with the proceeds.