Image: 401k © Brand X Pictures, age fotostock

Related topics: mutual funds, 401k, Fidelity, retirement savings, credit

Taking out a loan against your 401k is usually considered a big no-no by financial advisers.

After all, you miss out on the chance to earn returns on the money during the loan period, and if you suddenly lose or leave your job, you have to repay the loan within 60 days. You also miss out on the tax benefits, because you have to repay the loan with after-tax dollars.

But according to a recent paper (.pdf file) from the Michigan Retirement Research Center, people do use their 401ks to provide cash for purposes other than retirement, and that's not necessarily a bad thing.

Using a loan to pay off high-interest credit card debt, for example, can end up saving the borrower money. And the researchers point out that if workers know that a 401k loan is an option in case of emergencies, they might be motivated to funnel more money into their retirement accounts.

In a tough economy with tight credit markets, more workers are taking advantage of this option, with 11% of account owners taking out a loan in the past 12 months, compared with 9% a year earlier, according to Fidelity.

Just over two in 10 account owners currently have outstanding loans, and the average size of a loan is $8,650.

Still, 401k loans aren't a good idea for everyone. To decide whether a 401k loan is a good idea for you, consider these six questions:

What are your employer's rules for 401k loans?

Your company might not offer a 401k loan at all, and if it does, it probably comes with fees and restrictions. Interest rates on 401k loans are usually slightly higher than the prime rate, but again, companies have discretion and could charge a higher interest rate. (That interest gets paid back into the account holder's funds.)

Companies can impose their own limits, but federal law allows account holders to borrow as much as half of their account balance, up to $50,000. That means if you've saved $100,000, you can borrow a maximum of $50,000, but if you've saved only $50,000, you can access only $25,000. To avoid any surprises, make sure you know your company's policy.

How stable is your job?

One of the biggest risks with 401k loans is that you'll leave your job, either by choice or through a layoff. In most cases, you must immediately repay the loan, usually within 60 days, or face penalties.

"It's not uncommon for people to change jobs frequently, and it's important to know those tax consequences," warns Catherine Golladay, the vice president of education and advice at Charles Schwab.

Do you have a long-term plan?

Even though it might make numerical sense to take out a 401k loan to pay off high-interest credit card debt, it's not necessarily a good idea, says Golladay. Unless you have a long-term plan, you might find yourself racking up the same kind of expensive debt again, even with the 401k loan.

"You might see your credit card debt paid off, but then a year later, when an emergency comes up, you're back in the same cycle," she says.

Have you asked for help?

Your company or 401k plan provider might offer free counseling; at the very least, someone should be able to walk you through the plan's rules and fees.

Gerri Detweiler of Credit.com recommends talking with a credit counselor and possibly a bankruptcy attorney before using 401k funds to settle debt. She adds that while consumers should be careful, sometimes it can be smart to use a small amount of retirement money to settle high-interest-rate debt for a fraction of the total balance.

"This could put the debt behind them and help avoid either a lawsuit or a bankruptcy," she says.

Can you contribute to your 401k while you repay the loan?

If you stop making contributions to your retirement account when you take out a 401k loan, you'll be creating an even bigger hole in your retirement savings.

According to one study, a loan of $30,000 can cost borrowers as much as $600,000 in the long run if they also stop contributing to their accounts during the repayment period. (That calculation includes the cost of missing out on market gains.)

Click here to become a fan of MSN Money on Facebook

Are you in danger of bankruptcy?

During bankruptcy proceedings, retirement savings accounts are usually protected, but a loan against your 401k would not be. That means it would be safer to keep your money protected in your 401k if you are in danger of filing for bankruptcy.

The bottom line: The old advice that 401k loans are always a bad idea is too simplistic. Sometimes, taking a loan against your retirement account can provide a much-needed cash boost. But make sure you have a long-term plan and understand the risks involved so you don't deplete your retirement funds and make a costly mistake.

This article was reported by Kimberly Palmer for U.S. News & World Report.