Updated

If you want to jump into the real estate market and buy a house but don't have enough saved up, you might feel desperate for cash. But wait! Someone suggested cracking open your 401(k) to make that down payment. It seems reasonable: Sure, you're delving into your retirement funds, but you're just using it for another investment, right? Right?

Not really. When it comes to plundering that 401(k), you open yourself up to "plenty of risks you don't need to take with your retirement money," says Joseph Ritter, a certified financial planner and founder of Zacchaeus Financial Counseling in Hobe Sound, FL.

So here's the main message: Raiding your 401(k) can be a very bad idea. Here are the reasons why.

If you lose your job, you might be screwed

You can borrow up to 50% of your vested balance -- but only up to a maximum of $50,000. And you'll have to repay whatever you take out, unless you're using it to purchase your main home. In that instance, your employer can grant you more time to pay it back -- let's say 10 years. That's all good if you remain employed. Let us repeat that: If. You. Stay. Employed. By the same employer!

Say you borrow $25,000 from your 401(k) in 2016 but then get fired in 2020. You had an eight-year loan, but now the remaining balance -- now about $14,000 -- is due. And fast. The majority of plans require you to pay back the loan within 60 days, although some may lengthen that period. But don't bank on it.

"The length of time for repayment depends on the plan's requirements, but it is going to be along those lines," Ritter says.

You could be in a tough spot, because the majority of employers' plans require you to pay back the loan within 60 days. That gets you into the sticky mess of having to refinance your mortgage. But to do that, you'd need decent credit -- and that's a crapshoot, especially if you're unemployed.

"If someone is borrowing against their 401(k), I'd question their credit," Ritter says.

Plus, failure to repay the loan triggers a slew of tax penalties (more on that below).

You can't leave your job

Even if you don't get fired, we hope you deeply love your company because, as Ritter says, "from the IRS standpoint, separation is not distinguished between leaving or [getting] fired."

So even if you leave voluntarily to take a better job, know that all of the above applies -- the 401(k) is a plan offered by your current employer, and if you are no longer with that employer, you'll have to pay back the loan right away.

With the pressure of having to repay your home loan all at once, you may feel you have to turn down exciting opportunities and stay put in a work environment that doesn't make you happy.

You'll be taxed to the nines -- and then some

If you're like most home buyers, you're far from 59 years old (34 is the average age of an American first-time home buyer). If you decide to cash out your 401(k), you'll get hit with a 10% penalty on whatever you withdraw and it's treated as taxable income.

"You'll be paying higher taxes if the withdrawal bumps you into a higher (tax) bracket," says Matt Cosgriff, a certified financial planner based in Minneapolis, MN.

You lose flexibility

While real estate can be a great investment, from a retirement standpoint, it's more advisable to have a healthy retirement account with stocks and bonds.

Typically, your 401(k) will outperform most real estate markets in the long run. You can move money around more freely in stocks and bonds than if you're tethered to the real estate market.

But what if your 401(k) is performing badly? Take a look at your local mortgage rates and compare.

"If your total return is less than the standard mortgage rate, there's something wrong with how you've had things allocated in your 401(k). I'd look at that before looking into taking on a mortgage," Ritter says.

And you should definitely do that before borrowing against your 401(k). Got it?