Participating in your employer's 401(k) plan is a great way to build wealth for retirement, especially if you get a company match as part of the deal. But what happens when you leave your job, whether willingly or not? You may be tempted to cash out your 401(k) rather than leave it in a plan sponsored by a company you're no longer employed by. That move, however, is one you'll likely wind up regretting.

Cashing out a 401(k) has consequences

Cashing out a 401(k) can result in some pretty serious financial losses. Let's assume you have a traditional 401(k), and that you're at least 59 1/2. If that's the case, you won't face an early withdrawal penalty for getting at that money, but you will be hit with what could be a pretty substantial tax bill on the sum you collect. Traditional 401(k) withdrawals are taxed as ordinary income -- meaning, the highest rate that applies to you -- and cashing out a large sum at once could result in a whopping debt to the IRS.

Glass jar with rolled-up bills and coins labeled 401K


Meanwhile, if you cash out your 401(k) before reaching age 59 1/2, you'll face a 10% early withdrawal penalty on the amount you remove. This means that if you have a $100,000 balance, you'll lose $10,000 right off the bat, and that's money you'll never get back.

That said, there are a few exceptions to this rule. For example, if you're 55 or older at the time you separate from your employer, the 10% early withdrawal penalty won't apply. Similarly, you may be eligible for a penalty-free early withdrawal if the money is needed to pay for medical expenses that exceed 10% of your adjusted gross income. But unless a special circumstance applies to you, you'll need to be prepared to give up 10% of your 401(k)'s value if you cash it out before age 59 1/2.

A better solution when you leave your job

Since cashing out a 401(k) can work out unfavorably, it pays to explore alternatives that allow you to remove your money from your former employer's plan. First, if you leave your job because you've gotten another, you can roll your old 401(k) into a new one sponsored by the company you're about to work for. There's also the option to roll your 401(k) into an IRA, which you can do whether you have access to a new 401(k) plan or not.

The best way to transfer funds from one retirement plan to another is by direct rollover. If that's not possible, then your next best bet is to cash out your 401(k), but then take all of the money you receive by doing so and deposit it into a new 401(k) or IRA within 60 days. As long as that cash lands in another qualified retirement plan within that timeframe, you won't face an early withdrawal penalty, nor will you be on the hook for taxes, since you won't be considered to have taken an actual distribution.

Of course, there is one final option to consider: leaving your 401(k) alone. Many people don't like the idea of participating in a plan sponsored by a company they're no longer employed by, but if that plan has low fees or investments that appeal to you, you might consider keeping your retirement cash where it is. Remember, the money in that account is still yours, and separating from your former employer won't bar you from reaping the benefits that 401(k) has to offer.