It’s great that you’re saving for retirement. You’re probably taking advantage of a 401(k) plan, a traditional IRA, a Roth IRA, or some combination of these retirement plans.

However, you can undo all the good by making a single bad decision with these accounts, costing you dearly in taxes and penalties. Fortunately, it’s easy to protect your retirement savings by following these five simple rules.

Follow these rules, and you’ll avoid making some bad retirement mistakes:

Rule #1: Don’t make early withdrawals from a 401(k) or traditional IRA.
Money you take from your 401(k) plan or a traditional IRA is considered income to you. You will be taxed on 100 percent of the amount you take out at your marginal income tax rate on the date of withdrawal. When computing the tax due, you will need to know both your federal and state tax rates.

It gets worse.

If you make withdrawals from these plans before age 59 1/2, you will pay an early-withdrawal penalty of 10 percent of the amount you withdraw, in addition to the taxes you’ll have to pay.
You don’t have to be an accountant to see that early withdrawals are a financial disaster. Before going down this path, investigate alternatives.

Rule #2: Borrow from your 401(k) instead of taking an early withdrawal from an IRA.
If your company permits you to borrow from your 401(k), you can typically borrow up to 50 percent of the total vested assets in your account, up to a maximum of $50,000. Check your plan for other restrictions.

As a general rule, you need to repay the loan within five years. However, there is an exception permitting a longer payback if you are using the loan proceeds to purchase a primary residence.
If you leave your employment (voluntarily or not) before repaying the loan, you may be required to repay it in full within sixty days, or be subject to taxation and penalties on the outstanding balance.

Finally, many companies charge a fee for a 401(k) plan loan, so don’t forget to ask.

Rule #3: Use an IRA rollover to withdraw money.
While IRA loans are not permitted, you do have some wiggle room. But you have to be very careful when taking advantage of it.

You can use what is called a “sixty-day rollover.” It applies to both Roth and traditional IRA accounts. Here’s how it works:

You can withdraw money from your IRA without taxes or penalties provided you redeposit the funds within sixty days of withdrawal. If you miss this deadline, you are liable for taxes and penalties. You can do this only once a year from the same IRA.

Rule #4: If you have to withdraw, do it from a Roth IRA.
Because you funded your Roth IRA with after-tax dollars, more liberal rules apply.

You can withdraw the amount you invested in a Roth IRA (your contributions) at any time without paying taxes or penalties. But, you can’t withdraw any of the gain for five years.

If you withdraw your gains before the five year period has ended, you may be subject not only to taxes but also an early-withdrawal penalty of 10 percent of the gains if you haven’t reached age 59 1/2.

Rule #5: See if you qualify for an exception.

When it comes to paying taxes and penalties on early withdrawals from qualified plans, there are some exceptions. Here are the major ones, but there are others:

  • Distributions made on or after your death
  • Distributions made if you are partially or totally disabled
  • Distributions used to pay qualified medical expenses or premiums
  • Distributions used to pay the costs of a first-time home purchase (subject to a lifetime limit of $10,000)

Check with your tax adviser to see if you qualify for an exception. The rules are complicated.

Here’s the takeaway: avoid taking any distributions from your qualified retirement plans unless you have no other option. The taxes and penalties are just too onerous.

Dan Solin is a best-selling author, a wealth advisor with Buckingham, and the director of investor advocacy for the BAM Alliance.