Should I sell stocks to realize capital gains in the 0 percent bracket?

Trying to figure out if I should sell stocks to realize capital gains in the 0 percent bracket this year. My situation: filing single, my W-2 income is low enough that I think I land in the 0% long-term capital gains bracket, but I'm not totally sure where the cutoff is or how to check. I have some positions I've held over a year with big embedded gains. The idea is to sell them, realize the gain at 0%, then immediately buy back in to step up my cost basis for the future. I looked at Schedule D and my 1099-B from last year but I can't figure out how to model this out before I actually do it. Is this a legit strategy? Am I missing something that would blow it up, like the wash sale rule or something?

36 comments

This is a real and completely legal strategy, sometimes called "gain harvesting." The key thing to verify first: what is your projected taxable income after the standard deduction, not your gross income? The 0% rate applies to long-term capital gains, and the threshold is based on taxable income including the gains themselves. So adding a large realized gain can push you above the 0% threshold partway through the gain. Only the portion of gain that fits under the line gets the 0% rate. I did this last year and uploaded my draft return to taxr.ai before selling anything. It read through my Schedule D and estimated exactly how much room I had under the threshold before my gains would start hitting the 15% rate. That stopped me from over-harvesting by a few thousand dollars. Worth checking your numbers carefully before you pull the trigger.

Tony P.

Author

That's the part I was fuzzy on — that the gains themselves count toward pushing you over the threshold. So I need to figure out taxable income *before* adding the gains, then see how much headroom I have. That makes sense. How did you figure out your projected taxable income mid-year before you had all your forms?

I used my prior-year return as a starting point and adjusted for anything I knew had changed — different W-2, any other income. It's not perfect but it gets you close enough to know roughly how much room you have. Then I was conservative and left a buffer.

Are you sure you've held all these positions more than a year? Because the 0% rate only applies to long-term capital gains. Short-term gains are taxed as ordinary income no matter what bracket you're in. Worth double-checking your 1099-B cost basis details and acquisition dates before you assume everything qualifies.

Tony P.

Author

Good point. I checked and most of them are well over a year, a couple are right on the edge. I'll be careful with those.

For the ones right on the edge — Publication 550 on the IRS site explains that the holding period starts the day *after* you acquired the shares and ends on the trade date you sell. So be precise about those dates before you sell.

Does your state have its own capital gains tax? Because even if you owe zero federal, some states tax capital gains as ordinary income and don't follow the federal 0% bracket at all. That could change the math on whether harvesting gains right now actually benefits you.

Tony P.

Author

I'm in a state with no income tax so that part is fine for me, but good flag for others reading this.

The wash sale rule won't apply here, which is what I think you were worried about. Wash sales only disallow losses, not gains. You're harvesting a gain, not a loss, so there's no 30-day repurchase restriction. You can sell and immediately buy the same shares back and there's no issue. Your new cost basis just becomes the price you paid when you bought back in.

Stepping in here because this is important to get right: wash sale rules apply to losses only, correct. But if someone in another situation sells at a loss and buys back within 30 days before or after, that loss is disallowed and gets added to the basis of the repurchased shares. Just want that in the thread clearly since the original post mentioned wash sales.

Appreciated — yes, for gain harvesting specifically you don't have that problem. For anyone also sitting on losers thinking of doing loss harvesting in the same account, the 30-day window absolutely matters.

How much are we talking in potential gains? The strategy makes a lot of sense in theory but transaction costs, any state tax you didn't mention, and whether you might have other surprise income later in the year (a bonus, freelance work, anything) can all narrow or eliminate the benefit. What does the rest of your expected income look like for the year?

Tony P.

Author

Gains are meaningful but not massive. Income is pretty predictable — just the W-2, no side income expected. No bonus coming. So I think the picture is relatively clean but I want to model it out properly before I do anything.

Worth running the numbers with your actual Schedule D details before selling, not just estimating in your head. I had a similar setup last year — sitting on long-term gains and thought I had room in the 0% bracket. I uploaded my W-2 and my brokerage's year-end statement to Taxr and it mapped out the gain headroom, flagged that one position was actually short-term based on the acquisition date on the 1099-B, and drafted a summary showing which lots to sell and in what order. Saved me from a tax surprise. The threshold for the 0% bracket — how much taxable income fits under it — is in the Schedule D instructions, it changes with filing status and year.

Tony P.

Author

