How much long-term capital gain can I harvest at the 0% rate?

Trying to do some tax planning before year-end. I know there's a 0% long-term capital gains rate but I can't figure out how much room I actually have before I tip into the 15% bracket. My taxable income is a mix of W-2 wages and some dividends, and I have a bunch of appreciated index fund shares I've held more than a year. I want to sell just enough to stay in the 0% zone. I looked at Schedule D and Topic 409 on the IRS site but neither one just comes out and says the dollar threshold. I know it depends on filing status and taxable income but I can't find a clean worksheet that shows the math. Is there a form or a line I should be working from? And does the harvested gain itself push me over the threshold, or do I look at income before the sale?

39 comments

The gain you harvest counts toward your taxable income for purposes of the threshold test — that's the part people miss. So you can't just look at your current taxable income and sell up to the threshold. You have to figure out how much headroom you have between your current taxable income and the top of the 0% bracket, and then only harvest that much in gains.

Nina K.

Author

That's the piece I was missing. So I need to know my taxable income before the sale, find the gap to the top of the 0% bracket, and sell no more than that gap. Makes sense.

Went through this same exercise last December. I uploaded my draft return and my brokerage statements to taxr.ai and it calculated exactly how much room I had left in the 0% bracket and flagged two lots where my holding period was 364 days — almost a disaster. It didn't file anything, just laid out the numbers so I could make the call. Worth doing before you sell.

Nina K.

Author

The holding period check is a good catch. I definitely would not have looked at that before selling.

Yes, and the holding period rule is strict — IRS counts from the day after acquisition through and including the sale date, using trade dates not settlement dates for exchange-traded securities. One day short means short-term.

The thresholds are in the Schedule D instructions and they vary by filing status. The IRS doesn't publish them in a single plain-English sentence — you have to read the Qualified Dividends and Capital Gain Tax Worksheet that's built into the Form 1040 instructions. That worksheet is what actually computes your tax at the 0%, 15% or 20% rates.

Nina K.

Author

Found it. The worksheet is in the 1040 instructions, not in the Schedule D instructions separately. That's why I kept missing it.

Yes, exactly. And your qualified dividends go through the same worksheet, so they consume some of the 0% space before your harvested gain does. People forget that.

Worth noting that "taxable income" here means after your standard or itemized deduction, not your AGI. So if you're taking the standard deduction, your W-2 wages and dividends are reduced by that amount before you measure the gap to the threshold.

No, that's right — taxable income on line 15 of Form 1040 is what matters, not AGI on line 11. The deduction comes out before you check the bracket.

I ran into an NII surtax issue the year I did this. If your MAGI goes above the threshold for the net investment income tax, you owe an extra 3.8% on top of whatever the normal rate is. The 0% rate doesn't protect you from that. See the IRS page on digital assets — actually no, wrong page. It's covered in the Schedule D and Form 8960 instructions.

Nina K.

Author

Good flag. I should check Form 8960 to see if that applies to me before I decide how much to harvest.

My situation had some carry-forward losses from a few years back and I wasn't sure how they interacted with the harvesting math. I pasted my Schedule D carryover worksheet into Taxr and it walked through which losses offset which gains first, so I could see how much clean 0%-eligible gain I'd actually end up with after the netting. Really clarified the sequencing for me.

Nina K.

Author

The carryover piece hadn't even occurred to me. I do have a small short-term loss carryforward — that would reduce my net gain before the rate applies.

Yes, capital loss carryforwards offset current-year gains in a specific order: short-term losses first against short-term gains, then long-term against long-term, then excess crosses over. The Schedule D instructions walk through the netting sequence.

Something people get wrong: the 0% rate is not an exemption, it's a rate. So you still report the sale on Form 8949 and carry it to Schedule D. You don't skip reporting just because you expect no tax.

Nina K.

Author

Good reminder. I'll still need to fill out Form 8949 with the cost basis, proceeds, and holding period for every lot I sell.

Yes — and if your brokerage reports basis to the IRS (covered securities), check box D in Part II of Form 8949 since these are long-term. If basis is not reported, check box E.

