Are long-term capital gains taxed at 0% with high W-2 income?

I sold some index fund shares I'd held for about 4 years and realized around $18k in long-term gains. My W-2 income is pretty high this year — base salary plus a bonus put me well into the six figures. I always thought long-term capital gains could be taxed at 0% but now I'm second-guessing myself because I've heard your ordinary income "stacks under" the gains and determines the rate. Does high W-2 income basically wipe out any chance of hitting the 0% bracket on long-term capital gains? Or is there a scenario where even with high W-2 income you could still qualify? I've been looking at Schedule D and I can't figure out the stacking order from the form alone.

35 comments

Yes, your W-2 income absolutely affects whether you hit the 0% rate. The way it works: your ordinary income (wages, bonuses, etc.) fills up the lower brackets first, and your long-term capital gains sit on top of that stack. So if your taxable income after deductions already exceeds the threshold for the 0% rate, your gains get taxed at 15%. The threshold itself depends on your filing status and the tax year — check Schedule D and its instructions, or the qualified dividends and capital gain tax worksheet in the Form 1040 instructions, to see the actual numbers.

Chris L.

Author

This stacking concept was what I was missing. So even if the gains themselves are modest, the W-2 pushes everything up. That explains why the 0% rate felt out of reach for me.

I ran into this last spring with RSU vesting income plus a brokerage sale. My taxable income after the standard deduction was way over the 0% cutoff so every dollar of long-term gain got hit at 15%. I actually uploaded my 1099-B and my draft return to taxr.ai and had Taxr map out exactly where my gains landed on the qualified dividends and capital gain tax worksheet — it showed me line by line which amount was above the 0% threshold. Really clarified why I owed what I owed.

Chris L.

Author

Did it also show you the stacking order visually or just the final numbers? That worksheet always confuses me.

It walked through each line of the worksheet in order and flagged which line represented the crossover point. Much easier than staring at the PDF.

The 0% rate is real but it's tied to your total taxable income, not just your capital gains in isolation. Publication 550 at irs.gov walks through how the qualified dividends and capital gain tax worksheet operates. The short version: subtract your net long-term capital gains from your taxable income to see how much "room" remains under the 0% threshold. If your W-2 taxable income already fills that room, there's nothing left for the 0% rate.

This is the clearest I've seen the room concept explained. So you literally compute: 0% threshold minus taxable income excluding gains. If that number is zero or negative, all gains are at 15%.

Exactly. And if that number is positive but smaller than your total gains, only that slice gets 0%. The rest gets 15%.

Worth noting: filing status matters a lot here. The 0% threshold for married filing jointly is roughly double what it is for single filers. So two people with the same W-2 income could face completely different answers depending on whether they file jointly. The Form 1040 instructions have the actual thresholds for the current year — I'd look there rather than any third-party site.

Chris L.

Author

I'm filing single so the threshold is lower. That probably explains why my situation looks worse than a colleague who has similar income but files jointly.

I went through this same question last year when I had a large stock sale alongside a high W-2. Before I filed I pasted my Schedule D numbers and my W-2 figures into Taxr and asked it to check my qualified dividends and capital gain tax worksheet against what my tax software had calculated. It caught that my software had pulled in the wrong taxable income figure on one line, which would have understated my tax. Worth doing before you submit.

Chris L.

Author

That's a good catch. I've been trusting my software blindly but maybe I should double check the worksheet manually or do exactly what you did.

Yes, the worksheet isn't long — maybe 20 lines. Doing it once by hand (or having something help you trace it) gives you confidence in the number.

Something that tripped me up: deductions matter here too. If you're not itemizing and just taking the standard deduction, your taxable income could be meaningfully lower than your gross income. So high W-2 gross doesn't automatically mean zero chance at 0% — it depends on taxable income after all deductions and adjustments. Run the actual numbers.

Good point. Pre-tax 401(k) contributions reduce your W-2 income that flows into taxable income. If someone maxes retirement accounts they might have more room under the threshold than they'd expect.

