Q: I want to buy a house and I’m trying to clean up the debt I have on my credit history so my credit score will go up.

Is it ever a good idea to pay down credit card debt using 401(k) money? Assume I have $20,000 in credit card debt at roughly 10 percent interest that would take about 3 years to pay off given current income and expense levels.

Under these circumstances, should one make an early withdrawal of 401(k) dollars to pay off the debt now? Also, should one, in these circumstances, continue to contribute to the 401(k)?

Finally, how long will it take my credit history to improve enough for me to buy a house?

A: Taking funds from your 401(k) should be a last option, one just before turning to bankruptcy, I think.

There are a host of reasons not to do it, including strict payback requirements and penalties for early withdrawals from your 401(k) and the fact that you might short-change your financial future.

If you had taken your 401(k) cash out of the stock market in March, 2009, when the market hit a low mark, you would have missed the run-up, which would have replaced some, or most, of what you had lost.

If your company allows you to borrow from a 401(k), you’ll have to be careful about being able to pay back the loan quite quickly if you lose your job or are fired (you’ll typically have to replace all of the cash within 60 days).

If you’re forced to take the loan as a distribution (because you’re unable to pay it back within the required timeframe), there are severe tax consequences, including possibly bumping up your income to a higher tax bracket (so you’ll pay even more in tax) and a 10 percent penalty if you’re under the age of 59 1/2.

When might you pay off your loan with a 401(k)? If you’re paying 18 to 25 percent on your $20,000 in credit card debt, that’s a pretty hefty debt weight on your shoulders. (You’re paying 10 percent, which is probably more than what you’re earning with the cash but not obscenely high.)

Remember, with a distribution, you’ll need to take out enough to cover the taxes and any penalties you owe. So, if you need $20,000 to pay off your credit card debt, and you’re under the age of 59 1/2, you may have to withdraw nearly $40,000 in order to get your $20,000.

Is there anything else you can do to get this debt paid off faster? Can you cut back your budget severely? Can you get a part-time second job for a few months to begin making a dent in the debt? Is there a family member you can borrow from and repay with interest?

I’d rather see you explore all of these options before heading to your 401(k).