Guide · Capital gains
How the 0%, 15%, and 20% capital gains brackets actually work
A $30,000 gain on a $60,000 salary costs $5,950 sold at eight months and $3,668 sold at fourteen: the same sale, $2,282 apart. How stacking, the 0/15/20 breakpoints, the 3.8% NIIT, and the $3,000 loss deduction really work, with verified 2026 math.
The short answer
A $30,000 long-term gain on a $60,000 salary costs $3,668 in federal tax in 2026, not the $4,500 you would pay if the whole gain took a flat 15%. Long-term gains, on assets held over one year, stack on top of your ordinary income and are taxed at 0%, 15%, or 20% by where the top of the stack lands. For single filers: 0% up to $49,450 of taxable income, 15% up to $545,500, 20% above (joint: $98,900 / $613,700). Short-term gains pay your ordinary bracket. Above $200,000 MAGI ($250,000 joint), the 3.8% net investment income tax rides on top.
Run your own sale: Stock-sale tax calculator →
First: short-term vs. long-term
Everything hinges on the holding period. Sell an asset you held for one year or less and the gain is short-term: it is added to your ordinary income and taxed at your marginal bracket, up to 37%. Hold it for more than one year and it becomes long-term, taxed on the preferential 0% / 15% / 20% schedule. The cutoff is strict: one year and one day is long-term; one year exactly is not.
What that is worth, in the opener's scenario: the same $30,000 gain on $60,000 of wages costs $5,950 if you sell at eight months, because the gain stacks as ordinary income across the 12% and 22% brackets. Sell at fourteen months and it costs $3,668. Waiting out the one-year line saves $2,282 on the same sale, an effective 19.8% against 12.2%.
The stacking rule: the part people get wrong
Long-term gains are taxed on top of your ordinary income, not independently. Your wages and other ordinary income fill the ordinary brackets first; then your capital gains sit on top of that pile, and the 0/15/20 rate is determined by where the top of the pile lands.
For 2026, a single filer pays 0% on long-term gains up to $49,450 of taxable income, 15% up to $545,500, and 20% above that. Married filing jointly: 0% to $98,900, 15% to $613,700. Head of household: 0% to $66,200, 15% to $579,600.
Worked example: single filer, $60,000 of wages, $30,000 long-term gain, $16,100 standard deduction. Taxable ordinary income is $43,900, which sits below the $49,450 breakpoint. The first $5,550 of the gain fills the rest of the 0% band and pays nothing; the remaining $24,450 pays 15%. Tax on the gain: $3,668, an effective 12.2%. The same gain costs a higher earner more, because it lands higher on the stack.
Scale it up and the same stacking logic carries a gain across two bands. Single filer, $500,000 of wages, $100,000 long-term gain: ordinary income already fills the brackets to $483,900 of taxable income, so the gain stacks across the 15% and 20% bands. The first $61,600 pays 15% ($9,240); only the $38,400 above $545,500 pays 20% ($7,680). Capital-gains tax: $16,920. Add $3,800 of NIIT (next section) and the sale costs $20,720, an effective 20.7%. The 20% bracket only ever touches the dollars above the breakpoint, never the whole gain.
The 3.8% surtax that rides on top
The net investment income tax (NIIT) adds 3.8% when your modified AGI clears a fixed statutory threshold: $200,000 single, $250,000 married filing jointly. It applies to the lesser of your net investment income or the amount by which MAGI exceeds the threshold, so a gain that only partially crosses the line is only partially surtaxed. NIIT comes on top of the 15% or 20% rate, which is how the effective top federal rate on gains reaches 23.8%. Unlike the breakpoints, the thresholds are statutory and have never been inflation-indexed: every year, more sellers cross them.
The same gain can carry the surtax or escape it entirely, depending on the year it lands in. Take a $25,000 long-term gain (vest 2,000 shares at $85, sell 1,000 at $110 after 14 months, single):
- Year A, wages $170,000 (MAGI $195,000): under the threshold. Tax on the gain is 15% flat: $3,750, NIIT $0.
- Year B, wages $230,000 (MAGI $255,000): the full gain sits above the threshold. Tax on the gain: $4,700, the same $3,750 plus $950 of NIIT.
Same sale, 25% more tax, purely from where the gain stacked.
Crossing the line partway costs proportionally less: wages of $190,000 plus the same $25,000 gain puts MAGI at $215,000, so only $15,000 of the gain is exposed. NIIT: $570, for a total of $4,320.
Losses: the $3,000 consolation prize
Losses offset gains first by character (long against long, short against short), then net against each other. If the year still nets to a loss, up to $3,000 deducts against ordinary income; the rest carries forward into future years indefinitely.
Worked example: single filer, $90,000 of wages, one stock sold for an $8,000 long-term gain, another sold for an $18,000 long-term loss. Net: a $10,000 loss. This year, the harvest is worth $1,860: the $8,000 gain pays nothing (avoiding the $1,200 it would have cost at 15%), and $3,000 of the remaining loss deducts against wages (worth $660 at the 22% bracket). The last $7,000 carries into next year, where it can offset future gains or another $3,000 of ordinary income.
One trap: sell at a loss and buy the same security back within 30 days, before or after the sale, and the wash-sale rule disallows the loss for this year. Harvest the loss; wait out the month.
What this means in practice
- The year you sell matters. A sabbatical year, a gap between jobs, or early retirement drops your ordinary income and lets more of a gain land in the 0% band. A single retiree with a $30,000 pension who sells for a $40,000 long-term gain pays $668 on it, an effective 1.7%: $35,550 of the gain fills the 0% band left over after the pension, and only $4,450 pays 15%.
- Splitting a sale across December and January splits the gain across two tax years: two sets of brackets, two 0% bands, two NIIT thresholds. On $185,000 of wages, a $60,000 gain sold in one year costs $10,710; sold as two $30,000 gains across two years it costs $5,070 each year, $10,140 total. The $570 saving comes entirely from the second NIIT threshold: at this income both years sit inside the 15% band either way, so the capital-gains rate itself does not change.
- The 0% band is real but narrow. For most working sellers, wages alone fill it. It is widest for married couples at moderate incomes: filing jointly with $95,000 of wages, a $30,000 long-term gain pays $0 of federal tax, because taxable ordinary income of $62,800 leaves the whole $98,900 band open.
- Losses are worth harvesting, not just regretting. A net loss deducts $3,000 against ordinary income each year and carries the rest forward; in the example above, one deliberate harvest is worth $1,860.
The one-paragraph version
Gains stack. Your rate on a sale is set by where the top dollar of the gain lands on top of everything else you earn that year, plus 3.8% if your MAGI clears $200,000 ($250,000 joint). You control three levers: when you sell, how much you sell in each year, and which losses you realize against the gains. The stock-sale tax calculator runs your exact numbers through the same math in about ten seconds.
FAQ
Is any of my gain really taxed at 0%?
Yes, if your taxable ordinary income leaves room in the band. Married filing jointly with $95,000 of wages, a $30,000 long-term gain pays $0 federal tax. A single filer with $60,000 of wages gets the first $5,550 of a gain at 0% and pays 15% on the rest.
Does the 20% rate apply to my whole gain?
No. Only the dollars above $545,500 of taxable income ($613,700 joint) pay 20%. A $100,000 gain on $500,000 of wages puts $61,600 at 15% and only $38,400 at 20%: $16,920 of capital-gains tax, not $20,000.
When does the 3.8% net investment income tax apply?
When MAGI exceeds $200,000 single or $250,000 joint, on the lesser of your investment income or the excess over the threshold. The same $25,000 gain carries $0 of NIIT at $195,000 MAGI, $570 at $215,000, and $950 at $255,000.
How much of a losing investment can I deduct?
Losses offset gains without limit; a remaining net loss deducts up to $3,000 against ordinary income per year, worth $660 at the 22% bracket, and the rest carries forward. A $10,000 net loss this year means $3,000 now and $7,000 banked against future gains.
Does splitting a sale across December and January save money?
Sometimes. It gives you two 0% bands and two NIIT thresholds: on $185,000 of wages, splitting a $60,000 gain across two years saves $570 of NIIT. If both years land in the same capital-gains band anyway, the rate itself does not change.
A guide answers this once. TaxGhost answers it every month — the monitor recomputes what you owe each time your income changes.
Join the waitlist →One email when your spot opens. The calculators never ask for it.