Piggy bank 401k © Tom Grill, Corbis

One of the most common pieces of retirement advice is to max out your 401k. Many people -- finance gurus included -- are convinced this is a surefire way to secure a prosperous life after work.

The truth is, contributing to a 401k isn't for everyone. We'd like to believe in a single universally applicable panacea for retirement planning, but it simply does not exist. Everyone has a unique set of circumstances, needs and goals that will determine the appropriate course of action. In certain situations, dumping money into a 401k is imprudent.

Here are five reasons why you wouldn't want to buy into your company's 401k plan:

1. You don't have an emergency fund

Everybody needs one. Before saving, spending, investing or pretty much anything that involves moving money around, start by setting up an emergency fund. In the unfortunate case of a job loss, medical emergency or other personal crisis, you'll want to have the assets necessary to carry your family through to safety. Generally, the recommended emergency fund is equivalent to six months of income.

Establishing an emergency fund first is imperative. You don't want to be forced to dip into your 401k when hardships arise. Early withdrawal is a costly prospect. You will often be required to pay a 10% penalty fee on top of income tax, plus you're removing assets with tax-advantaged growth potential. There are some narrowly defined exceptions to the penalty, but most people will pay dearly for early access to those funds.

2. Your employer doesn't match contributions

One of the greatest benefits of a 401k comes from employer matches on contributions. If you're lucky, your company will agree to match your contributions up to a certain amount. You should almost always meet the company match. It's basically free money. Whether you contribute beyond the match is a decision you'll want to make taking into consideration your other investing options.

Unfortunately, many employers that offer a 401k plan don't match contributions. In that case, there are often better investment strategies. Since the money you contribute to your 401k will be taxed later in life and often has limited investment options, you may want to opt for an alternative retirement savings account, such as a traditional or Roth IRA.

3. You're swimming in debt

Investing in a 401k is a great way to grow your money, but it won't do much good if debt is simultaneously eating away at your accounts. Just as the interest on your savings is compounding to build your assets, so the interest on your debt is compounding to tear them down.

You should generally prioritize paying down current debts before stashing away money for the future. The sooner you pay what is owed, the less you'll lose to interest rates. There may be exceptions to this rule if your company has a generous 401k match, so you should probably find a financial adviser to help you in this scenario.

4. You fear future tax increases

Part of the allure of 401k's is the ability to defer income tax. You are not taxed on your contributions until you make withdrawals during retirement. However, it doesn't always make sense to defer taxes rather than paying up front.

Currently, the highest federal tax bracket is 39.6%. That may seem high, but historically, it's fairly low. In 1980, the highest bracket was 70%. In 1960, it was 91%. By the time you hit retirement, the country could be back at sky-high levels. Some people may deem it wiser to pay taxes now while rates are reasonable. Of course, predicting the tax brackets of 2030 is as big a gamble as spinning a roulette wheel in Vegas, but it's certainly something to consider.

Along those same lines, deferring taxes until you withdraw in retirement could end up costing you a lot more -- even if the tax brackets remain at the same level. If you've invested a lot of money into your 401k, making large annual withdrawals could potentially place you in a higher tax bracket. This is especially true if you're also drawing significant income from other sources. In this way, the deferment benefit of a 401k plan doesn't always work to your advantage. If you make enough for this to be a concern, consider an investment vehicle that allows you to pay your income tax up front.

5. Lack of flexibility and high fees

When you invest money in a 401k, you shouldn't touch those funds until retirement. Otherwise, you'll disrupt your retirement savings while incurring nasty penalty fees. Putting a lot of money into a 401k is a bad idea if you need money immediately or for short-term expenses. When determining whether to squirrel away your earnings for your golden years, consider those funds frozen until retirement.

Be aware, though, that fees associated with 401k plans extend beyond early withdrawal. There are also plan administration fees, investment fees, individual service fees, sales charges and management fees. The average household with two working adults will pay $150,000 to $200,000 in 401k fees over a lifetime.

You can avoid these fees by choosing retirement savings accounts with more extensive investment choices, or by targeting passive funds in your 401k account with lower embedded costs.

Click here to become a fan of MSN Money on Facebook

More from MarketWatch