Imagine you're retiring today. You've been contributing to your 401(k) for decades, and you've built up a strong nest egg. Now what do you do with it?

Three in 10 employees don't have an answer to that question, according to a new study from the Employee Benefit Research Institute. In other words, they're heading into retirement with no plan in place for what to do with the savings they've worked a lifetime to accumulate.

Cash in 401(k) envelope next to a calculator

Image source: Getty Images.

Even among workers who did have an idea of what they wanted to do with their money once they retire, some of those plans were worrisome -- for example, 5% of respondents said they planned on cashing out their 401(k) and spending the money.

Unless you absolutely have no other choice, you shouldn't cash out your entire 401(k) when you retire. Not only are you preventing your investments from continuing to grow, but you also have to pay income tax on that amount -- which could be a hefty tax bill.

That leaves you with a couple other options: Roll your savings over into an IRA, or keep it in your 401(k). There are pros and cons to both options, but either way, it's important to have a plan in place before you need that money.

The case for rolling over to an IRA

The main advantage of an IRA is that you typically have a wider array of investment options. With a 401(k), you're limited to what your employer offers, and depending on your specific plan, those options may or may not be that great. If you take advantage of an IRA and you're strategic about where you invest your money, those smart investment choices could boost your savings.

IRAs can also offer more flexibility in terms of withdrawals. Every 401(k) plan is different depending on the company, but some only allow you to withdraw at certain times, such as quarterly or annually. With an IRA, you can withdraw your money whenever you like during retirement, which can be much easier than planning out how much you'll need each quarter or year.

Also, if your 401(k) is hitting you with a lot of fees, it may be a smart idea to roll your money over to an IRA. If you don't know how much you're paying in fees, check out your plan's prospectus. Or if you're not up for sifting through hundreds of pages of financial jargon, look through your plan's quarterly statements for details about fees and expenses. The average expense ratio for 401(k) participants investing in mutual funds is 0.53%, according to a 2016 study from the Investment Company Institute. While the expense ratio isn't the only fee you'll see in your 401(k), if you're paying a lot more than average, it may be worth it to look into an IRA with lower fees.

Another benefit of switching to an IRA is that you can consolidate all your different funds. Unless you've been at one job your entire life, you likely have multiple 401(k)s from multiple employers. While you can keep them all separate, sometimes it's just easier to have everything in one place.

When you should stick with your 401(k)

All of that being said, sometimes it's wiser to leave your money where it is. Whenever you move your money anywhere, you're taking a risk. Some brokers and financial advisors will try to convince you to roll your money over to an IRA, but they may not truly be working in your best interest -- earlier this year, a federal appeals court overturned a rule that required financial planners and advisors to put their clients' interests ahead of their own. So while brokerages may be begging you to give your money to them, always do your homework rather than relying solely on what the banks are telling you to do.

Sometimes you don't want to try to fix something that isn't broken. As long as you're comfortable with where your money is invested, it will often be less stressful to leave your savings untouched rather than try to move your money and risk making a mistake. This is an especially good idea if you're planning on working past age 70 1/2. With a traditional IRA, you're required to start taking distributions at age 70 1/2 whether you're working or not (that rule doesn't apply to Roth IRAs, though -- Roth IRA account owners are only required to take distributions in the event that the owner dies). With a 401(k), as long as you're still working, you're not required to take distributions -- the only exception is if you own more than 5% of the company.

Also, one benefit you have when you invest in a 401(k) that you don't get from an IRA is greater protection from creditors. In the event that you file for bankruptcy or get sued, the Employee Retirement Income Security Act protects your 401(k) from creditors trying to take your money. While laws vary by state, you generally get more protection with a 401(k) than you do with an IRA.

Having your money in a 401(k) may also be beneficial if you lose your job between age 55 and 59 1/2. Generally, if you withdraw from your 401(k) or IRA before age 59 1/2, you have to pay income tax as well as a 10% penalty on that amount. With a 401(k), though, while you still need to pay income tax, the 10% penalty is waived if you withdraw after age 55 -- which could save you thousands of dollars.

So what's the right choice?

Choosing where to put your money after you retire isn't an easy decision, and there isn't going to be a one-size-fits-all option. If you're paying extremely high 401(k) fees and you can only take withdrawals once a year, it may be wise to move your money into an IRA. But if your investments are earning good returns, you're paying a reasonable amount in fees, and you trust your company to manage your account for you, there's no reason not to leave your money in your 401(k).

Also, you don't necessarily need to choose one option or the other. You may opt to roll most of your money into an IRA but leave some cash in your 401(k) in the event that you lose your job between age 55 and 59 1/2. Or you may leave the majority of your savings in your 401(k) but roll some of it over to an IRA to test the waters before moving all your cash over.

Whatever you choose, be sure you have a plan in place before you retire. You've been working for decades to build a strong nest egg, so don't let one hasty decision hurt your chances at living the retirement of your dreams.

The Motley Fool has a disclosure policy.