The number you are looking for
Tax-gain harvesting means selling an investment you have held for more than a year, in a year when the gain falls inside the 0% band, and usually buying it straight back. The federal tax on that gain is nothing. What you get for it is a higher cost basis, so the same growth is never taxed later.
Only one figure decides whether it works: how much gain fits. Call it headroom, the long-term gain you can realize this year before a single dollar of it is taxed. For 2026 it is the 0% ceiling of $49,450 for a single filer ($98,900 joint, $66,200 head of household), plus your standard deduction, minus your other income.
The deduction is the part people leave out. The ceiling is measured in taxable income, which is what remains after the deduction, so the deduction itself is extra room. A single filer with no other income can realize $65,550 of long-term gain and owe no federal income tax on any of it.
The calculator on this site works the figure out from your own numbers. Enter a filing status and your other income, and the comparison panel under the results reports it as zero-rate headroom. It is found by running the full calculation repeatedly rather than by subtracting ceilings, so it allows for everything the calculation includes.
Headroom at common incomes
The table below comes from that same calculation, run when this page was built. Other income means gross income before the deduction: wages, interest, ordinary dividends, short-term gains, pension and taxable IRA income. Each figure assumes the standard deduction and no long-term gains or qualified dividends already realized in the year.
Read across a row and the joint column is roughly double the single one, because both the ceiling and the deduction double for a married couple. Read down a column and headroom falls dollar for dollar as income rises, until it reaches nothing. Past that point every long-term gain is taxed at 15% from its first dollar, and harvesting stops being free.
| Other income | Single | Married filing jointly | Head of household |
|---|---|---|---|
| $0 | $65,550 | $131,100 | $90,350 |
| $20,000 | $45,550 | $111,100 | $70,350 |
| $40,000 | $25,550 | $91,100 | $50,350 |
| $60,000 | $5,550 | $71,100 | $30,350 |
| $80,000 | $0 | $51,100 | $10,350 |
| $100,000 | $0 | $31,100 | $0 |
| $120,000 | $0 | $11,100 | $0 |
Computed by this site's engine from the 2026 thresholds in Rev. Proc. 2025-32 § 4.03 and the standard deduction in § 4.14. Married filing separately matches the single column.
What uses up the band before your sale does
Anything that raises taxable income shrinks the room, and a few items are easy to miss. A short-term gain is ordinary income, so a short-term sale earlier in the year eats headroom exactly as a paycheck would. Taxable IRA withdrawals and Roth conversions do the same, which is why harvesting and conversions compete for the same space in a low-income year and have to be planned together.
Qualified dividends and long-term gains already taken this year sit in the same band. They are stacked on top of ordinary income along with the sale you are planning, so a portfolio paying $4,000 of qualified dividends leaves $4,000 less room for the harvest.
The deduction side can help. If your itemized deductions exceed the standard deduction, itemizing lowers taxable income and widens headroom by the difference. Above-the-line deductions, such as deductible traditional IRA contributions and contributions to a health savings account, lower taxable income as well, and widen headroom by the same amount.
Selling and buying straight back
Harvesting a gain does not mean leaving the market. The wash sale rule in section 1091 of the Internal Revenue Code disallows losses on a sale followed by a repurchase within thirty days. It says nothing about gains, so you can sell a fund and buy it back the same day.
What changes is the lot you hold. The shares you buy back carry the new, higher basis and a fresh holding period that starts the day after the purchase. If you later need to sell those shares at long-term rates, the one-year clock has to run again first.
A sale counts in the year of its trade date, not its settlement date (Rev. Rul. 93-84), so a trade on the last business day of December belongs to that year. That matters because headroom depends on a full year of income, and December is when that figure is easiest to know.
When a 0% gain still costs money
The 0% rate applies to federal income tax only. Several other things are measured on the same income, and each deserves a look before you sell.
State income tax. Most states tax capital gains as ordinary income with no zero band of their own, so a gain that is free federally can still carry a state bill. Choose your state in the calculator and it shows that figure beside the federal one.
Marketplace health insurance. The premium tax credit is based on modified adjusted gross income, which includes capital gains (IRC § 36B(d)(2)(B)). A harvest in a year you receive the credit can reduce it, sometimes by more than the higher basis is worth.
Social Security. How much of a benefit is taxable depends on provisional income, and capital gains count toward it (IRC § 86). A harvest can make more of the benefit taxable, and that extra taxable benefit is ordinary income that uses up part of the very headroom you measured.
Medicare premiums. The Part B and Part D income-related surcharges are set from modified adjusted gross income two years earlier (42 U.S.C. § 1395r(i)). A large harvest at 63 or later can raise premiums two years on. The Social Security Administration publishes the brackets each year.
Whether it is worth doing
The saving is the tax you would otherwise pay on the same gain later. If the couple in the example below eventually sells at 15%, harvesting $71,100 at 0% now saves $10,665 of federal tax on that future sale, and more if the later sale would also carry the 3.8% net investment income tax.
It is worth less, or nothing, in three situations. Shares you expect to hold for life take a basis equal to their value at death (IRC § 1014), which clears the gain for your heirs without any harvesting. Shares you mean to give to charity avoid the gain entirely when donated directly rather than sold. And a harvest that costs more in state tax or lost credits than it saves federally is not one worth making.
The years that make it work tend to be predictable: the gap between retiring and claiming Social Security or taking required distributions, a sabbatical or a year between jobs, a year of graduate study, or a year in which a business loss offsets wages. Seeing one of those coming and planning the sale into it is what turns the 0% band from a curiosity into money.
Leaving a margin
Headroom is only as good as the income estimate behind it. A December bonus, a larger distribution than usual, or a capital gain distribution from a mutual fund can all arrive after you sell. Funds tend to pay out gains late in the year, and those payouts are long-term gains that sit in the same band as your harvest.
Overshooting is not a disaster. The ceiling is marginal, so only the gain above it is taxed, at 15%: realizing $1,000 too much costs $150, not 15% of the whole sale. The second example below shows it. Stopping a few hundred dollars under the figure costs almost nothing and protects against a distribution you did not see coming.
If the room left this year is small, the same arithmetic applies next January with a fresh band. Splitting a large harvest across two tax years gives two lots of headroom rather than one, provided both years stay low-income.
Worked example
Computed by the calculator's own engine when this page was built. Open the derivation for every rule and citation.
A couple filling the band exactly
A married couple filing jointly has $60,000 of wages and index fund shares held for years with a large unrealized gain. Their headroom is $71,100, and they realize exactly that much.
- Taxable income after deduction
- $98,900
- Taxable gain
- $71,100
- Tax owed without the sale
- $2,840
- Tax the sale added
- $0
- Total federal tax
- $2,840
- Effective rate on the gain
- 0%
The sale adds nothing to their federal bill: the tax shown is the ordinary tax on the wages, owed with or without it. The shares they buy back carry a basis $71,100 higher, so that much future growth has already been taxed at 0%.
Caveats on this example (1)
- Net investment income was derived from capital gains and qualified dividends only. Interest, non-qualified dividends, rents, royalties and passive business income included in your other income are also net investment income under IRC 1411(c) and are not counted here.
Show the working — 11 steps, each with its citation
- Net short-term capital gain or loss for the year$0
Assets held one year or less. Taxed at ordinary rates if a net gain.
- Net long-term capital gain or loss for the year$71,100
Assets held more than one year. Eligible for the 0/15/20% rates.
- Standard deduction-$32,200
Adjusted gross income of $131,100 less $32,200.
- Taxable income$98,900
The figure the rate tables and the capital gain ceilings are both measured against.
- Ordinary income taxed at 10%$2,480
$24,800 of taxable income between $0 and $24,800.
- Ordinary income taxed at 12%$360
$3,000 of taxable income between $24,800 and $27,800.
- Ordinary income stacked below the long-term gain$27,800
Long-term gain is taxed by reference to where it sits ON TOP of $27,800 of other taxable income, not from the bottom of the rate table.
- Long-term gain taxed at 0%$0
Taxable income stays at or below the $98,900 maximum zero-rate amount.
- Net investment income tax threshold$250,000
Modified AGI of $131,100 against the $250,000 threshold for married filing jointly. This threshold is statutory and is not adjusted for inflation.
- Net investment income tax does not apply$0
Modified AGI is $118,900 below the threshold.
- Total tax$2,840
$2,840 on $131,100 of total income, an effective rate of 2.17%.
The same couple, $10,000 past the ceiling
The same couple realizes $81,100, overshooting their headroom by $10,000.
- Taxable income after deduction
- $108,900
- Taxable gain
- $81,100
- Tax owed without the sale
- $2,840
- Tax the sale added
- $1,500
- Total federal tax
- $4,340
- Effective rate on the gain
- 1.85%
Only the $10,000 above the ceiling is taxed, at 15%. The rest of the gain is still free. An overshoot costs the rate on the overshoot, never the rate on the whole sale.
Caveats on this example (1)
- Net investment income was derived from capital gains and qualified dividends only. Interest, non-qualified dividends, rents, royalties and passive business income included in your other income are also net investment income under IRC 1411(c) and are not counted here.
Show the working — 12 steps, each with its citation
- Net short-term capital gain or loss for the year$0
Assets held one year or less. Taxed at ordinary rates if a net gain.
- Net long-term capital gain or loss for the year$81,100
Assets held more than one year. Eligible for the 0/15/20% rates.
- Standard deduction-$32,200
Adjusted gross income of $141,100 less $32,200.
- Taxable income$108,900
The figure the rate tables and the capital gain ceilings are both measured against.
- Ordinary income taxed at 10%$2,480
$24,800 of taxable income between $0 and $24,800.
- Ordinary income taxed at 12%$360
$3,000 of taxable income between $24,800 and $27,800.
- Ordinary income stacked below the long-term gain$27,800
Long-term gain is taxed by reference to where it sits ON TOP of $27,800 of other taxable income, not from the bottom of the rate table.
- Long-term gain taxed at 0%$0
Taxable income stays at or below the $98,900 maximum zero-rate amount.
- Long-term gain taxed at 15%$1,500
Gain between the $98,900 zero-rate ceiling and the $613,700 15% ceiling.
- Net investment income tax threshold$250,000
Modified AGI of $141,100 against the $250,000 threshold for married filing jointly. This threshold is statutory and is not adjusted for inflation.
- Net investment income tax does not apply$0
Modified AGI is $108,900 below the threshold.
- Total tax$4,340
$4,340 on $141,100 of total income, an effective rate of 3.08%.
Run your own figures
Nothing you enter leaves your browser.