Investment taxes Lesson 15 of 19
Taxes · Tax-aware investing
Tax-gain harvesting in the 0% bracket: resetting cost basis
How much long-term gain a household can realize at 0% in 2026, why no wash-sale rule applies, and what the extra income can cost in credits, benefits and state tax.
On this page
Tax-loss harvesting is the move most investors hear about: sell a position below cost to bank a loss. Its mirror image gets less attention. Tax-gain harvesting means selling a position that has risen, on purpose, in a year when the long-term gain is taxed at 0%, and usually buying it straight back. Nothing changes in the portfolio. What changes is the cost basis: the shares now carry today's price as their cost, so the gain that would have been taxed later is gone.
The idea only works because of how the brackets stack. Long-term gains sit on top of ordinary income, and the part that lands below the 0% edge is taxed at nothing. A household with modest taxable income therefore has a fixed amount of "room" each year. This lesson shows how to measure that room for two invented households in 2026, why the wash-sale rule does not get in the way, and, at greater length, what a federally untaxed gain can still cost: Social Security taxation, the premium tax credit, the kiddie tax, the EITC, Medicare premiums, the net investment income tax and state income tax. It ends by comparing gain harvesting with a Roth conversion, which competes for the same low-bracket room.
Everything here is US federal law for tax year 2026, using the thresholds in Rev. Proc. 2025-32 as tabulated in Tax brackets for investors: how gains and dividends stack in 2026. The people are invented and the arithmetic is exact to the dollar. Whether any of this suits a real household depends on its whole return and its plans; that is a question for a tax professional.
How the 0% band works
The 0% rate is not a rate for small gains. It is a rate for gains that sit low in the stack. The Form 1040 worksheet places ordinary income first, starting at the bottom of the brackets, then puts qualified dividends and net long-term gain on top. Whatever part of that top layer lies at or below the 0% edge is taxed at 0%; the rest is taxed at 15% (and at 20% far higher up).
| Filing status (2026) | 0% rate up to (taxable income) | Standard deduction | Gross income the edge allows |
|---|---|---|---|
| Single | $49,450 | $16,100 | $65,550 |
| Married filing jointly | $98,900 | $32,200 | $131,100 |
| Head of household | $66,200 | $24,150 | $90,350 |
| Married filing separately | $49,450 | $16,100 | $65,550 |
The last column is the edge plus the standard deduction: the most income, gains included, a filer under 65 with no other deductions can have and still pay 0% on every dollar of long-term gain.
So the room is:
Two things are easy to forget. Qualified dividends and the capital gain distributions a fund pays in December use the same room, because they sit in the same layer. And any short-term gain or other ordinary income added later pushes the long-term layer up, out of the band.
Worked example 1: a single filer
Maya is single and under 65. In 2026 she earns $48,000 of wages and has no other income. After the $16,100 standard deduction her taxable income is $31,900, all of it in the 10% and 12% brackets. Her room is $49,450 − $31,900 = $17,550.
She owns 1,000 shares of a stock index fund in a taxable account, bought years ago at $35 and now at $60, a gain of $25 a share. To realize $17,550 of long-term gain she sells $17,550 ÷ $25 = 702 shares, for $42,120, and identifies those shares to her broker (Publication 550 explains adequate identification; Cost basis methods: FIFO, specific ID, average cost, HIFO and LIFO has the methods). She buys 702 shares back the same day at $60.
- Federal tax on the gain: $0. Her return goes from $3,580 of tax to $3,580.
- Her 702 shares now have a basis of $60 instead of $35. If she sells them years later in the 15% band, the $17,550 she harvested is never taxed: a saving of up to $17,550 × 15% = $2,632.50.
- Had she sold enough to realize $20,000, the $2,450 above the edge would be taxed at 15%: $367.50. Overshooting by a little costs only 15% of the overshoot, as long as nothing else on the return reacts to it.
Worked example 2: a joint return with dividends
Ada and Tunde Okafor file jointly, both in their 40s. They have $110,000 of wages and $3,000 of qualified dividends. Taxable income is $110,000 + $3,000 − $32,200 = $80,800, so the room is $98,900 − $80,800 = $18,100. One of their funds is expected to pay a $2,500 long-term capital gain distribution in December. That also sits in the 0%/15% layer, so the room left for selling is $15,600. If the couple harvests $18,100 in November and the distribution then arrives, $2,500 of gain lands above the edge and costs $375.
Why the wash-sale rule does not apply
Section 1091(a) disallows "any loss claimed" when substantially identical stock is bought within 30 days before or after the sale. It says nothing about gains, and a gain is reported whether or not the shares are bought back. So Maya can sell and rebuy within minutes. Three details remain:
- The holding period starts again. The 702 new shares are short-term until they have been held more than a year. If the fund falls and Maya sells inside that year, the loss is short-term.
- Loss lots on the same day. If the sale also includes lots bought above $60, those lots are at a loss, and buying back within 30 days makes those losses wash sales. Publication 550 adds that a wash-sale loss on one block cannot reduce the gain on other blocks sold the same day. Identifying only the gain lots avoids the mix.
- Short-term lots. A lot held a year or less produces a short-term gain, which is ordinary income. It is taxed at 10% or 12% and pushes the long-term layer up. Gain harvesting is a long-term-lot exercise.
What a 0% gain can cost elsewhere
The gain is untaxed in the capital gain worksheet, but it is not invisible. It raises adjusted gross income, and many other rules key off AGI or a modified version of it. Each one below is measured on income that includes the harvested gain.
Taxable Social Security benefits
Up to 85% of Social Security benefits become taxable as provisional income rises: half the benefits plus other income, including every dollar of capital gain (§86). The thresholds, $25,000 and $34,000 for a single filer ($32,000 and $44,000 joint), have never been indexed. The full mechanics are in Taxes on Social Security benefits: the 50% and 85% tiers explained.
Walt is 67 and single, with $30,000 of benefits and $20,000 of IRA withdrawals. His provisional income is $20,000 + $15,000 = $35,000, so $5,350 of his benefits are taxable. His deductions are $16,100 + $2,050 (the additional amount for an unmarried filer 65 or older) + the $6,000 senior deduction = $24,150, leaving taxable income of $1,200 and tax of $120.
He harvests $10,000 of long-term gain. Provisional income rises to $45,000 and taxable benefits to $13,850, an extra $8,500. His taxable income becomes $19,700: $9,700 of ordinary income and the $10,000 gain on top, all of it under the $49,450 edge. The gain is taxed at 0%, but the $8,500 of newly taxable benefits is taxed at 10%: tax rises to $970, an extra $850, or 8.5% of the gain. At $20,000 of gain the extra tax is $1,816. Once 85% of the benefits are taxable (at about $23,700 of gain here) the side effect stops, until the gain itself crosses the edge at $28,100.
The premium tax credit on a Marketplace plan
For 2026, §36B again limits the credit to households with income from 100% to 400% of the poverty line; the temporary rule that removed the 400% cap covered 2021 through 2025 only. For coverage in 2026 the poverty line is the 2025 figure: $15,650 for one person and $21,150 for two, so the cap for a couple is $84,600. Income here is modified AGI: AGI plus tax-exempt interest, untaxed Social Security and excluded foreign income. A harvested gain counts in full.
Erik and Lena Lindqvist are 60, retired early, and buy a Marketplace plan. Their MAGI is $50,000, 236.4% of the poverty line. Rev. Proc. 2025-25 sets the 2026 expected contribution on a sliding scale; at that income it works out to 7.94% of income, $3,970. With an invented benchmark premium of $20,000 a year, their credit is $16,030. Their taxable income is $17,800, so they have $81,100 of room in the 0% band: on federal income tax alone, a large harvest looks free.
| Gain harvested | MAGI | % of poverty line | Expected contribution | Credit | Credit lost |
|---|---|---|---|---|---|
| $0 | $50,000 | 236.4% | $3,970 | $16,030 | $0 |
| $10,000 | $60,000 | 283.7% | $5,678 | $14,322 | $1,709 |
| $30,000 | $80,000 | 378.3% | $7,968 | $12,032 | $3,998 |
| $34,600 | $84,600 | 400.0% | $8,426 | $11,574 | $4,456 |
| $35,000 | $85,000 | 401.9% | none | $0 | $16,030 |
Below the cap, each extra dollar of gain costs roughly 10 to 17 cents of credit. One dollar past it costs everything. Since 2026 there is also no cap on paying back advance credit that turns out too large (§36B(f)(2) as amended in 2025), so an unplanned December harvest is repaid in full at filing. The figures in the table use the statute's straight-line scale; Form 8962 rounds the percentage of the poverty line, so a real return can differ by a few dollars.
The kiddie tax
A child's investment income above a threshold is taxed at the parents' rates (§1(g)). For 2026 the first $1,350 of a child's unearned income is covered by the child's standard deduction and the next $1,350 is taxed at the child's own rates, so net unearned income starts above $2,700. The rule reaches children under 18 at the end of the year and, in some cases, older dependent students.
A 15-year-old with a custodial account realizes a $10,000 long-term gain. Net unearned income is $7,300, and the tax on it is what that $7,300 would add to the parents' return. If the parents have $80,800 of taxable income, like the Okafors, $7,300 more still fits under $98,900 and the tax is $0. If they have $150,000, it is taxed at 15%: $1,095. A child's own 0% band is mostly not available; the parents' is.
The EITC investment income limit
The earned income tax credit is denied outright when "disqualified income" exceeds $12,200 in 2026 (§32(i), Rev. Proc. 2025-32). Capital gain net income counts. A working family that claims the EITC and harvests $15,000 of gain loses the whole credit, whatever its size.
Medicare IRMAA and the NIIT: usually out of reach
Medicare Part B and D premiums rise in tiers when MAGI exceeds a threshold, using the tax return from two years earlier (20 CFR §418.1135). The 2026 tiers start above $109,000 single and $218,000 joint (based on 2024 returns); the 2027 tiers, published November 17, 2026, start above $112,000 and $224,000. A 2026 harvest affects 2028 premiums, whose tiers are not yet published.
The Net investment income tax (NIIT): the 3.8% surtax in depth adds 3.8% to investment income once MAGI passes $200,000 single or $250,000 joint.
Neither is reachable from inside the 0% band on a standard deduction: the most a single filer can have and still be in the band is $65,550 of income, and a couple $131,100 (a little more for filers over 65, whose deductions are larger). Large itemized deductions or tax-exempt interest can change that. Both start to matter when a household harvests past the edge at 15%. A couple whose MAGI crosses the first IRMAA tier pays, at 2026 amounts, $81.20 a month more for Part B and $14.50 more for Part D each: $2,296.80 for the year, from the first dollar over the line.
State income tax
A state need not have a 0% band. New Jersey, for example, taxes net gains from the sale of property along with wages under one rate schedule; its 2025 schedule for single filers taxes income from $40,000 to $75,000 at 5.525%. If Maya lived there and her New Jersey taxable income stayed in that range, her $17,550 harvest would add $969.64 of state tax. That is largely a prepayment rather than a loss: the higher basis lowers the state tax on a later sale by the same amount, if she still lives in the state then. It becomes a real cost if she later moves to a state without an income tax, or holds the shares until death. State taxes on investments: gains, dividends, interest and moving covers how states differ.
Gain harvesting or a Roth conversion?
A Roth conversion moves money from a traditional IRA to a Roth IRA, and the amount converted is included in gross income (§408A(d)(3)). It is ordinary income, so it goes into the stack below the gains. That is why the two compete: every dollar of conversion pushes a dollar of long-term gain from 0% to 15%.
Take Maya's $17,550 of room three ways:
| Choice | Federal tax now | What it buys |
|---|---|---|
| Harvest $17,550 of gain | $0 | Up to $2,632.50 less tax later, if she would sell at 15% |
| Convert $17,550 to a Roth IRA | $2,106 (12%) | No further tax on $17,550 and its growth, under the Roth rules |
| Both: convert, then harvest $17,550 | $4,738.50 | Both, but the gain is now taxed at 15%: each converted dollar costs 27% |
In the third row the conversion fills taxable income to $49,450, so the whole gain sits above the edge at 15%: $2,632.50 on top of the $2,106. That 27% combined rate is the same effect as case C in Tax brackets for investors: how gains and dividends stack in 2026.
Which is worth more depends on things this page cannot know: the rate the IRA money would otherwise be taxed at in retirement, how long it will grow, whether the fund shares will ever be sold (shares held until death get a new basis anyway, see Step-up in basis: inherited stock, spouses and the exceptions), and whether Social Security, the credit or IRMAA react. Gain harvesting saves the future capital gain rate on the harvested amount, 15% for most households, and only if the shares are sold. A conversion pays tax now to avoid ordinary-income tax later. In many cases the comparison is between the 12% now and the expected future rate on the IRA, with the gain harvest using whatever room is left.
Pitfalls
- Counting gross income, not taxable income. The edge is on taxable income after the deduction. Maya's $48,000 salary leaves $17,550 of room, not $1,450.
- Forgetting December distributions. Fund capital gain distributions and qualified dividends use the room. Harvesting before they are declared risks overshooting.
- Selling short-term lots. Short-term gains are ordinary income and push long-term gains out of the band.
- Ignoring cliffs. The 400% credit cap, the EITC limit and IRMAA tiers have no phase-in. An overshoot of $1 can cost thousands.
- Mixing in loss lots. A loss lot sold alongside the gain lots and bought back is a wash sale.
- Harvesting shares that will never be sold. Shares held until death receive a new basis under §1014, so harvesting their gain saves nothing federally (and can cost state tax now).
- Assuming the room is the same next year. Income, deductions and thresholds change; 2027's edge is $51,050 single and $102,100 joint (Rev. Proc. 2026-35).
How Finabase does it
The capital gains tax calculator shows a sale's federal tax band by band for 2026 or 2027, so a reader can see how much of a gain falls at 0% and where 15% begins at a given taxable income. A Finabase portfolio shows each position's cost and unrealized gain, which is where a harvestable long-term gain becomes visible; it matches sales to the earliest purchases first (FIFO), has no specific-lot selection and does not split gains by holding period, so the lot-level detail for a harvest comes from the broker. Neither tool models Social Security taxation, the premium tax credit, IRMAA or state tax.
Frequently asked questions
Is there a wash-sale rule for gains?
No. Section 1091 disallows losses only. Shares sold at a gain can be bought back immediately; the new shares take the repurchase price as basis and start a new holding period.
How much capital gain can I realize at 0% in 2026?
Up to $49,450 of total taxable income single, $98,900 joint or $66,200 head of household, counting the gain itself and other income first. The room is that edge minus taxable income before the gain; with only wages and the standard deduction, a single filer with $48,000 of wages has $17,550.
Does a 0% capital gain affect my Social Security taxes?
It can. The gain counts in provisional income, so it can make more of the benefits taxable even though the gain itself is taxed at 0%. For the invented retiree on this page, $10,000 of gain added $850 of tax.
Does tax-gain harvesting affect ACA subsidies?
Yes. The gain is part of modified AGI for the premium tax credit. For 2026 the credit ends above 400% of the poverty line ($84,600 for a couple), so a harvest that crosses it loses the whole credit.
Is it better to harvest gains or do a Roth conversion?
They use the same low-bracket room, and a conversion placed under the gains pushes them into the 15% band. Which is worth more depends on the future tax rate on the IRA money, whether the shares will be sold, and what other credits react; the table above shows the arithmetic for one filer.
Summary
Tax-gain harvesting realizes long-term gains in a year when they fall in the 0% band and buys the shares back, raising their basis so the gain is never taxed later. In 2026 the band ends at $49,450 of taxable income single and $98,900 joint, and dividends, fund distributions and other gains use the same room; an invented single filer with $48,000 of wages had $17,550. The wash-sale rule does not apply to gains, but loss lots sold alongside and short-term lots do cause trouble. A gain taxed at 0% still raises AGI: it can make Social Security taxable ($850 on $10,000 for one retiree), cut or end the premium tax credit (all $16,030 for one couple past 400% of the poverty line), trigger the kiddie tax at the parents' rate, cancel the EITC and add state tax. The NIIT and IRMAA are out of reach inside the band but not beyond it. A Roth conversion competes for the same room, and doing both turns each converted dollar into a 27% decision.
Check your understanding
5 questions on this lesson. Each answer comes with the reason, and nothing is scored.
A single filer has $31,900 of taxable income from wages in 2026 and a fund with a large long-term gain. She also expects a $2,000 capital gain distribution in December. How much gain can she sell and still pay 0% on all of it?
- $49,450
- $17,550
- $15,550
- $1,450
Show the answer
C. $15,550 The 0% band ends at $49,450 of taxable income. Wages fill $31,900, leaving $17,550, and the December distribution sits in the same layer as the sale, so $15,550 is left for the harvest.
An investor sells shares at a long-term gain and buys the same fund back ten minutes later. What happens?
- The gain is disallowed under the wash-sale rule
- The gain counts; the new shares have the repurchase price as basis and a new holding period
- The gain is deferred into the basis of the new shares
Show the answer
B. The gain counts; the new shares have the repurchase price as basis and a new holding period Section 1091 applies only to losses. The gain is reported, the new shares cost what was paid for them, and their holding period starts on the purchase date.
A retiree's harvested long-term gain is taxed at 0%, yet his federal tax rises by 8.5% of the gain. Why?
- The NIIT applies to all capital gains
- The gain raises provisional income, making more of his Social Security benefits taxable as ordinary income
- Long-term gains are taxed at 10% for retirees
Show the answer
B. The gain raises provisional income, making more of his Social Security benefits taxable as ordinary income Each dollar of gain adds a dollar to provisional income. In his range, 85 cents of benefits becomes taxable for each dollar, taxed at 10%, so the gain costs 8.5 cents a dollar even though it is in the 0% band.
A couple on a 2026 Marketplace plan has MAGI of $80,000, a little under 400% of the poverty line for two ($84,600). What does an extra $5,000 of harvested gain do?
- Nothing, because the gain is taxed at 0%
- It lowers the credit by about 10 cents a dollar
- It takes MAGI past 400%, so the whole premium tax credit is lost
Show the answer
C. It takes MAGI past 400%, so the whole premium tax credit is lost From 2026 the credit is available only up to 400% of the poverty line. $85,000 is over the $84,600 cap, so the credit falls to zero, and advance payments must be repaid in full.
Why does a Roth conversion compete with gain harvesting for the same room?
- Conversions are taxed at capital gain rates
- Converted amounts are ordinary income placed below the gains, so each converted dollar pushes a dollar of gain from 0% to 15%
- The IRS allows only one of the two in a tax year
Show the answer
B. Converted amounts are ordinary income placed below the gains, so each converted dollar pushes a dollar of gain from 0% to 15% The worksheet stacks ordinary income first. A conversion fills the low brackets and lifts the long-term layer above the 0% edge, so doing both can cost 12% on the conversion plus 15% on the displaced gain.
Exercise
One task to do in Finabase. Nothing is graded or saved.
Follow Maya in Tools → Capital gains tax calculator: tax year 2026, Single, Other income $48,000, Standard deduction. Enter her harvest of 702 shares, cost basis $24,570, sale proceeds $42,120, held more than one year, and read the Tax on the sale. Then try 800 shares (basis $28,000, proceeds $48,000). How much of the larger gain falls outside the 0% band?
Open the capital gains tax calculatorWhat you should find
Her $31,900 of taxable income leaves $17,550 of room, so the 702-share sale owes $0. The 800-share sale realizes $20,000: $17,550 at 0% and $2,450 at 15%, $367.50. Overshooting costs only 15% of the overshoot, unless something else on the return reacts to the income.
Sources and further reading
- IRS — Rev. Proc. 2025-32: 2026 rate tables (§4.01), capital gain thresholds (§4.03), kiddie-tax amount (§4.02), EITC investment income limit (§4.06(2)), standard deduction and aged amounts (§4.14)
- 26 U.S. Code §1091(a): the wash-sale rule applies to a loss claimed (Cornell LII, read 2026-11-30)
- 26 U.S. Code §1(g): kiddie tax, net unearned income and the allocable parental tax (Cornell LII, read 2026-11-30)
- 26 U.S. Code §86: taxable Social Security benefits, $25,000/$32,000 and $34,000/$44,000 (Cornell LII, read 2026-11-30)
- 26 U.S. Code §151(d)(5)(C): $6,000 senior deduction and its 6% phase-out above $75,000/$150,000 (Cornell LII, read 2026-11-30)
- 26 U.S. Code §36B: premium tax credit, 400% cap from 2026, MAGI, full repayment of excess advance credit (Cornell LII, read 2026-11-30)
- IRS — Rev. Proc. 2025-25: 2026 applicable percentage table, 2.10% to 9.96%
- HealthCare.gov — Federal poverty level: 2025 figures ($15,650 single, $21,150 for two) used for 2026 Marketplace savings
- CMS — 2026 Medicare Parts A & B premiums and deductibles fact sheet (November 14, 2025): IRMAA tiers for Parts B and D
- CMS — 2027 Medicare Parts A & B premiums and deductibles fact sheet (November 17, 2026): IRMAA tiers start above $112,000/$224,000
- 20 CFR §418.1135: IRMAA uses the tax return from two years before (Cornell LII, read 2026-11-30)
- 26 U.S. Code §1411: net investment income tax thresholds (Cornell LII, read 2026-11-30)
- 26 U.S. Code §32(i): EITC denied when disqualified income, including capital gain net income, exceeds the limit (Cornell LII, read 2026-11-30)
- 26 U.S. Code §408A(d)(3): a Roth conversion is included in gross income (Cornell LII, read 2026-11-30)
- IRS — Publication 550 (2025), chapter 4: adequate identification of shares; Wash Sales, loss and gain on the same day
- State of New Jersey — 2025 NJ-1040 instructions and tax rate schedules (Table A)
