Image: 401k © Tom Grill, Corbis

When you leave a job, you have three ways to preserve your retirement account balance: leave it in the existing 401k plan, roll over the money to an individual retirement account or transfer the balance to the 401k plan at your new job. The hard part is choosing the option that preserves as much of your retirement savings as possible. Here are seven potential strategies for minimizing taxes and fees on your retirement account when you change jobs:

Wait until you are vested. You don't get to keep employer contributions to your 401k until you are vested in the plan. If you leave the company before you are fully vested, you could forfeit some or all of your 401k match. If you have control over when you leave the company and are close to becoming vested, staying with the employer long enough to reach that milestone could add thousands of dollars to your nest egg.

"Look at how much you would get if you vest and how much you are going to make at this other employer and also the new match or profit-sharing contribution," says Barbara Camaglia, a certified financial planner for Legacy Financial Advisors in Beachwood, Ohio.

Seek a direct rollover to the new account. Ask your former employer to directly transfer your 401k balance to an IRA or your new company's 401k plan. This is the simplest way to avoid taxes and penalties when closing out an old 401k plan. "If you are planning to leave the money tax-deferred, then the best way to do that is a trustee-to-trustee transfer," says Rosemary Danielson, a certified financial planner for Balanced Financial Planning in Overland Park, Kan. "A trustee-to-trustee transfer allows you to avoid having any tax withheld on that rollover."

If you instead get a personal check from your employer, 20% of your account balance will be withheld for income tax. And if you don't deposit the entire account balance, including the withheld 20%, into a new retirement account within 60 days, it is considered a withdrawal. You will become responsible for paying income tax and, if you are younger than 55, a 10% early withdrawal penalty on any amount not rolled over. For example, if you have $100,000 in your 401k, your employer could write you a check for $80,000. If you deposit only the $80,000 in an IRA, the $20,000 will be counted as income, and taxes and the early withdrawal penalty may be applied.

Look for lower-cost investments. If you're unhappy with the fund choices in your 401k plan, a job change is the perfect time to seek better investments with lower fees. "IRAs give you more investment flexibility and a much wider selection," says Camaglia. IRAs don't always offer lower costs than 401k plans, though, because some 401k plans are able to negotiate ultralow fees on behalf of participants.

"Some 401k's have some very good choices," says Camaglia. "Some 401k's get institutional shares, which means the expense ratios are less." If your 401k plan has particularly good investments, you can leave the money there or move it to your new employer's 401k plan.

Account for your age. Workers who take IRA distributions before age 59 1/2 generally need to pay a 10% early withdrawal penalty. However, people who leave their jobs during the calendar year they turn 55 or later can take penalty-free withdrawals from their 401k's. "If you have to leave your employer between 55 and 59 and you think you are going to have to utilize some of those funds for living, then it's best to leave it in the 401k because you can take distributions without facing the penalty," says Danielson.

Consider creditor protection. If you are in debt, money held in a 401k could be better protected from creditors than an IRA balance would be. IRA creditor protections vary by state. "Creditors can make claims against an IRA," says Ann Terranova, a certified financial planner for Union Financial Partners in San Francisco. "Not only is the 401k protected from creditors against the participants, but the 401k is also protected against the company's creditors if the company goes bankrupt."

Leave employer stock behind. Company stock gets special tax treatment when it is held in the company 401k. While the original cost of the stock will be taxed at ordinary income tax rates when you withdraw it, the appreciation of the shares is taxed at the often lower long-term capital gains rate when you sell it. However, you will lose out on the lower tax rate if you roll over the stock to an IRA.

Don't cash out. If you cash out a $50,000 balance in a 401k account and you are in the 25% tax bracket, you could face a $12,500 tax bill in a single year. And if you are younger than 55, you could face an additional $5,000 early withdrawal penalty. If you roll over the balance to an IRA or new 401k, though, you'll avoid the early withdrawal penalty and can continue to defer income taxes until age 70 1/2, when annual withdrawals are required.

Click here to become a fan of MSN Money on Facebook

More from U.S. News & World Report: