How are long term capital gains taxed when ordinary income fills the 0% bracket?

Filing my 2025 return and trying to understand how are long term capital gains taxed when ordinary income fills the 0% bracket. My situation: I have wages plus some freelance income that together push pretty close to what I think the 0% LTCG threshold is, and I also sold some index fund shares I'd held for over three years. I went into TurboTax's summary screen expecting most of my gains to be tax-free and saw a number I didn't expect. I checked my 1099-B and the proceeds and basis look right. I also confirmed the holding period is definitely long-term. What I can't figure out is whether my ordinary income is essentially "using up" the 0% bracket before my gains even get a chance to sit in it, and what the actual stacking order is on Schedule D and the Qualified Dividends and Capital Gain Tax Worksheet.

33 comments

The Qualified Dividends and Capital Gain Tax Worksheet (in the Schedule D instructions) is where this gets resolved. The IRS stacks your ordinary taxable income first, then your qualified dividends and long-term gains sit on top of that stack. So yes, if your wages and self-employment income already fill the 0% bracket, your LTCG start in whatever bracket is left above that. The worksheet walks through this line by line. Worth running it manually at least once so you can see exactly where the cutoff lands for your filing status.

Paul S.

Author

This is exactly the mechanic I suspected but couldn't confirm. So the gains don't get their own separate "slot" at the bottom of the bracket — they just inherit whatever space ordinary income leaves behind?

Correct. Ordinary income sits at the base. LTCG and qualified dividends layer on top. No separate slot, no reset. The worksheet makes it visual.

Schedule D itself doesn't compute the actual tax on the gains — it just determines the net amounts. The actual rate calculation happens on the Qualified Dividends and Capital Gain Tax Worksheet, or in some cases the Schedule D Tax Worksheet. Which one you use depends on whether you have 28% rate gain, unrecaptured section 1250 gain, or section 1202 exclusion amounts. For most straight index fund sales, it's the QDCGT Worksheet.

Paul S.

Author

Mine is straightforward index funds, no 1250 or 1202 issues. So the QDCGT Worksheet is probably the right one. Good to know there's a distinction.

Publication 550 covers the stacking concept. The practical result is that if your ordinary income is, say, $1 below the 0% threshold for your filing status, only $1 of your LTCG gets the 0% rate and everything above that gets the 15% rate. It's not all-or-nothing on the whole gain amount, it's dollar-for-dollar above the threshold.

I ran into this exact stacking issue last year with RSU vesting income pushing my wages up. What helped me was uploading my W-2 and my 1099-B to taxr.ai and having Taxr map out which lines of the QDCGT Worksheet were affected by the vesting income. It drafted the worksheet with the actual numbers filled in so I could see the marginal dollar where the 15% rate kicked in. The rule itself — ordinary income stacks first — Taxr just showed me where on my specific documents it was happening.

Paul S.

Author

That's useful, especially for someone like me who does better seeing it in the actual worksheet rather than reading a description of it.

The worksheet isn't complicated once you see it filled in. The stacking becomes obvious on line 1 versus line 5 of the QDCGT Worksheet.

One thing worth flagging: your freelance income affects this twice. First it raises your ordinary income, which pushes more of your LTCG above the 0% threshold. Second, the self-employment tax deduction (half of SE tax) reduces your AGI, which then reduces your taxable ordinary income slightly. So the final number on line 15 of Form 1040 is what feeds into the worksheet, not gross freelance revenue.

Paul S.

Author

I hadn't thought about the SE deduction interaction. So I should run the worksheet with my actual line 15 figure after all deductions, not some estimate based on gross income?

Exactly. Use the taxable income from line 15 of Form 1040. That's the input the QDCGT Worksheet asks for on its first line.

The IRS topic on capital gains (Topic 409 at irs.gov/taxtopics/tc409) spells out the rate structure and filing-status thresholds. The thresholds adjust each year, so I'd look there rather than rely on a number someone quotes in a forum. What doesn't change is the stacking order.

Topic 409 is a good starting point but the worksheet in the Schedule D instructions is where you actually do the computation.

Schedule D line 18 and line 19 flag whether you have 28% rate gain or unrecaptured 1250 gain. If both are blank or zero, you use the QDCGT Worksheet. If either has an amount, you get routed to the Schedule D Tax Worksheet instead, which handles the blended rate calculation differently.

