Pulling money from a 401K is a greater mistake than owing credit card debt. The tax consequences of taking money from a 401K are an tax on the amount you withdraw equivalent to your tax bracket and a loss of future income from 401K assets.
I would not reccommend cashing out a 401K to pay down credit card debt. The potential for earnings are greater in the 401K than the cost of the credit card debt. Only cash out a 401K in a severe emergency because you may miss out on larger financial opportunities that arise.
Since a premature cash out fee is applied; cashing money out of a 401K hurts ones wallet by reducing the magic of compound interest on capital. Their are other ways to eliminate credit card debt besides pulling from the sacred pool of retirement savings.
It's far better to leave your 401K alone and continue to pay down your credit with the means you currently have. Cashing out your 401K robs the account of its time to accrue and there is a penalty with cashing it out.