Here are some key things to consider before tapping your retirement savings to pay off credit card debt

With the national average interest rate on credit cards at historic highs, many Americans are being dinged with higher monthly charges than ever on on their balances.

As a result, they may be wondering if it’s a good idea to tap their retirement savings to pay off the debt.

After all, many people have most of their savings in their workplace retirement plans because they were automatically enrolled into them, and they may even have their contributions matched by their employer.

There are three main ways people can use their 401(k) workplace retirement plan to pay off credit card debt. They can take a withdrawal from the account, borrow from it or temporarily stop their contributions.

Here’s what you need to know about each of those three options.

1. Most people should avoid 401(k) withdrawals

Withdrawals from 401(k) accounts before age 59½ are subject to a 10% penalty and taxes. That means if you needed $15,000, you’d have to take out close to $24,000, after accounting for those charges, according to Fidelity.

Of course, any cash you pull from the account will also miss out on market gains. Stocks have produced an average annual return of more than 10% over the last 100 or so years.

All that “should combine to far outweigh the average credit card rate,” said Ted Rossman, a senior industry analyst at CreditCards.com.

There may be exceptions, however.

For people over 59½ and in a low tax bracket, a 401(k) withdrawal to pay off credit card debt may make sense because they’d avoid the 10% penalty and not be subject to a huge levy, explains Allan Roth, a certified financial planner and the founder of Wealth Logic in Colorado Springs, Colorado.

“Certainly, the math can make it worth it,” Roth said.

For most others, though, there are more appealing options than a withdrawal, Rossman said.

2. Suspending contributions means you’ll miss out on your company match

“Stopping your 401(k) contributions for a while — or at least cutting back — and redirecting those funds to debt payoff might make sense,” he said.

Still, that advice comes with an asterisk.

If your employer offers a company match, experts recommend you try to at least save up to whatever point that is, be it 3% or 5% of your paychecks.

“That’s free money that often doubles your return right there,” Rossman said.

A loan from your 401(k) plan is also usually preferable to a withdrawal, experts say.

3. 401(k) loans come with caveats, too

The interest rate on 401(k) loans is typically less than 5%, far below the annual charge on most credit cards. The interest paid on the loan also goes back into your savings rather than to a bank.

“Using a 401(k) loan to pay off high-interest debt, like credit cards, could reduce the amount you pay in interest to lenders,” said Jessica Macdonald, head of editorial content at Fidelity Institutional.

Other benefits to a 401(k) loan, Macdonald said, are that they don’t require a credit check and they don’t show up as debt on your credit report.

But there are other factors to consider here, as well.

For one, you’ll have to be able to repay the loan within five years. You could also face consequences if you leave your job and fail to pay the loan back. In such cases, your loan would be deemed in default, and you’d be hit with taxes and that 10% withdrawal penalty on whatever you still owe. And, again, your money will miss out on market returns.

Anyone considering turning to their 401(k) to address credit card balances would also be wise to think about the behavioral reasons why they got into the debt in the first place, some experts say.

“If one takes out money to pay off their credit card debt and then buys more to build the debt back up again, it backfired,” Roth said.