Borrowing money from your 401(4) plan may not sound like such a bad idea, but you should do it only as a last resort.

The reason? You'll lose years of compounding on the dollars you pull out of your 401(k) account, which can dramatically reduce the amount of money you'll have when you retire.Say you borrow $6,000 and pay it back in five years. If you had left the money in your 401(k) plan, it would have grown to $9,663, assuming a 10 percent annual return.

Before you borrow from your 401(k) account, be sure you've explored all other possibilities including home equity loans and low-interest credit cards.

"The only reason to borrow money from a 401(k) account is to buy a house or a first car," said Daniel K. Beatty, a fee-only certified financial planner for John W. Brooker & Co. in Oakland.

"You should never borrow for current consumption, such as vacations, furniture or clothes," he said. "If you don't have the money, you don't buy it. The cost of debt is just too high."

About 29 percent of people enrolled in 401(k) plans have outstanding loans averaging $6,000 each, said David Wray, president of the Chicago-based Profit Sharing/401(k) Council of America.

Despite reports to the contrary, the number of outstanding 401(k) loans has remained unchanged for about the past four years, said Wray, which reinforces his belief that the typical borrower isn't "doing it casually."

Here's how the loans work. Typically, you can borrow as much as half of the balance in your 401(k) account, up to $50,000. The interest rate you'll get charged is the prime rate, plus 1 percent. The interest payment goes back into your account.

The 401(k) loan must be repaid right away if you change jobs, or within five years if you remain with the same employer. If you use the money to buy your first home, however, you may get up to 30 years to pay back the money.

If you don't repay the 401(k) loan on time, you'll owe federal and state income taxes on the balance. You'll also get hit with a 10 percent federal penalty.

Borrowing from your 401(k) account should be avoided for many reasons, not the least of which is the cost. Your 401(k) trustee likely will sock you with fees to set up and administer the loan.

There's also the lost-opportunity cost. Your money won't grow as much, for example, if you take funds out of your 401(k) account and reduce or suspend contributions while you pay back the loan.

You'll also pay taxes twice because you'll be borrowing pretax money and repaying it with after-tax money. Then, you'll be paying taxes on these same dollars again after you retire.

Finally, 401(k) loans aren't really loans in the classic sense. That's because the money belongs to you, and there's no risk of default because the plan trustee uses your balance as collateral.

The interest you pay isn't a great boon, either. All it does is help you break even. It's not a return.

If you shop around, you may be able to find a low-interest credit card.