Many companies featured on Money advertise with us. Opinions are our own, but compensation and
in-depth research may determine where and how companies appear. Learn more about how we make money.

Dollars in a man's hand
penguenstok—Getty Images

Q: My wife and I have a substantial amount of credit card debt. Does it make sense to use 401(k) money to clear the debt?

A: There’s a long answer to this question and a short answer. The short is just one word, two letters: No.

That’s because the IRS doesn’t give you the perks of a 401(k) — pretax contributions, tax-deferred investment growth — out of the goodness of its heart. The money is supposed to be earmarked for retirement; if you pull it out before then, you’ll pay income taxes and a 10% penalty.

Depending on your tax bracket, you could immediately hand over a third of what you’ve withdrawn; to have enough money leftover to pay off a $20,000 debt, for example, you might actually need to pull out $35,000.

Read More: How to Build Credit

And then there’s the opportunity cost of pulling that $35,000 out of the market, where — if left invested — it could grow to around $150,000 after 25 years, assuming a reasonable 6% average annual return.

In other words: Unless you need the money to save a life, the math quickly rules out an early withdrawal. But let’s talk about some alternatives.

First, a word about 401(k) loans

Not all providers allow it, but you may have read about this option in your plan documents. I don’t actually consider this a good alternative to pulling from your 401(k), and I want to explain why. With a 401(k) loan, you borrow money from your account, then pay yourself back with interest. On the surface, these seem like a gift: You can avoid an early distribution, pay off that debt in one chunk, and pay interest to yourself rather than to a credit card company. Win-win, right?

Again, no. These loans are a rosy-sounding solution, but they should be a last resort because of a litany of caveats. The biggest: If you leave your job, you’ll typically be required to repay the loan within 60 days. If you can’t — say, because you were laid off — the amount outstanding is treated as an early withdrawal (say hello to that 10% penalty and income tax).

Read More: Here’s How to Raise Your Credit Score 100 Points

Credit card debt is stressful; adding money owed to the IRS would be piling on. A 401(k) loan is marginally better than an outright distribution, but it falls near the bottom of your list of options. And you do have options.

Lower your interest rates …

Before you do anything drastic, try negotiating with your card issuer or consolidating to 0% balance transfer credit card or a personal loan.

A balance transfer promotional period might buy you 15 to 18 months; you want to pay off the debt before the rate shoots up. It’s a good option if you have excellent credit. Depending on your credit score and credit card balance, you may not be able to transfer the full amount, but knocking the interest rate down on even a portion is helpful.

A personal loan might stretch two to five years and allow you to consolidate your full balance; banks and credit unions that offer these loans are sometimes more accepting of a dinged up credit score, but they’re not the free(ish) ride of a 0% balance transfer. Make sure the personal loan’s interest rate is lower than you’re currently paying.

Read More: How to Build Credit

… then change your priorities for a while

If an interest rate break isn’t enough, you can consider making some bigger changes. Don’t worry, I’m not going to tell you what to cut from your budget to wail on this debt. You know all that, and you’ve probably already done it. But at this point, you may want to free up even more cash, not by tapping your 401(k), but by scaling back your contributions to it.

The blanket advice is to save for retirement before tackling debt. This is especially true if you’re offered a 401(k) that comes with matching dollars from your employer — also known as free money. But once you’re earning that match, the choice between contributing more and paying off debt mostly comes down to the debt’s interest rate versus your annual investment return. Also consider that by redirecting pretax retirement savings toward debt, you’ll lose out on that tax break.

Read More: Should I consolidate my debt?

Credit cards often charge an interest rate that well exceeds what you can reasonably earn investing, so it can make sense to lower your contribution percentage and get out of that debt — especially if you can do it in less than five years.

If you’re looking at a longer stretch — or you’ve already done all of the above — it might be time to look at debt relief. It will open the door to some additional resources, while preserving the retirement savings you’ve worked hard to build.