Photo: via Flickr.

One advantage of a 401k account over an IRA is that you can borrow money from your 401k, but not from your IRA. True enough, but should you? It depends on your circumstances. Below are some reasons why borrowing against a 401k may or may not be a wise choice.

First, let's set the stage. According to the Employee Benefit Research Institute and the Investment Company Institute, as of the end of 2012, 87% of 401k plan participants in their database had plans that allowed borrowing from accounts. Among those folks, 21% had a loan outstanding. Thus the option to borrow against a 401k is widely available but not widely used, though one in five is a significant portion.

When borrowing against a 401k is a bad idea

The main reason to avoid borrowing against your 401k is that it goes against the whole point of such a plan, which is to help you save for retirement. Ideally, you'll be contributing generously to your 401k (the contribution limit for 2014 is $17,500, plus another $5,500 for those aged 50 and older) and letting those funds grow and compound over time on a tax-deferred basis. Take money out of the 401k, though, and you're robbing the account of much of its growth capability. Even when you pay back what you borrowed (assuming you do), you'll have lost out on how much that money might have grown had it not been taken out of service.

Sometimes, those who borrow from their 401ks aren't able to pay the money back. If you can't pay it back on time, the money is viewed as a withdrawal by the IRS and will be subject to taxation. In addition, if you're under age 59-1/2, you'll face a 10% early withdrawal penalty. Also, if you leave the employer that sponsored your 401k, you'll suddenly have just 60 days to pay back the loan, and it will count as a taxable -- and penalty-triggering, if it's early -- withdrawal.

When borrowing against a 401k makes sense

Of course, sometimes borrowing against a 401k can make sense, particularly if you're in desperate need of cash and have no other recourse. You'd better be sure of that, though. Do you have an emergency fund you can tap into? Can you take out a home equity loan instead? If you're facing a major financial obligation such as credit card debt, a hospital bill, or a tuition payment, have you tried negotiating these expenses or arranging alternative payment schedules? If you answered "No" to all of the above, then perhaps borrowing against your 401k is the answer.

Earlier this year, the folks at TIAA-CREF surveyed about 1,000 Americans participating in retirement plans at work. Among those who borrowed against their accounts, TIAA-CREF found that 46% borrowed to pay off debt; 35% to pay for emergency expenses; 26% for a home or renovation; 24% to pay bills due to a job loss; 20% for education costs; and 15% to pay for special events such as a wedding or family vacation. An emergency is an emergency, but shortchanging your retirement in order to remodel a kitchen or take a cruise is not the best idea.

One advantage of borrowing against a 401k is that you can often get lower interest rates than you would elsewhere. Don't let that make you think you're saving money, though, as the interest savings might not make up for the lost growth in the account. (Bankrate's 401k loan calculator can crunch the numbers for you.) The most common interest rate is the current prime rate (recently 3.25%) plus 1 or 2 percentage points. A key difference between a 401k loan and other loans is that when borrowing against a 401k, you're paying interest to yourself, back into your account. (However, the interest is taxed twice, as it's initially paid with post-tax dollars and is then taxed on withdrawal in retirement.)

Other advantages include the ease with which you can access your money and the fact that the loan does not affect your credit history. You'll typically have five years to pay the money back. That's a plus, unless you think you'll need longer than that. Many will point to home equity lines of credit as better sources of income, but if you have bad credit or do not own a home, a 401k loan can make sense.

If you think you might borrow against a 401k one day, consider investing the funds even more aggressively over the years in preparation. That way the account might actually serve as an emergency fund, so long as you'll be able to repay the loan on time, and your extra savings can offset the effect of lost earnings during the loan period.

Still, it makes a lot of sense to simply avoid borrowing against a 401k so that you can leave those funds to grow as much as possible over time, as they're meant to do.