Should I realize long-term capital gains before Social Security and 401k withdrawals?

Trying to figure out sequencing here before I make any moves. I'm 63, retired early, living off taxable brokerage accounts right now. No Social Security yet, no 401k withdrawals yet. I have a decent amount of unrealized long-term capital gains sitting in index funds. My question is whether I should realize long-term capital gains before Social Security and 401k withdrawals kick in, or whether that timing actually matters for how they get taxed. I've read that LTCG rates depend on your total taxable income, so I'm wondering if taking gains now while my income is low could be meaningful. But I don't fully understand how SS income and traditional 401k distributions would interact with the LTCG rate brackets once they start. Does pulling gains now actually help, or am I overthinking the sequencing?

32 comments

Schedule D is where this plays out, and the rate on your long-term gains (0%, 15%, or 20%) depends on your total taxable income for the year, which includes ordinary income. So yes, the sequencing genuinely matters. Right now with no SS and no 401k draws, your taxable income is likely low enough that some or all of those gains could land in the 0% LTCG bracket. Once you start pulling from the 401k (which is ordinary income) and once SS becomes partially taxable (up to 85% can be included in income), you push more of the gains into the 15% bracket. The gap between now and then could be real money.

Ben K.

Author

That's the core of what I'm trying to figure out. So the 401k withdrawals would essentially eat into whatever room I have at the lower LTCG rate?

Exactly. 401k distributions are ordinary income and they stack first under how the tax calculation works. The gains sit on top. So every dollar of 401k income you add later is a dollar that could have been a 0% gain realized now.

Worth adding: Social Security taxation is its own layer. Once you start collecting, up to 85% of your SS benefit gets included in your adjusted gross income depending on your combined income (AGI plus nontaxable interest plus half your SS benefit). That combined income formula means realizing gains in the same year as SS can push more of your SS benefit into taxable income. Doing it now before SS starts sidesteps that completely.

Ben K.

Author

The combined income formula is something I hadn't fully thought through. So LTCG realized now don't affect SS taxation at all since I'm not collecting yet?

Right, because there's no SS benefit to tax yet. You only have to worry about the interaction once benefits start.

Something people miss: realizing gains in the low-income years also avoids the net investment income tax (NIIT), which layers on above certain income thresholds. If your income stays below that threshold, no NIIT. Once SS and 401k withdrawals push your MAGI above it, gains get hit with an extra 3.8%. Check the Form 8960 instructions for the thresholds since they're income-based and your situation determines where you land.

Be careful about the ACA marketplace premium tax credit if you're using that for health coverage during this gap. LTCG count as income for the credit calculation. I ran into this and realized that harvesting too many gains in one year could affect my subsidy. Worth modeling it before you pull the trigger.

Ben K.

Author

Not on marketplace coverage right now but good flag for others reading this.

I did almost exactly this planning last year. Uploaded my brokerage statements and a draft income estimate to taxr.ai and had Taxr map out which lots would hit the 0% bracket given my projected AGI, and which ones would spill into 15%. It actually flagged a lot I'd forgotten had a short holding period so I would have accidentally reported it as short-term. Saved me from a dumb mistake. For the actual mechanics: Form 8949 is where each sale gets reported, and the LTCG rate that applies comes out of the Qualified Dividends and Capital Gain Tax Worksheet in the Form 1040 instructions (line 16), which the Schedule D instructions point you to. That worksheet is what determines whether your gains actually hit 0% or 15%, based on your total taxable income.

Ben K.

Author

The lot-level detail is exactly what I need to work through. I have shares from multiple purchase dates across different years.

Qualified Dividends and Capital Gain Tax Worksheet is worth pulling up now even just to see the structure. It makes the stacking logic concrete.

One mechanical thing to confirm: the holding period starts the day after you acquired the shares and the trade date of the sale is the day that counts as the end, not settlement date. So double-check any lots you're thinking of selling soon to make sure they're actually past the one-year mark. Form 8949 column (b) is the date acquired, column (c) the date sold, column (d) proceeds, column (e) is cost basis. Get those right before you sell.

Ben K.

Author

Trade date not settlement date — good to have that confirmed. My brokerage account shows both and I was going to use settlement.

