<prompt> Human: Borrowed from my 401k.Family emergency. Needed to come up with 6,000 in a matter of days. Didnt have it in the bank. Felt rushed and pressured. Remembered 14,000 in Roth 401k. Took 6,000. Paid a 240 fee to do so. Agreed to 5 yr payment schedule.Background- In my 20s at an entry level job. Family has never had much. Taught me discipline etc but not money management.Knew to a start a 401k. Been socking there for 45 yrs and reading money management books this forum trying to bone up. Troubles me to think of that lost compounding and valuable time. Had been doing pretty well.Credit score was 789 when this happened a month ago. Shouldve gotten a loan. So rushed, didnt consider. First payment was 53 last Friday. Not sure of exact repayment rules. Being told by HR I can only pay one loan payment in advance. In other words, I can double up on payments but no more than that. I cant apply lump sums to the amount owed unless Im paying the entire balance. The Suntrust term agreement I received however, has no such stipulations. 1,000 already saved to put back.Best to get a loan and use that to repay the retirement money immediately? Spoke with my bank- Bank of America. They no longer do personal loans but want to offer me a 10,000 line of credit. I can have the 6k dumped in my bank account. To get 10k cash they quoted me a 200-210 fee. For 6k, guessing it should be less or the same. No interest on the money given for a yr, after that there is interest. Dont recall how much. More than what is typical that for a personal loan- credit card range.A few questions- Do I stand to lose more in lost 401k compounding or in lost interest fees from a 2nd loan to replace the 401k ? Should I continue to contribute to my 401 k even as I pay back the loan or just focus on paying the loan back first? No judgement please. Just practical suggestions.TL;DR Borrowed 6k from roth 401k. What steps can I take to rectify this? Should I get a loan and put the 401k money back immediately? Do I stand to lose more in lost 401k compounding or in lost interest fees from a 2nd loan to replace the 401k ? Should I continue to contribute to my 401k even as I pay back the loan or just focus on paying the loan back first? No judgement please. Just practical suggestions. Anything appreciated.  <response>: Sounds like you dont have an emergency fund, so save one up first, at least up to the amount of the 401k loan balance what you need for an emergency fund. As the 401k loan balance declines, reduce the emergency fund amount to match.As I mentioned in the other reply, 401k interest is paying to yourself, so no worry there. The loan fee is lost, so no need to think of it. The cost really is opportunity cost of what the investment could have earned... But personally I would prioritize a new emergency fund first.Your biggest risk is leaving the job which makes the loan due in full or be deemed a distribution that is subject to taxes and penalty. This is why an emergency fund outside the 401k at least up to the loan balance is priority 1 IMO.Once that is done, if you cannot repay the loan in full as a lump sum... Simply just continue contributing to the 401k. Doesnt sound like you contribute the full limit each year, so just think of the loan repayment as if it were a regular contribution amount. 