This is exactly the kind of pre-sale check I need to do. I didn't even think about sorting by lot — if I sell the wrong lot I could accidentally realize a short-term gain on a position I think of as long-term.

Next step: get your brokerage's lot-level detail, not just the position summary. Most brokerage sites let you view by lot with acquisition dates. That's what you need to match against the threshold math.

Does your brokerage let you choose specific lots when you sell? If you have multiple purchase dates for the same stock, the default might be FIFO or average cost depending on the asset type. You'd want to specify which lots you're selling to make sure you're only realizing the long-term gains you intend to.

Tony P.

Author

I checked and yes, I can do specific identification. I'll need to set that up before I place the order. Good catch.

Something that tripped me up when I tried this: Social Security income, if you have any, gets pulled into the picture too. It can affect how much of your income is taxable and therefore how much room you actually have. Probably not your situation from what you described, but worth knowing.

Are you planning to reinvest immediately after selling, or hold cash for a bit? If you're immediately buying the same shares back, make sure you're comfortable with being out of the market even briefly. For highly volatile positions, the gap between sell and repurchase could cost you more than the tax savings.

Tony P.

Author

Planning to buy back same day if possible. The positions aren't super volatile but I take the point — the tax benefit has to actually exceed any market timing risk.

Just to flag the mechanics of reporting: when you do sell, those sales go on Form 8949. Long-term gains with basis reported to the IRS go in Part II, box D. If your broker reports cost basis to the IRS (which most do for covered securities), you'll check box D. The totals flow to Schedule D line 8a if there are no adjustments, or through Form 8949 if there are. Keep the 1099-B you get next January to reconcile.

Worth adding: if you're just doing a clean sell with no adjustments needed, those transactions can go straight on Schedule D line 8a under Exception 1 in the Form 8949 instructions, without filling out every row of Form 8949. Only works when there are no adjustments and basis was reported to the IRS.

Correct — that's the cleaner path when nothing needs correcting. The 8949 instructions call it Exception 1 and it's specifically for transactions where basis is reported to the IRS and no column adjustments are needed.

Has anyone thought about what happens if the market runs between now and year end and you end up with more income than expected? Like if you sell in March to harvest gains and then get an unexpected freelance project, you might push yourself into the 15% bracket and wish you hadn't realized those gains yet. Timing matters a lot here.

Tony P.

Author

That's a real risk. I think the safest move is to harvest closer to year end once I have a clearer picture of my full-year income. That way I can be more precise about how much room I actually have.

Waiting until November or December is what most people who do this deliberately actually do — you have enough of the year behind you to project accurately. Earlier in the year there's just more uncertainty.

The step-up in cost basis is the actual long-term payoff here — you're not just saving on this year's taxes, you're reducing future taxable gains on the same positions. If you eventually sell those shares at a much higher price, your starting point is now higher. That's the compounding benefit people don't always spell out.

Are you itemizing or taking the standard deduction? That affects your taxable income, which is the number that actually determines your bracket. If you're taking the standard deduction, your taxable income is lower than your AGI, which usually means more room in the 0% bracket than people expect when they look at their gross W-2 number.

Tony P.

Author

Standard deduction for me. So I should be using taxable income after that deduction as my baseline, not gross income. That's what the first reply said too — I need to build from taxable income up, not from W-2 down.

Topic 409 on irs.gov and the Schedule D instructions both spell out how the brackets interact with long-term capital gains. The rate that applies to any given dollar of gain depends on where that dollar falls after all your other taxable income is stacked underneath it. The IRS page on Topic 409 explains the stacking order clearly if you want to read it directly.

If your gains are large enough that you're unsure whether you'll stay fully in the 0% rate, you could harvest in tranches. Sell part now, see where you land mid-year, then decide whether to sell more. You don't have to do it all at once.

Tony P.

Author

Tranching is smart. I hadn't thought of breaking it into two or three sales spread across the year. That gives me flexibility if something changes with my income.

Exactly — and each tranche you can re-check the math with your updated income picture. More work but less risk of overshooting the bracket.

Worth saying plainly: if the gains are large, you have multiple accounts, or you're unsure about your full income picture, sitting down with a CPA before you sell is worth the cost. The strategy is straightforward in simple cases but can get complicated fast if you have IRAs, other investments, or state tax wrinkles. A CPA can model the full picture including AMT if that's ever relevant.

Tony P.

Author

My situation is pretty simple — single filer, one brokerage account, no IRA complications — but I appreciate the flag. For anyone with more moving parts it's definitely worth getting a professional involved.