Tax Loss Harvesting Calculator
Value a harvested capital loss: what it saves against this year's gains and up to $3,000 of ordinary income, and how much loss carries forward to next year.
Tax Loss Harvesting Calculator
Background.
A fund you bought for $100,000 is now worth $85,000. Selling it turns a paper loss into a realized $15,000 capital loss, and if you buy a similar but not identical fund with the proceeds, your market exposure barely changes. That is tax-loss harvesting: you keep roughly the same portfolio and collect a loss you can use on this year's return.
The loss is used in a fixed order. It first cancels capital gains you have realized during the year, saving whatever tax those gains would have cost. Any loss left after that can reduce ordinary income such as wages, but only by $3,000 a year, or $1,500 if you are married and file separately. Whatever still remains carries forward to later years, with no time limit.
The calculator prices that sequence. You enter the harvested loss and whether it is long-term or short-term, the long-term and short-term gains it can offset, your taxable income, the annual ordinary-income limit and two tax rates: one for long-term gains and one for ordinary income, which also taxes short-term gains. It returns the federal tax saved this year, the gains offset and the loss left to carry forward. In the default case, a $15,000 loss against $9,000 of long-term gains taxed at 15%, with income in the 24% bracket, saves $2,070 this year and leaves $3,000 for next year.
Harvesting mostly moves tax to a later year. The replacement fund was bought at $85,000, so when you eventually sell it, the gain is measured from that lower figure and the tax you avoided now comes back. The saving becomes permanent only in particular cases: when the loss offsets income taxed at a higher rate than the later gain will be, when the replacement is never sold during your lifetime, or when it is given to charity. The worked example puts numbers on that difference.
What is tax loss harvesting calculator?
Tax-loss harvesting is the deliberate sale of an investment held in a taxable account for less than its cost basis, so that the realized capital loss reduces the tax on other income. Under the rules in IRS Publication 550, capital losses are netted against capital gains first; if losses exceed gains, the excess is deductible against other income up to $3,000 a year ($1,500 married filing separately), and any unused amount carries forward indefinitely, keeping its short-term or long-term character. The technique works only in taxable brokerage accounts, because losses inside an IRA or 401(k) are not deductible. It is bounded by the wash-sale rule, which disallows the loss if you buy substantially identical securities within 30 days before or after the sale, and its value depends on the rates the loss displaces now and the rate the deferred gain will bear later.
How to use this calculator.
- In Realized capital loss harvested, enter the loss you have taken or plan to take: proceeds minus cost basis on each lot, as your broker's Form 1099-B or cost-basis screen reports it. Add any capital loss carried over from last year, since a carryover is treated as if incurred this year. A stock or bond that became completely worthless during the year counts too: it is treated as sold on the last day of the tax year, which also fixes whether the loss is short-term or long-term.
- In the gains boxes, enter the net long-term gains and the net short-term gains realized elsewhere in the year, including capital gain distributions from mutual funds and ETFs reported on Form 1099-DIV. Leave short-term gains at 0 if you have none.
- Leave Applicable annual ordinary-income loss limit at 3,000, or enter 1,500 if you are married filing separately.
- For Tax rate on long-term gains, enter 0%, 15% or 20% depending on your income, plus 3.8% if the net investment income tax applies. For the ordinary-income rate, use your marginal bracket; the calculator also uses it for short-term gains. Enter your taxable income before the loss so the deduction against wages is capped at what you can use.
- Before you sell, check that you have not bought, and will not buy, the same or substantially identical security within 30 days on either side of the sale, including in an IRA or a spouse's account.
The formula.
Let L be the harvested loss, G the long-term gains, S the short-term gains, C the annual ordinary-income limit, T your taxable income before the loss, g the tax rate on long-term gains and o the ordinary-income rate. A loss meets gains of its own character first, as Schedule D does: a long-term loss cancels min(L, G) of long-term gains, then min(L − that, S) of short-term gains; a short-term loss does the reverse. Long-term gains cancelled save g per dollar; short-term gains cancelled save o. What is left meets ordinary income, but only up to the least of the remainder, the annual limit C and your taxable income T, saving that amount × o. The current-year benefit is the sum of the savings. The carryforward is whatever remains after the gains and the ordinary-income deduction.
The sequence explains why the same loss can be worth very different amounts. A dollar that cancels a long-term gain in the 15% bracket saves 15 cents; a dollar that cancels a short-term gain taxed as ordinary income, or one of the $3,000 deducted against wages, saves your full marginal rate. Once the gains and the $3,000 are used up, extra loss saves nothing this year and simply waits in the carryforward. A $5,000 loss against the default $9,000 of long-term gains stops at the first term, saving 5,000 × 0.15 = $750 with nothing left over. The same $15,000 loss with no gains at all saves only 3,000 × 0.24 = $720 and carries $12,000 forward, enough to cover four more years of the $3,000 deduction if no gains arrive to absorb it sooner. With only $1,000 of taxable income, the deduction against wages stops at $1,000 and the rest carries forward.
The model takes your loss as a single character, so if your losses are mixed, choose the larger part; Publication 550 nets short-term losses against short-term gains and long-term against long-term before crossing over, and a mixed position can order slightly differently. It ignores state tax, the later tax on the replacement's lower basis and the time value of the deferral.
A worked example.
With the defaults, the $15,000 loss first cancels the $9,000 of long-term gains: 9,000 × 0.15 = $1,350 of tax saved. The remaining 15,000 − 9,000 = $6,000 can reduce ordinary income, but only by the $3,000 limit, saving 3,000 × 0.24 = $720. The current-year benefit is 1,350 + 720 = $2,070, and 15,000 − 9,000 − 3,000 = $3,000 carries forward. With no gains next year, that carryover takes another $3,000 off ordinary income, worth $720 at 24%. Now the bill that comes back. The replacement fund cost $85,000; if it is later sold for $120,000, the gain is 120,000 − 85,000 = $35,000 instead of the $20,000 the original holding would have shown, so an extra $15,000 is taxed, costing $2,250 at 15%. Against the $2,070 now and $720 next year, $2,790 in all, the lasting gain is $540: exactly the $6,000 that went against wages times the 9-point gap between 24% and 15%. The $9,000 that cancelled 15% gains was a pure deferral.
Frequently asked questions.
Does harvesting a loss save tax or only postpone it?
How much of a capital loss can I deduct against my salary?
Which capital gains tax rate should I enter?
Does it matter whether the harvested loss is short-term or long-term?
Is harvesting worthwhile if my long-term gains fall in the 0% bracket?
Can I sell at a loss and buy the same investment straight back?
What happens to the loss I carry forward?
Do capital gain distributions from my funds count as gains to offset?
When does a sale count for this year's return?
Can I harvest losses inside an IRA or 401(k)?
References& sources.
- [1]IRS Publication 550, Investment Income and Expenses; capital losses, wash sales and investment income. Retrieved 2026-08-07.
- [2]U.S. Internal Revenue Service. About Form 8949, Sales and Other Dispositions of Capital Assets. Retrieved 2026-08-07.
- [3]U.S. Internal Revenue Service. About Schedule D (Form 1040), Capital Gains and Losses. Retrieved 2026-08-07.
- [4]U.S. Internal Revenue Service. Topic no. 409, Capital gains and losses. Retrieved 2026-08-07.
- [5]U.S. Internal Revenue Service. Instructions for Schedule D (Form 1040) — includes the Capital Loss Carryover Worksheet. Retrieved 2026-08-07.
How this page was produced
- Published by
- Quanta Calculator
- Overseen by
- Daniel, Quanta Calculator Researcher
- Primary sources
- 5 cited below
- Method
- a loss meets gains of its own character first, then the other; benefit = long-term offset × gain rate + (short-term offset + ordinary deduction) × ordinary rate; ordinary deduction = min(remaining loss, annual limit, taxable income)
- Published
- Last verified
Built with AI assistance and verified by automated tests against the cited sources — every worked example on this page is computed by the same code that runs the calculator. How we build and check calculators.
In this category
Embed
Quanta Pro
Paid features are coming later.
- All 1560 calculators remain free
- No billing is enabled