Year-End Loss Harvest Maximizer
Finds every lot you can sell at a loss without realizing a gain, holding back a lot when other shares of the same stock were bought in the last 30 days.
Estimated tax benefit from harvesting $201,499 of losses across 8 lots in a $537k sample portfolio.
Precomputed on the sample portfolio as of May 15, 2026.
See it on a sample portfolio
Pick a sample portfolio to see what the tool returns. Every number comes from the tool's own code, run offline ahead of time; nothing is calculated in your browser. Sort the table, or download it as a CSV file to check the figures yourself.
A 12-name large-cap book with a mix of winners and laggards. Several positions were entered near recent local highs and now sit on five-figure unrealised losses. 12 lots · $536,606 portfolio value
Not modelled in this demo yet: Tracking-error drift cap and Maximum realized gains. The tool accepts them, but they change no number below.
Selling the 8 lots below realizes $201,499 of capital losses, which can offset gains realized this year. The wash-sale check holds back no lot: no other shares of these stocks were bought in the 30 days before the sale.
| Loss realized, as a bar | ||||||
|---|---|---|---|---|---|---|
| PYPL | Long-term | 20% | 350 | $60,095 | $12,019 | |
| DIS | Long-term | 20% | 400 | $32,560 | $6,512 | |
| PFE | Long-term | 20% | 1,200 | $28,200 | $5,640 | |
| NKE | Long-term | 20% | 300 | $25,770 | $5,154 | |
| NFLX | Long-term | 20% | 150 | $21,330 | $4,266 | |
| INTC | Long-term | 20% | 800 | $21,120 | $4,224 | |
| COIN | Long-term | 20% | 80 | $6,664 | $1,333 | |
| WBA | Short-term | 37% | 800 | $5,760 | $2,131 |
Select a column heading to sort; each bar compares a lot's realized loss with the largest.
- Wash-sale check: a losing lot is held back when other shares of the same stock in this sample portfolio were bought in the 30 days before the sale. The demo does not look for purchases in the 30 days after the sale, in other accounts, by a spouse, or of other substantially identical securities. It also judges each lot on its own and holds back the whole lot, even when fewer shares were bought or those shares are sold in the same harvest.
- The tracking-error drift cap is accepted but not enforced in this demo. Comparing tracking error before and after the harvest needs a benchmark and a factor risk model, which the demo does not use.
Precomputed offline by the tool's Python code for these sample portfolios at the tool's standard inputs. Nothing is calculated in your browser.
A capital loss realized this year offsets gains realized this year, and what is left can carry forward. The tool shows how much loss a portfolio holds that could be banked now without selling any winners. It holds back a losing lot when other shares of the same stock were bought in the last 30 days, since that purchase would make the sale a wash sale.
maximize Σᵢ lossᵢ × xᵢ loss realized
subject to xᵢ = 0 if lot i is at a gain no gains realized
xᵢ = 0 if other shares of lot i's stock
were bought in the last 30 days
0 ≤ xᵢ ≤ 1 share of lot i sold
solved exactly: sell every other losing lot in full,
largest loss first
tax benefit = Σᵢ lossᵢ × xᵢ × rateᵢ
rate = 20% long-term, 37% short-termWith no budget or risk limit in play, the most loss a portfolio can bank is simply every eligible losing lot, sold in full. The wash-sale check looks only at purchases of the same stock in the sample portfolio in the 30 days before the sale. It does not look for purchases in the 30 days after the sale, in other accounts or by a spouse, or of substantially identical securities (ones so similar that the tax rules treat them as the same), which the full wash-sale rule also covers. It also judges each lot on its own and holds back the whole lot, even when fewer shares were bought or those shares are sold in the same harvest.
No solver is involved. The tool sorts the lots and works down the list. Each loss is priced with LotWise's US tax engine at the top federal income-tax rate for its kind: 20% long-term and 37% short-term. The demo leaves out the 3.8% net investment income tax, which also applies to investors in the top brackets, so every tax figure here is lower than it would be with that tax included. The tool runs offline, ahead of time, on the sample portfolios; this page shows the saved results.
- Lots with cost and purchase date
A lot's cost decides whether it is at a loss, and its purchase date whether the loss is short-term or long-term. Purchase dates also drive the wash-sale check: a losing lot is held back when other shares of the same stock were bought in the 30 days before the sale.
- Tracking-error drift cap
Accepted but not applied in this demo yet.
- Maximum realized gains
Accepted but has no effect yet: the tool never sells a lot at a gain.
- Sell list
Stock, term, shares, loss realized and tax benefit for each lot sold.
- Lots held back
Losing lots the wash-sale check holds back, each with its reason: other shares of the same stock were bought in the 30 days before the sale. Listed only when there are any.
- Totals
Loss realized and estimated tax benefit, at 20% for long-term and 37% for short-term losses.
- Long-term and short-term losses
- A lot is at a loss when its price is below what was paid per share. Held more than a year, the loss is long-term; otherwise it is short-term. The tool values each loss at the top federal income-tax rate for its kind, 20% long-term and 37% short-term (before the 3.8% net investment income tax), as if it offsets a gain of the same kind.
- The wash-sale check
- Under the wash-sale rule, a loss is disallowed if other shares of the same or a substantially identical security are bought within 30 days before or after the sale; the disallowed loss is added to the cost basis of those shares. Selling the very shares you just bought is not itself a wash sale. The tool holds back a losing lot when other shares of the same stock in the sample portfolio were bought in the 30 days before the sale, and lists it with the reason.
- What it does not do yet
- It does not buy replacement stocks, measure tracking error, or check purchases made after the sale, in other accounts, or of substantially identical securities. When it holds a lot back, it holds back the whole lot, even if fewer shares were bought. The drift cap and the gain cap are accepted as inputs but change nothing yet.
Tracking-error drift cap
The most the harvest would be allowed to push up the portfolio's tracking error, which measures how far its returns stray from its benchmark.
Not applied in this demo yet: comparing tracking error before and after the harvest needs a benchmark and a factor risk model, which the demo does not use. Once applied, it would add the limit above, which could hold back some sales.
A tight cap would keep the portfolio close to its benchmark but leave some losses unharvested. A loose cap would bank more loss, at the cost of drifting further from the benchmark until the sold stocks can be bought back.
A quarter-by-quarter selling schedule that trims an overweight portfolio inside a yearly budget for realized gains.
Picks the appreciated lots to give so that a gift of stock avoids the most capital-gains tax.
The results on this page were computed ahead of time by the tool's Python code, on sample portfolios at the tool's standard inputs, and saved with the site. Output is illustrative and is not investment or tax advice.