Tax-Loss Harvesting Calculator. Selling a stock at a loss feels bad, but the tax-loss harvesting calculator on this page shows how that investment loss can offset gains and shrink your taxes. Enter the capital gains you have already realized, the losses you are thinking about selling, and your rates, and you will see your estimated tax savings before you place a single trade. Below, you will learn the formula, a full worked example, and the rules that can quietly undo the benefit. The income tax calculator uses the same plain-English approach, so you can compare results side by side.
Estimated tax savings
Net tax savings for 2026
–
Loss harvested
–
Savings per dollar of loss
–
Federal income tax saved
–
State income tax saved (estimate)
–
Net investment income tax saved
–
Trading costs
–
Loss used against capital gains
–
Loss used against ordinary income
–
Loss carried forward to 2027
–
Wash sale window
Don't buy the same or a substantially identical security from
–
through
–
Earliest repurchase date
–
Federal tax without and with the harvest
2026 federal brackets and capital gains rates. Excludes credits, the alternative minimum tax and special 25% and 28% gain categories.
Item
Without harvesting
With harvesting
Results are estimates for educational purposes and are not financial, tax or legal advice.
Tax-Loss Harvesting Calculator. Selling a stock at a loss feels bad, but the tax-loss harvesting calculator on this page shows how that investment loss can offset gains and shrink your taxes. Enter the capital gains you have already realized, the losses you are thinking about selling, and your rates, and you will see your estimated tax savings before you place a single trade. Below, you will learn the formula, a full worked example, and the rules that can quietly undo the benefit. The income tax calculator uses the same plain-English approach, so you can compare results side by side.
How a Tax-Loss Harvesting Calculator Estimates Your Tax Savings
Every investor who sells winners during the year owes capital gains tax on the profit, and the taxes on capital gains add up quickly. A tax-loss harvesting tool compares two versions of your year: one where you keep every losing position, and one where you sell the underperforming holdings and let each realized loss absorb part of your gains. The difference between the two tax bills is your estimated tax benefit. The dividend tax calculator uses the same plain-English approach, so you can compare results side by side.
The calculator needs only a handful of inputs, and every one of them is a number you can pull from your brokerage statement or year-to-date gain and loss report.
Input
What it means
Where to find it
Short-term gains
Profit on assets held one year or less
Brokerage realized gain and loss report
Long-term gains
Profit on assets held more than one year
Brokerage realized gain and loss report
Short-term losses to harvest
Unrealized losses on lots held one year or less
Open tax lot view for each holding
Long-term losses to harvest
Unrealized losses on lots held more than one year
Open tax lot view for each holding
Short-term tax rate
Your ordinary income bracket
Last year's return or current tax bracket tables
Long-term tax rate
0%, 15% or 20% for most investors
Taxable income against the long-term thresholds
The tax-loss harvesting formula
Losses are netted in a strict order. Short-term losses meet short-term gains first, long-term losses meet long-term gains first, and any leftover loss in one bucket then crosses over to the other. Once both buckets are netted, the result is taxed at the matching rate:
$$\text{Tax savings} = \text{Tax before harvesting} - \text{Tax after harvesting}$$
Where one bucket nets to a loss and the other to a gain, the two are combined first, and the remaining gain is taxed at the long-term rate when the long-term bucket holds the final gain. If the combined result is still a loss, up to $3,000 of it reduces ordinary income ($1,500 for married couples filing separately), and anything beyond that is carried forward to the next tax year.
How Tax Loss Harvesting Works Step by Step
Understanding how tax loss harvesting works makes the calculator's output far easier to trust. The process has four moves, and the order matters. Next, open the taxable vs tax-deferred calculator and enter your own details to see an estimate in seconds.
Sell the loser. You sell a position whose sale price sits below your cost basis, which locks in a capital loss for the current tax year.
Net it against gains. The loss is used to offset capital gains of the same type first, then gains of the other type, which lowers the capital gains taxes you owe.
Reinvest the proceeds. You reinvest the cash in shares of a similar but not substantially identical holding so your market exposure and asset allocation stay close to target.
Carry the rest forward. Any loss that is still unused goes into a loss bank that you can carry forward year after year.
The strategy defers tax rather than erasing it: harvesting lowers your cost basis in the replacement holding, so a larger gain is waiting when you eventually sell. Even so, deferral has real value, because money you do not send to the IRS this year keeps compounding in your portfolio.
Why harvesting losses supports rebalancing
Harvesting losses and rebalancing pull in the same direction: the replacement trade moves your allocation back toward target while the loss becomes tax-deductible against gains, which is the amount the calculator estimates. That is why many tax-efficient plans pair harvesting reviews with their allocation check-ups.
Worked Example: Harvesting Losses on a Mixed Portfolio
Consider an investor with a taxable brokerage account who realized gains earlier in the year and now wants to see the effect of harvesting losses in December. This hypothetical case uses a 32% short-term rate and a 15% long-term rate.
Item
Amount
Realized short-term gains
$6,200
Realized long-term gains
$14,650
Short-term losses harvested
$11,840
Long-term losses harvested
$4,320
Short-term rate
32%
Long-term rate
15%
Tax before harvesting
Without any sales at a loss, the short-term gains cost \(6{,}200 \times 0.32 = \$1{,}984\) and the long-term gains cost \(14{,}650 \times 0.15 = \$2{,}197.50\), for a total of $4,181.50.
Tax after harvesting
The short-term bucket nets to \(6{,}200 - 11{,}840 = -\$5{,}640\), a loss. The long-term bucket nets to \(14{,}650 - 4{,}320 = \$10{,}330\), a gain. Because the short-term loss spills over, it reduces the long-term gain to \(10{,}330 - 5{,}640 = \$4{,}690\). At 15%, that remaining gain produces a tax bill of $703.50.
How harvested losses net against realized gains in the worked example, leaving $4,690 to tax.
Step
Calculation
Result
Tax before harvesting
$1,984.00 + $2,197.50
$4,181.50
Net short-term
$6,200 − $11,840
−$5,640
Net long-term
$14,650 − $4,320
$10,330
Combined taxable gain
$10,330 − $5,640
$4,690
Tax after harvesting
$4,690 × 15%
$703.50
Estimated tax savings
$4,181.50 − $703.50
$3,478.00
The harvest cut this investor's effective tax rate on $20,850 of gains from about 20.1% to 3.4%. Notice that the $11,840 short-term loss did double duty: it wiped out every dollar of the expensive 32% gains and then reduced the cheaper 15% bucket as well.
The same gains and rates produce a $3,478.00 lower tax bill once the losses are harvested.
When losses exceed gains
The calculator also handles the opposite case, where your capital losses are larger than everything you gained. Suppose you have only $4,000 of long-term gains but harvest $11,900 of long-term losses at a 32% bracket.
See how the Tax-Loss Harvesting Calculator works: change the inputs and the net tax savings for 2026 updates instantly. Enter your own numbers in the calculator above.
Step
Result
Net long-term result ($4,000 − $11,900)
−$7,900
Gains tax avoided ($4,000 × 15%)
$600
Deducted against ordinary income ($3,000 × 32%)
$960
Total savings this year
$1,560
Loss carried forward to next year
$4,900
Short-Term vs Long-Term Capital Gains Tax Rates
The holding period decides which rate table applies, and that is exactly why a harvested loss is not equally valuable in every bucket. Short-term capital gains come from assets held one year or less and are taxed as ordinary income, so they follow your marginal tax rate from 10% up to 37%. Long-term capital gains receive preferential tax treatment at 0%, 15% or 20% depending on your taxable income and filing status.
Gain type
Holding period
Federal tax rate
Short-term
One year or less
10% to 37% (ordinary-income rates)
Long-term
More than one year
0%, 15% or 20%
Why short-term losses are worth more
A dollar of short-term loss first erases a dollar of gain that would have been taxed at your full ordinary rate. In the worked example, that is a 32% saving per dollar instead of 15%. Capital gains of this kind are the most expensive to owe, and taxes on them fall fastest when you harvest. Whenever you have a choice of which lot to sell, the lot that creates a short-term loss usually delivers the larger tax benefit.
State taxes on capital gains and the net investment income tax
The calculator shows federal results, but your real tax liability may include more. Most states tax capital gains as regular income, so state taxes can raise the total taxes you pay and raise the value of every harvested dollar. High earners may also owe the 3.8% net investment income tax, which harvesting reduces by lowering net investment income. Add those percentages to your rate inputs for a fuller picture.
The Wash-Sale Rule and Other Limits on Loss Harvesting
The calculator assumes every harvested loss is allowed, so the wash-sale rule is the biggest trap: a wash sale would wipe out the estimate. If you buy the same or a substantially identical security within 30 days before or after the sale, the loss is disallowed for the current year, even if the investment itself clearly lost money. That creates a 61-day window around every sale, and it also covers purchases made in a spouse's account or an IRA.
Retirement accounts do not count as a harvest location. Losses inside your 401(k)s or other retirement accounts are not deductible, so the strategy only works in taxable accounts.
Replacement choice matters. Swapping an S&P 500 fund for a total market fund is a common approach, but where two funds track the same index, the IRS may treat them as substantially identical.
Automatic reinvestment can trigger a violation. A dividend reinvested inside the 30-day window can disallow part of a loss, and so can a decision to rebuy the same fund too early.
Transaction costs reduce the gain. Commissions and bid-ask spreads on thinly traded stocks or mutual funds come straight out of your savings.
Risks to weigh before you sell
Every strategy carries risk. Your replacement holding could rally while you are locked out of the original, or tax rates could rise and make the deferred gain more expensive later. A tax advisor or financial advisor can confirm how these tax implications apply to your situation, since this page is educational and not personal tax advice.
Running a Year-End Loss Harvesting Check on a Brokerage Account
Marguerite Oyelaran, a consultant in Denver, opens her brokerage account on December 9 and sees $23,410 of realized long-term gains from selling a stake in a semiconductor ETF in March. Her taxable income puts her in the 24% bracket for ordinary income and the 15% bracket for long-term gains, so that sale already carries about $3,511.50 in federal capital gains tax.
She reviews her open lots and finds two underperforming positions: a clean-energy fund lot bought in February showing a $7,285 short-term loss, and an older bond fund lot with a $5,140 long-term loss. She types $0 for short-term gains, $23,410 for long-term gains, $7,285 and $5,140 for the two losses, and 24% and 15% for her rates.
The result: the long-term loss cuts the long-term gain to $18,270, and the $7,285 short-term loss reduces it again to $10,985. At 15%, her tax falls to $1,647.75, which is $1,863.75 of tax savings. The estimate sits above the $1,500 she had set as her minimum to justify trading costs, so she moves ahead.
Before selling, she checks a rule the loss harvesting estimate cannot see: her dividend reinvestment plan on the clean-energy fund. She switches it off, sells both lots, and buys a broader clean-technology fund that tracks a different index. The loss harvesting estimate guided the decision, but the wash-sale check protected it.
Who Benefits Most from Tax-Gain Harvesting and TLH
Not every investor sees the same estimate. TLH pays off most for people with large realized gains, high ordinary-income brackets, and plenty of positions currently below cost, so the calculator returns its biggest results for them. A related idea, tax-gain harvesting, deliberately sells winners in a year when you fall in the 0% long-term bracket, resetting the cost basis at no federal cost.
Good candidates for harvesting
Investors who sold a concentrated position or a rental property and face a large one-time gain and heavy capital gains taxes.
Savers who hold many separate tax lot purchases made at different prices, giving more lots to choose from.
People in a high tax bracket, where each dollar of loss is worth the most.
Anyone with a stale carry forward balance who wants to use it up against new gains.
Poor candidates for harvesting
Holders in the 0% long-term bracket, who may owe no taxes on capital gains to begin with.
Investors whose positions are all in retirement accounts.
Anyone planning to repurchase the same security within 30 days.
Choosing Which Lots Give the Biggest Realized Loss
Whichever lot you pick, its loss is what you enter into the calculator's loss inputs, so the estimate reflects only the lots you actually plan to sell. Most brokerages default to first-in, first-out when you sell part of a position, which may not pick the lot you want. Ask for specific lot identification instead, so you can sell the highest-cost lot and book the biggest loss. Sorting open lots by unrealized loss, then by holding period, shows quickly which sale gives the most savings per trade. A few large losses are usually better than many tiny ones, because each trade carries costs and adds paperwork to your return.
Before you confirm anything, compare the loss you would book with the cost of the replacement trade and with the rate that loss will offset. A $400 long-term loss that offsets a 15% gain saves only $60, which a wide spread or a commission can erase.
Reporting Harvested Losses and Planning the Next Tax Year
You report sales on Form 8949 and total them on Schedule D, and your broker's 1099-B lists the cost basis and holding period for each lot. Residents of India report the same sales on Schedule CG instead. Keep your own record of any loss that is carried forward, because every investment sale adds to the record, and the unused amount follows you into later years until it is fully absorbed. Good tax planning treats harvesting as a repeating habit rather than a December scramble: review lots quarterly, track your remaining carryover, and revisit your rates each time your income changes.
Taxes on capital gains change every year, so each investment decision deserves a fresh look. Run the numbers again whenever your gains or losses move. A fresh estimate takes seconds, and it keeps your harvesting decisions tied to what the markets and your investment accounts are actually doing. Used this way, the calculator is a planning aid for investing more efficiently, not a reason to sell something you would otherwise keep.
Tax-Loss Harvesting Calculator questions
What is tax-loss harvesting?
Tax-loss harvesting means selling an investment that has dropped below what you paid, then using that realized loss to offset capital gains and, within limits, ordinary income. You usually reinvest the proceeds in a similar but not identical holding so your market exposure stays close to where it was.
How much of a loss can I deduct against ordinary income?
After your losses have cancelled all of your capital gains, up to $3,000 of the remainder can reduce ordinary income each year ($1,500 if you are married filing separately). Anything larger is carried forward to future tax years.
What is the wash-sale rule?
If you buy the same or a substantially identical security within 30 days before or after selling at a loss, the loss is generally disallowed for the current year. The calculator assumes your loss is allowed, so check the rule before you trade.
Does tax-loss harvesting work in a 401(k) or IRA?
No. Losses inside tax-deferred retirement accounts cannot be deducted, so harvesting only applies to investments held in a taxable brokerage account.
Why does the length of ownership matter?
Assets held one year or less produce short-term gains taxed at ordinary-income rates, while assets held longer receive lower long-term rates. A short-term loss usually offsets the more heavily taxed gains first, which is why the holding period changes the result.
Why is the TLH net benefit smaller than my tax savings today?
Harvesting lowers the cost basis of the replacement investment, so a larger gain is waiting when you finally sell. The net benefit shows what is left after that deferred tax, which is why a lower future tax rate or a longer holding period helps.
What does the estimated gain until final sale mean?
It is your expected growth, as a percentage, between now and the day you finally sell the replacement investment. A higher figure raises both final sale amounts and the final tax bill, so try a few values to see how sensitive the result is.
Is this calculator tax advice?
No. It gives an estimate from the numbers you enter and simplified federal brackets, and it does not model every rule such as the net investment income tax or deduction phase-outs. Confirm your own situation with a tax advisor.