I had a similar stacking surprise after selling ETF shares one year. My total LTCG was modest but enough ordinary income was underneath that almost none of it landed in the 0% zone. I ended up owing more than I estimated because I'd been thinking about the brackets wrong — treating them as independent buckets rather than a stack.

Paul S.

Author

This is basically my situation. I think I mentally modeled it as separate buckets too.

Publication 550 at irs.gov/publications/p550 has the investment income rules including holding period rules. For the holding period on your index fund shares, counting starts the day after the trade date you bought and ends on the trade date you sold — not settlement date. More than one year is long-term. Sounds like you're solid there but worth double-checking if any lots are close to the line.

Paul S.

Author

All my lots were purchased more than three years ago so the holding period isn't the issue. The rate calculation is.

The 0% rate doesn't disappear just because some ordinary income is in that range too — it's just that whatever space ordinary income already occupies in the taxable income stack can't be reused for LTCG. The gains get the 0% rate on any taxable income space that ordinary income didn't fill. When ordinary income fills the entire 0% bracket, gains start at 15%.

Form 8949 feeds into Schedule D but doesn't determine the rate — that's all downstream in the QDCGT Worksheet. I had Taxr check my Form 8949 entries against my 1099-B after a year where I had both short-term and long-term lots from the same fund. It flagged that one lot I'd put in Part II should have been Part I because the holding period was just under a year. Catching that before filing mattered because the rate on the corrected lot was completely different.

Part I versus Part II mix-up is easy to make when lots are close to the one-year line.

Especially when a broker's 1099-B lists them chronologically rather than grouped by short vs. long term.

If you want to sanity-check the worksheet math, the Instructions for Form 8949 at irs.gov/instructions/i8949 have good context on how transactions flow from 8949 to Schedule D. The actual rate worksheet is in the Schedule D instructions PDF, not the 8949 instructions, but reading both helps you trace the numbers.

Paul S.

Author

I'll pull the Schedule D instructions PDF and work through the QDCGT Worksheet manually. I think seeing the line references will clear up my confusion.

Worth noting: the 0% bracket threshold is based on taxable income, not AGI. After your standard or itemized deduction brings down line 15 of Form 1040, that's what gets compared to the threshold. If you're itemizing or have above-the-line deductions beyond the SE deduction, those all help push more of your LTCG into the 0% zone.

I gave Taxr my 1040 draft and the QDCGT Worksheet side by side and asked it to trace which line of my ordinary income was crowding out the 0% rate. It went through the worksheet line by line and showed me exactly how much of the LTCG got the 0% rate versus 15%, and which line of Form 1040 was the driver. Knowing the driver made it obvious what I could actually do before year-end to change the outcome.

Paul S.

Author

Knowing the driver is the part I'm missing. I see the final tax number but not which input is doing the most work.

Line 1 of the QDCGT Worksheet is your taxable income. Line 5 is that taxable income minus your qualified dividends and net capital gain, which is your ordinary income, and line 6 is the threshold for your filing status. The gap between line 5 and line 6 is how much room your LTCG has at 0%. When line 5 already reaches or exceeds line 6, the room is zero.

Net investment income tax is a separate overlay if your modified AGI crosses a different threshold — it doesn't interact with the 0%/15%/20% rate brackets directly. For the question you're asking about how the capital gains rate is determined, the QDCGT Worksheet handles it. NIIT would be on Form 8960 if it applies, and that's a separate calculation.

Good distinction. The QDCGT Worksheet and Form 8960 are parallel, not sequential. Two separate tax calculations on the same gains.

The practical upshot: if you can lower your ordinary taxable income before year-end — through a pre-tax retirement contribution, for example — each dollar you reduce frees up a dollar of LTCG to drop from the 15% zone into the 0% zone. The worksheet makes this dollar-for-dollar relationship very clear. After year-end there isn't much you can do about income already earned, but it's useful modeling for next year.

To bring it back to your original question: the stacking answer is unambiguous in the tax law. Ordinary income fills the brackets first. LTCG sits on top. The Qualified Dividends and Capital Gain Tax Worksheet in the Schedule D instructions is where the IRS computes this, and working through it once manually — with your actual line 15 figure — will show you precisely how much of your gain was taxed at 0% versus 15%.