My broker sent a 1099-B with wrong cost basis one year when I'd done DRIP reinvestments. Even though I owed zero tax at the 0% rate, I had to correct it on Form 8949 with code B in column (f), the basis shown on the 1099-B in column (e) since box D was checked, and the correction as an adjustment in column (g). The IRS math still has to be right on the form even at 0%.

Yes, with box D checked (basis reported to the IRS), you enter the incorrect basis from the 1099-B in column (e) as-is, then put the difference as a negative number in column (g) if your real basis is higher. The instructions for Form 8949 spell this out under the code B section.

I do this harvest every year in November. What tripped me up once was selling a fund and then having the fund pay a capital gain distribution in December — that distribution counted as additional income and pushed me slightly over the 0% threshold. Now I check the fund's estimated distribution schedule first.

Nina K.

Author

That's a genuinely useful heads-up. Mutual fund distributions in December could bump me over if I'm cutting it close.

Don't forget your state. The federal 0% rate doesn't mean your state charges zero. Some states tax capital gains as ordinary income with no special rate. So the harvest might be federally free but state taxable.

Nina K.

Author

My state does have an income tax so this matters. I need to run the state numbers separately before I decide how much to sell.

No federal rule controls state treatment — you'd have to check your state's department of revenue instructions. Each state handles capital gains differently.

I gave Taxr my 1099-B and my draft Schedule D and it went through each lot and listed which ones were long-term, what the gain was, and how the netting would flow. Helped me see which specific lots to sell to maximize the 0% gain without crossing into the 15% zone.

Yes, lot selection really matters. Selling the highest-basis shares first keeps the realized gain smaller, which is easier to control against the threshold.

Nina K.

Author

I hadn't thought about choosing which specific lots to sell. I'll need to tell my broker which shares to use, not just sell the default.

If you're married filing jointly the threshold is higher than for single filers, so your filing status changes the math significantly. The Qualified Dividends and Capital Gain Tax Worksheet accounts for this automatically since it feeds off the taxable income and filing status you've already entered on the 1040.

Publication 550 at irs.gov has a good summary of holding period rules if you want to double-check whether each lot qualifies as long-term before you sell. The rule is more than one year — not one year exactly, but more than one year from the day after purchase.

Yes — "more than 1 year" is the standard from Topic 409. Exactly 365 days is not enough if the year has 366 days. Use trade date to trade date and count carefully.

The step-by-step I'd follow: (1) find taxable income after deductions on line 15 of Form 1040, (2) find the top of the 0% bracket for your filing status in the tax worksheet, (3) the gap is your harvest room, (4) but reduce that gap by qualified dividends you've already received since they use the same 0% space, (5) only then sell lots up to what's left.

Nina K.

Author

That's the clearest summary of the sequence I've seen in this thread. Bookmarking this.

And step 6: check whether any carryover losses will offset part of that gain before it hits the worksheet, as someone mentioned above. The netting on Schedule D happens before the worksheet runs.

I've also seen people accidentally trigger a wash sale when they harvest gains and then immediately repurchase the same fund. Wait — wash sales apply to losses, not gains. You can repurchase the same fund right away after harvesting a gain with no wash sale issue. It's only a problem if you're harvesting losses.

Yes, that's correct. The wash sale rules under Publication 550 apply only to sales at a loss. Selling at a gain and buying back the same fund immediately is fine for tax purposes, though you're resetting your basis and holding period on the new shares.

Nina K.

Author

Good clarification. I was vaguely worried about that but gain harvesting doesn't trigger wash sale rules. Good to know.

If your income is close to the threshold and you're not certain about the final numbers — especially if you have self-employment income, bonus income, or anything that might change before December 31 — it might be worth running this by a CPA or enrolled agent before you sell. Getting it slightly wrong means tax at 15% on the excess, not a penalty, but it defeats the purpose of the harvest.

Nina K.

Author

Makes sense. I'll do the worksheet math myself first and if I'm within a few thousand of the line I'll check with an EA before I pull the trigger.