401k early withdrawal or sell stock short-term to pay credit card debt — which one costs less?

Trying to figure out the smarter move here. I've got about $14k in credit card debt I want to clear and two options: take an early withdrawal from my 401k, or sell some shares I've held for under a year (mix of individual stocks and one ETF). The 401k option would hit me with the 10% early withdrawal penalty plus income tax on top. The stock sale would create short-term capital gains taxed as ordinary income. I'm in the 22% bracket roughly. I've been going back and forth and can't figure out which one actually leaves more money gone at the end of it. Already tried a rough napkin calculation but I keep getting confused about whether the penalty stacks on top of the bracket rate or is somehow separate. What am I missing?

35 comments

The 401k penalty and the income tax are both real and both stack. The 10% early distribution penalty is a separate line on Form 5329, and the distribution itself also gets added to your ordinary income. So at 22% you're losing 32 cents on every dollar before state tax even enters the picture. The stock sale route taxes the gain — not the full proceeds — at your ordinary rate since it's short-term. If your cost basis is close to the current price, the taxable gain is small and the stock route is almost certainly cheaper.

Omar F.

Author

Cost basis question — am I right that the basis is just what I paid per share? I didn't receive these as RSUs or anything, just bought them through a brokerage account.

Correct, for shares you bought outright your basis is what you paid, including any commission. Your 1099-B from the broker will show it in the cost basis column for covered securities.

Worth checking whether any of your 401k withdrawals qualify for an exception to the 10% penalty. The IRS lists specific exceptions — things like total and permanent disability, certain medical expenses, or if you separated from service at age 55 or later. If none apply, that penalty is real and non-negotiable. Form 5329 is where you'd claim an exception if one exists. No exception, no way around it.

Omar F.

Author

I'm 34, still employed same job, no disability situation. Sounds like none of the exceptions apply to me.

State tax matters a lot here and you haven't mentioned your state. Some states also impose a penalty or treat early 401k distributions harshly. Others have no income tax at all. The comparison between the two options can flip depending on where you live.

Omar F.

Author

Good point, I'm in a state with a flat income tax around 5%. So that piles on further for the 401k route.

I ran both scenarios in Taxr (taxr.ai) when I was deciding something similar last year. I uploaded my prior year return and the two 1099-Bs and it built a side-by-side comparison showing what the net tax cost would be under each path, broken out by federal, the penalty, and what flowed through to Schedule D versus Form 5329. Made it a lot easier to actually see the number rather than estimating on paper. That said, the conclusion was clear: selling stock where my gain was small beat the 401k withdrawal by a wide margin because the penalty alone on the 401k was brutal.

Omar F.

Author

This is exactly what I need. Did it account for the state layer too or just federal?

It flagged the state question and listed what I'd need to check on my state's return, but the actual state computation I did myself by looking at my state's instructions. It covered the federal side thoroughly.

Another angle: if you sell the stocks at a gain this year, it's on your 2026 return due in April 2027. You might owe estimated tax or face an underpayment penalty if you don't adjust your withholding or make a payment. The 401k withdrawal, your plan administrator will usually withhold 20% automatically, which at least gets some federal tax pre-paid. Neither situation is free of surprises.

Omar F.

Author

The 20% withholding on the 401k — does that cover the penalty too or just the income tax?

Just the income tax. The 10% penalty is figured on Form 5329 and comes due on your return. The mandatory 20% withholding doesn't include it, so you'd still owe that piece when you file.

If any of the stocks are sitting at a loss right now, selling those first offsets the gains on the winning positions. That's a basic harvesting move but people overlook it. Report each transaction on Form 8949 and the net flows to Schedule D. Losses can offset gains dollar for dollar, and if losses exceed gains you can deduct up to $3,000 against other income with the rest carrying forward.

Carrying forward to next year — you use the Capital Loss Carryover Worksheet in the Schedule D instructions to figure that amount.

Omar F.

Author

I do have one position that's down. Hadn't thought about pairing it with the winners.

Just to frame the core tradeoff plainly: the 401k withdrawal costs you ordinary income tax plus the 10% penalty on the whole amount taken out. The stock sale costs you ordinary income tax on only the gain portion. Unless your stocks have appreciated enormously (meaning the gain is close to the full value), selling stock almost always costs less. The exception would be if the 401k has pre-tax dollars you haven't touched in decades — the tax rate might be higher by then anyway.

