Can I take a loan from my 401k? Yes, some plans do allow you to take a loan out from your plan. Check with your plan administrator to see if it’s possible for you to take a loan without being taxed on it.
What can I withdraw? Up to 50% of the vested account balance up to $50k. If you already have a loan with your plan, you can only borrow up to the $50k limit. There is actually a more complicated calculation for this scenario but in general the above is correct.
How quickly must the loan be repaid? The loan must be paid back within five years unless the loan is used to buy your primary residence.
How do the payments have to be structured? The payments have to basically be the same amount amount over the repayment of the loan.
How often do I have to make payments? At least every quarter.
Do I have to pay interest? Yes, but you pay interest to your self. The interest rate may be set by your plan.
Loans from 401(k) plans. Some 401(k) plans permit participants to borrow from the plan. The plan document must specify if loans are permitted. A loan from the 401(k) plan is not taxable if it meets the criteria below.
Source: IRS 401k Resource Guide