https://docs.google.com/spreadsheets/d/1acvWE5WC7MPOFmoMgrFLMecXOCZYsJ8EPvZ5WJT7OGg/Here is my stab at comparison.
BE VERY SKEPTICAL OF MY MATH!I have made a lot of assumptions, which are 100% guaranteed to be wrong. I've also been lazy with the spreadsheet formulas. When the loan balances hit zero, I just pasted 0 in there instead of having a formula testing for zero.
I also am not 100% sure how you compute "net worth" in the instance of the 401k loan. The liability of $50k on month 1 is a liability to oneself... so I made the assumption that in accounting terms, it was not a liability. You effectively have a liability of $50k and an asset of a $50k loan owed to oneself, which is net zero.
With my (guaranteed incorrect) assumptions...
The 401k loan is the loser by about $8500. Incidentally, that's about the number Bluehouse's calculator came up with when I used it.
Edit:
Went grocery shopping and was thinking about this. What I originally wrote is (I think) incorrect.
The cost of the standard student loan is the sum of the interest: $28,468
The cost of the 401k loan is "lost income when the money wasn't there compounding": $8529
plus money lost by the fact that you are paying tax sheltered money back with taxed money: $8500
for a total cost of: $17,029
I would say (if you don't somehow include the cost of the risk of losing your job) the 401k loan is cheaper.
I suspect -- and haven't looked at it -- it is cheaper still to just pay the regular student loan off early. If you can afford to cash flow the 401k loan at $900 a month... you can also afford to throw that much at the standard loan.
Edit again:
Added a 3rd set of columns for cost of standard student loan paid at the same rate the 5 year 401k loan is paid at.
Cost of doing this: $5,930
This is the clear winner. (Adjust assumptions to match your own... and for god sakes, check my logic and math!)