Source: via Flickr.

Borrowing against a 401(k) is a terrible idea. I could stop there, because it's that simple. However, just because something is a bad idea doesn't mean people won't do it anyway.

According to 2012 data from the Employee Benefit Research Institute, 21% of 401(k) plan participants had loans outstanding against their accounts. Those loans made up 13% of the average borrower's 401(k). Read on to see how borrowing against your 401(k) works and why this is something you should never do.

How borrowing against a 401(k) works
When you contribute to a 401(k), your money is invested in assets like stocks, mutual funds, and bonds so that over time it will grow into a nest egg you can draw on when you retire. 401(k)s are great because they allow your contributions to grow tax-deferred, and many companies will match a portion of your contributions, helping your wealth compound more quickly over time.

The government also allows 401(k) participants to take a loan from their accounts of up to 50% or $50,000 -- whichever is less. The problem is that this loan becomes an asset in your account, crowding out faster-compounding investments. For example, let's say you have $100,000 in your 401(k), and it's invested in an index fund tracking the S&P 500. If you take a $50,000 loan against your 401(k), your account will then hold $50,000 in the S&P 500 and a $50,000 loan that you owe. Thus you're giving up the compounding effects of keeping your money in the market.

One of the most important rules of finance is that compound interest is what makes you rich. The more money you invest, the faster it will grow -- but it takes time for that compounding effect to build up. By taking your money out of the market, you're setting yourself up to have much less money in retirement than you could otherwise. This is the hidden cost of borrowing against a 401(k).

Why borrowing against a 401(k) is never a good idea
By borrowing money from your 401(k), you put your retirement at risk should something go wrong with your plans. As Warren Buffett once said:

I've seen more people fail because of liquor and leverage -- leverage being borrowed money. You really don't need leverage in this world much. If you're smart, you're going to make a lot of money without borrowing.

The real risk of damaging your retirement is perhaps one of the reasons a study by TIAA-CREF found that 44% of those who borrowed against their 401(k)s regretted the decision, while another 23% said they wouldn't do it again.

There are other risks and costs as well:

  • If you lose your job, you must repay the loan in full within 60 days. A study from RAND, Dartmouth College, and the Wharton School of Business found that 80% of workers who left their job with a 401(k) loan defaulted.
  • If you can't repay the loan, it becomes an early withdrawal from your 401(k). This means that if you're under 59-1/2, you're hit with a 10% tax penalty on the withdrawal. You'll also owe income taxes on the withdrawal if, like most people, you were contributing to your 401(k) on a pre-tax basis.
  • There are fees associated with taking the loans, ranging anywhere from $50 to $100 per loan, and you don't get the fees back.
  • Some plans don't allow you to contribute while you have a loan outstanding, which means you miss out on employer matches that could be growing your retirement nest egg.
  • While money in a 401(k) is protected from creditors if you should go bankrupt, money borrowed from a 401(k) and put into a bank account is not.

Does it ever make sense to borrow against a 401(k)?
Borrowing against a 401(k) can make financial sense in some special cases, so long as everything works out as intended. For instance, if you have a secure job and you need a little extra money to make a 20% down payment on a home so that you won't have to pay mortgage insurance, a 401(k) could work in your favor. Another example is borrowing against your 401(k) to get a master's degree that will significantly further your career and earnings.

In real life, however, things often don't work out exactly as planned. The best thing you can do is to avoid borrowing money from your 401(k) like the plague. It's really that simple.