The down payment required for a home purchase is the most important barrier to home ownership. Tapping a 401(k) account is a tempting way of meeting that requirement.

Alternative approaches include a second mortgage, which is another source of needed funds, and mortgage insurance, which reduces the down payment required.

To illustrate: You want to buy a house for $200,000 and have only $10,000 in cash to put down. Without mortgage insurance, lenders will advance only $160,000 on a first mortgage, leaving you $30,000 short.

One possible source of the needed $30,000 is your 401(k) account. A second source is your first mortgage lender, who will add $30,000 more to your first mortgage provided you purchase mortgage insurance on the total loan of $190,000. A third option is to borrow $30,000 on a second mortgage, from the same lender or from a different lender.

Whether you take funds from a 401(k) to make a down payment should depend on whether the costs and risks of doing so are less unfavorable than the alternatives.

The 401(k) option. The general rule is that money in such plans should stay there until the holder retires, but the Internal Revenue Service allows "hardship withdrawals." One acceptable hardship is making a down payment in connection with purchase of a primary residence.

A withdrawal is very costly, however. The cost is the earnings you forgo on the money withdrawn, plus taxes and penalties on the amount withdrawn, which must be paid in the year of withdrawal. The taxes and penalties are a crusher, so you should avoid withdrawals at all costs.

A far better approach is to borrow against your account, assuming your employer permits this. You pay interest on the loan, but the interest goes back into your account, as an offset to the earnings you forgo. The money you receive is not taxable, so long as you pay it back.

Cost comparisons favor the 401(k) loan. The advantage of borrowing against your account is that its cost is probably lower than the alternatives: only the earnings forgone. (The interest rate you pay the 401(k) account is irrelevant, since that goes from one pocket to another).

If your fund has been earning 5 percent, for example, you will no longer be earning 5 percent on the money you take out as a loan, so that is the cost of the loan to you. In contrast, the cost of mortgage insurance is the mortgage rate plus about 5 percent. The cost of a second mortgage today would be even higher, assuming it is available at all.

Risk comparisons favor the alternatives. Both mortgage insurance and second mortgages impose a payment discipline on the borrower. Failure to make the required payment constitutes a default, which can result in loss of the home.

By contrast, most 401(k) borrowers are on their own in repaying their loans. Though some employers may require an explicit repayment plan, most do not, which leaves it to borrowers to formulate their own repayment plan.

The temptation to procrastinate in repaying 401(k) loans is powerful, and if the borrower is laid off or quits voluntarily, it could be extremely costly. The loan must be paid back within a short period of employment termination, often 60 days. If it isn't, the loan is treated as a withdrawal and subjected to the taxes and penalties that are imposed on withdrawals.

If you switch from one employer to another, a 401(k) account can usually be rolled over into a new account at the new employer, or into an IRA, without triggering tax payments or penalties. However, loans against a 401(k) cannot be rolled over.

Borrowers who feel burdened by the need to repay a 401(k) loan may be tempted into another self-defeating practice, which is to make the loan repayments more manageable by reducing new contributions to their fund. This is shortsighted, and in cases where employers match 401(k) contributions, the cost of that shortsightedness is magnified.

There is one risk that is lower on borrowing from a 401(k) account than on the alternatives: The 401(k) borrower has more equity in her house, and is therefore less vulnerable to a decline in real estate prices that result in negative home equity. Negative equity may make it difficult to sell the house and move somewhere else.

National declines in home prices are rare, however, and I would judge this risk as smaller than the risks associated with borrowing from your 401(k).

Jack Guttentag is professor emeritus of finance at the Wharton School of the University of Pennsylvania.