Its not hard to imagine: A financial crisis suddenly erupts and you need a significant chunk of change to pay for an unexpected home repair or just to pay the mortgage after you unexpectedly lose your job. What do you do? Well, you might be tempted to borrow money from your 401(k). Think twice or thrice before doing so, though.

Borrowing from a 401(k) is something that many people have considered and many people have done. According to a 2015 report  from Fidelity Investments, which administers many of 401(k) accounts, about 22% of employees had outstanding 401(k) loans (with that level representing the lowest level in five years). Some of those folks may have had little choice, but many could have and should have avoided taking out that loan.

Why you shouldnt borrow money from your 401(k)

A key reason to not borrow from your 401(k) is because it will hurt your retirement. A 401(k) is a retirement account, after all, collecting contributed dollars over time and letting them grow for your future needs in a tax-advantaged fashion. Take money out of it prematurely, though, and what you withdraw will no longer be working for you.

Imagine, for example, that you withdraw $12,000 from your 401(k) and you pay it back in five years. If it had stayed in your account and had been invested in the stock market, earning, say, 10% annually on average, then it would have grown to about $19,000. So you would lose out on $7,000 of growth. Also, in the following years, that $19,000 would have kept growing. Removing a chunk of your 401(k) will deliver a real setback to your savings -- especially if you borrow an extra large sum for an extra long period, such as for a down payment on a house.

Another drawback is that if you cant repay the loan, it will be considered an early withdrawal and may trigger a 10% penalty -- if youre younger than 59 1/2. A 10% penalty on a $12,000 loan is $1,200, a rather significant sum.