I noticed you mentioned index fund shares — make sure all those shares are actually long-term. If any lot was held a year or less you're in short-term territory and that's taxed as ordinary income, same rate as your W-2. The 1099-B your broker sends will break down the lots. For holding period purposes, the period starts the day after trade date and ends on the trade date you sell.

Chris L.

Author

All the lots I sold were from purchases 4+ years ago so I think I'm fine, but I'll double check the 1099-B when it arrives.

Just to confirm how the stacking works numerically: say your taxable income is $200k (which already includes your gains) and the 0% threshold for your filing status is $47k. Your long-term gains (say $18k) come out first, leaving $182k of ordinary income, which is $135k already above the line. The gains then fill the top of your taxable income, from $182k up to $200k, so the entire $18k is at 15%. None of it falls in the 0% zone.

Yes, that arithmetic is right. And the 15% rate applies until taxable income hits the 20% threshold, which is quite high — again, the Form 1040 instructions have the exact number for the current year.

The qualified dividends and capital gain tax worksheet is in the Form 1040 instructions, not on Form 1040 itself or Schedule D. I always forgot where it lived. You fill it out as a worksheet and the result flows to line 16 of Form 1040 as your tax. Schedule D gets you the net long-term gain figure that feeds into it.

Had a situation two years ago where I had a mix: some long-term gains that partially fell under the 0% threshold and some that hit 15%. It happened because I'd made big pre-tax retirement contributions that year which pushed my taxable income down enough to leave a small sliver below the threshold. That sliver got 0%, the rest got 15%. So it's not always all-or-nothing.

Chris L.

Author

That's actually encouraging. Even if most of my gains are at 15%, contributions could change things in future years.

One thing I'd add: net investment income tax can layer on top of the capital gains rate if your modified AGI crosses a separate threshold. It's on Form 8960. So your effective rate on the gains might be higher than just the 15% capital gains rate. Worth checking if your income is in that range — the Form 8960 instructions spell out how to figure MAGI for that purpose.

Yes, the NIIT threshold is a separate test from the capital gains bracket thresholds and it depends on your filing status (MFJ is higher than single, and MFS has a lower one). Don't conflate the two calculations.

Right, they run independently. You could be at 15% for the capital gain rate but also owe NIIT on the same gain. Stack both when estimating what you'll owe.

I called my broker to ask and they basically told me they report the gain on the 1099-B but the rate calculation is entirely up to you on your return. They're not going to withhold for capital gains unless you set that up. So make sure you've either paid estimated taxes or have enough withholding from your W-2 to cover whatever the gains add.

No, that's true — brokers don't withhold for capital gains by default. If you owe a chunk and haven't prepaid, you could face an underpayment penalty. Worth running the numbers before year-end.

The Schedule D instructions have a readable summary of the rates and how they interact with ordinary income. They're shorter than Publication 550 and a decent first stop if you want the structure before diving into the worksheet.

My situation this year: RSU vesting pushed my W-2 very high, I also had $30k in long-term gains from a fund I sold, and I owed 15% on all of it. No sliver of 0% because even after my 401(k) contributions my taxable income was well past the threshold. The only regret is not selling some of those lots in an earlier year when my income was lower.

Chris L.

Author

Tax-loss harvesting or timing sales around lower-income years — I keep hearing that's the lever people actually have. Easier said than done when income is lumpy.

Yeah, RSU vesting years are brutal for this. You don't always get to choose when the income hits.

Worth being precise: the 0% rate doesn't disappear just because you have high W-2 income, it's that your gains have to land within the 0% bracket after the stacking. If your deductions are large enough that your taxable income still has room under the threshold, the gains that fit in that room are genuinely tax-free. High gross W-2 and high taxable income aren't always the same thing.

Yes, this is important. Gross W-2 and taxable income diverge by whatever pre-tax deductions and adjustments you have. The worksheet uses taxable income, not gross.

Earlier someone implied the NIIT threshold is the same regardless of filing status — that's not fully accurate. For married filing separately it's lower than for single or MFJ. The Form 8960 instructions confirm this. Just flagging it so nobody gets caught off guard.

Good correction. I should have said MFS has its own lower threshold. The others (single, MFJ, head of household) each have their own numbers too — Form 8960 instructions list them all.