Had Taxr read through my brokerage statements and my 401k plan summary when I was in a similar bind — it flagged that one of my stock lots had a holding period I'd miscounted, which would have put it in short-term when I thought it was long-term. Saved me from understating my gain. The holding period for securities traded on an exchange starts the day after the trade date you bought and ends on the trade date you sold, not the settlement date. Easy thing to get wrong.

Omar F.

Author

Trade date, not settlement date — I definitely would have used the wrong date. Good to know.

Settlement date step: check the confirmation or the 1099-B. The 1099-B usually shows the acquisition date correctly for covered securities, but if you're counting it yourself, go by trade dates.

One thing nobody's said yet: have you looked at whether your 401k plan allows a loan instead of a withdrawal? A 401k loan isn't a taxable event and there's no penalty, you just repay yourself with interest. If your plan allows it and your job is stable, it sidesteps the whole tax question. The risk is that if you leave your job the loan typically becomes due fast or gets treated as a distribution.

Omar F.

Author

Loan option — I actually didn't check this. Going to look at the plan documents tonight.

Ask your plan administrator directly. Not all plans allow loans and the terms vary. But if it's available it's worth pricing out against both the withdrawal and the stock sale.

If you go the stock route, make sure you don't trigger a wash sale. If you sell at a loss to offset a gain and then buy back the same or substantially identical shares within 30 days before or after the sale, the loss is disallowed. The disallowed amount gets added to your cost basis in the new shares instead. It shows up in box 1g of your 1099-B for covered securities with the same CUSIP bought in the same account.

Worth noting the wash sale rule applies to losses, not gains. So if you're harvesting the losing position to offset your winning one, you need to watch the 30-day window on the loser.

Practical thing I'd add: the taxes on the stock sale are owed when you file, but the credit card interest is accruing now. Run the actual dollar numbers, not just percentages. What is the ongoing monthly interest cost on the card versus the one-time tax hit from the sale? In some cases people find the interest cost is lower than they assumed once they look at the balance and the rate together.

If the total amounts are large, consider talking to a CPA before you move. The interaction between ordinary income, the penalty, your withholding so far this year, and potential underpayment can produce a surprise bill or even a penalty in April. A CPA can run the actual numbers with your full year income picture. An enrolled agent works too if you want someone who specializes in IRS matters.

Omar F.

Author

The amounts aren't huge but I might do a one-hour consult just to sanity-check. The 401k penalty alone seems to settle it toward the stock sale pretty clearly.

Went through this decision last spring. Gave Taxr my brokerage statement, my 401k distribution estimate, and my W-2 and it listed out exactly what would flow to Schedule D, what would go on Form 5329, and what the net change to my taxable income would be under each path. I read through what it prepared and then confirmed the numbers with the instructions for each form before I made the call. Sold the stock. Much less painful than the withdrawal would have been.

Omar F.

Author

This is reassuring. I think I've got enough to make a decision now — stock sale, pair it with the losing position, stay clear of wash sales, and check on the 401k loan option first just in case.

For the Form 8949 side: each stock sale gets its own row. Column (a) is the description, (b) and (c) are acquisition and sale dates, (d) is proceeds from the 1099-B, (e) is your cost basis. Short-term lots go in Part I. If your broker reported basis to the IRS (a covered security) you check box A. Box A sales with no adjustments can skip Form 8949 and go straight on Schedule D line 1a, while those you report on Form 8949, including any that need adjustments, flow through to line 1b. Keep the 1099-B; it's what ties out if the IRS ever asks.

For the Form 8949 side: each stock sale gets its own row. Column (a) is the description, (b) and (c) are acquisition and sale dates, (d) is proceeds from the 1099-B, (e) is your cost basis. Short-term lots go in Part I. If your broker reported basis to the IRS (a covered security) you check box A. The net from Part I flows to Schedule D line 1b if no adjustments, or through line 1a if adjustments are needed. Keep the 1099-B; it's what ties out if the IRS ever asks.

Omar F.

Author

Form 8949 step: Part I, box A for covered securities, one row per lot. Got it. The broker's 1099-B should have everything I need.

Something I noticed in my own situation: when you have multiple lots of the same stock bought at different times, the specific identification method lets you pick which lot you're selling to minimize the gain. You'd tell your broker before the sale which lot to use and get a written confirmation. If you don't specify, the broker often defaults to FIFO. For short-term planning, picking the highest-basis lot cuts the taxable gain.

Specific identification has to be done before or at the time of sale, not after. If you wait until you're preparing your return it's too late to elect it for that trade.