The 0% LTCG bracket isn't unlimited. It applies up to a taxable income threshold that you can find in the Schedule D instructions for the current year. If you're doing this over multiple years before SS and 401k start, you might be able to spread the gains across several years and stay in the 0% zone each time rather than dumping everything in one year and bumping into 15%.

Worth being clear on what "taxable income" means in this context — it's after the standard deduction (or itemized, whichever you take). So your AGI comes down before you hit the rate brackets. That gives you a bit more room than you might think if you're just looking at gross income.

Qualified Dividends and Capital Gain Tax Worksheet Step 1 makes this explicit — it starts with taxable income from your Form 1040 line 15, which is already after deductions.

If you're not already, consider keeping track of your cost basis method. FIFO is the default at most brokerages, but you may be able to specify lots (specific identification) to choose which shares you sell. That lets you sell only the lots with the longest holding periods or the specific gain amount that fits your bracket. Publication 550 on the IRS site covers the basis methods.

Ben K.

Author

My brokerage does offer specific lot identification. I've never actually used it but this seems like the year to start.

Form 8960 and the Qualified Dividends and Capital Gain Tax Worksheet are the two forms to actually stress-test this. I pasted my prior-year 1040, my projected income for this year, and a list of unrealized lots into Taxr, and it walked through both worksheets to show me which scenario — realizing gains now vs. waiting a year — produced a lower total tax. It didn't file anything, it just laid out the numbers so I could see the difference before deciding. Really clarified what the right sequence was for my situation.

Roth conversion is adjacent to this question. If you're in a low-income year anyway, converting some traditional IRA or 401k money to Roth while also realizing LTCG could be useful — but you'd need to watch that the ordinary income from the conversion doesn't push the gains out of the 0% zone. Those two moves can compete for the same low-bracket space.

Ben K.

Author

Roth conversions have been on my list too. So they'd stack the same way as 401k withdrawals for purposes of the LTCG bracket?

Yes. Roth conversions are ordinary income, same as a 401k withdrawal. They fill the lower ordinary income brackets first and push the LTCG up. If you're trying to stay in the 0% LTCG zone you have to count the conversion amount as part of your total taxable income.

AMT is worth a quick sanity check if you have ISOs in the mix. Standard LTCG from index funds don't trigger AMT, but ISO exercises do — the spread goes on Form 6251 line 2i. If you're only dealing with straight index fund gains, ignore this, but if stock options are anywhere in the picture, the sequencing question gets more complicated.

Social Security Full Retirement Age matters too for the sequencing on the SS side. If you claim SS early your benefit is reduced, which could actually mean less SS income stacking on top of your gains later. Delayed claiming increases the monthly benefit but also increases how much ordinary income eventually enters the picture. That tradeoff feeds directly into your gains timing question.

Ben K.

Author

Planning to delay SS to 70 so the benefit will be larger. Which I guess means I have more years of low income to work with before it starts but also a larger SS income once it does.

Exactly the tension. More years of 0% gain harvesting opportunity now, but eventually a larger SS amount that will be up to 85% includable. The combined income formula hits harder with a bigger benefit.

To actually run the numbers: pull up the Form 1040 instructions and work through the Qualified Dividends and Capital Gain Tax Worksheet twice — once with your current projected income and the gain amount you're considering, once with what your income looks like in a year you'd have both SS and 401k withdrawals. The difference in tax on those two runs is your answer. It's tedious but it's the only way to see your actual number rather than a general principle.

One scenario worth modeling: what if you delay realizing and the market drops? You'd have been better off taking gains at the lower rate while they existed. The tax timing benefit only helps if the gains are still there. I'm not saying time the market, just that the "wait" option has its own risk.

Ben K.

Author

Fair point. The plan was always to hold these funds long term so a drop wouldn't change that, but the unrealized gain amount would obviously be different.

Publication 550 at irs.gov covers holding periods and the wash sale rules in detail if you want to read the source rules. Topic 409 on the IRS site covers the LTCG rate structure. Those two pages together give you the foundation for everything discussed here.

Ben K.

Author

This thread gave me a lot more than I expected. The key takeaway for me: use the Qualified Dividends and Capital Gain Tax Worksheet to run two scenarios, watch the combined income formula once SS starts, use specific lot identification, and do this across multiple low-income years if possible. Going to work through the worksheet before making any moves. Thanks everyone.