The pitch is simple. You borrow from yourself. You pay interest to yourself. It sounds like a closed loop with zero friction.

That loop ignores the market. It ignores the tax code. And it ignores the employment contract.

The mechanism

When you take a 401k loan, the funds leave the investment portfolio. They are no longer exposed to market returns. The IRS allows plan administrators to offer loans up to 50% of the vested balance or $50,000, whichever is less (IRC 72(p)).

The plan administrator, such as Vanguard or Fidelity, transfers cash from your investment account to your bank account. In exchange, your account receives a repayment schedule. You make payments with interest, which is credited back to your own 401k balance.

This structure creates three distinct financial costs.

First is opportunity cost. The borrowed money is not compounding in the market. If the market returns 7% and your loan interest is 5%, you lose the 2% spread on the entire principal for the duration of the loan.

Second is double taxation. Loan repayments come from your paycheck. That paycheck has already been subject to income tax. When you eventually withdraw that same money from the 401k in retirement, it is taxed again as ordinary income. You pay tax on the money twice: once when earning it to repay the loan, and again when withdrawing it decades later.

Third is termination risk. If employment ends, the loan is no longer secured by future payroll deductions. Most plans require full repayment within 60 to 90 days of termination. If the balance remains unpaid, the IRS treats the outstanding amount as a taxable distribution.

The math, with real numbers

Consider a $20,000 loan over five years. The comparison assumes a standard market return of 7% and a loan interest rate of 5%.

Scenario A: Leave the $20,000 invested

The principal remains in the portfolio. It compounds at the market rate.

MetricValue
Principal$20,000
Annual Return7%
Years5
Final Balance$28,052

Scenario B: Take the $20,000 loan

The principal is removed from the portfolio. It grows at the loan interest rate (paid to yourself).

MetricValue
Principal$20,000
Loan Interest5%
Years5
Final Balance$25,526

The Opportunity Cost Gap: $2,526.

This $2,526 is not cash out of pocket. It is cash never earned. It is the difference between 7% growth and 5% growth on $20,000 over five years.

The tax cost is harder to see in a five-year snapshot but is real. To repay the loan, you use $15,000 of pre-tax income equivalent (assuming 25% tax bracket). You pay income tax on that $15,000 today. In 20 years, when you withdraw the $20,000 principal plus growth, the IRS taxes that entire amount again. A standard 401k withdrawal avoids this double hit because contributions were pre-tax and growth was tax-deferred.

The termination risk calculation

If employment ends in year 3, the loan balance is roughly $11,500. If this is not paid within 60 days, it becomes a taxable distribution.

  • Taxable Income: $11,500
  • Income Tax (25% Bracket): $2,875
  • Early Withdrawal Penalty (Under 59½): $1,150
  • Total Immediate Cost: $4,025

The Consumer Financial Protection Bureau highlights that job loss is the primary trigger for 401k loan defaults. This risk turns a low-interest loan into a high-cost tax event.

When the rule of thumb breaks

There are specific situations where the math shifts.

Bankruptcy protection. Assets in a 401k are generally protected from creditors in bankruptcy proceedings under the Bankruptcy Code. A 401k loan is not. Once the money is borrowed, it is cash in your bank account. If you file for bankruptcy while the loan is outstanding, that cash is not shielded.

0% alternative debt. If you have a credit card balance at 22% APR and no other option, a 401k loan at 5% reduces the interest rate. However, the opportunity cost of 7% market return still applies. The loan only makes sense if the alternative debt rate is significantly higher than the sum of the market return plus the tax penalty risk.

Short-term cash flow. If you need $5,000 for three months to bridge a gap, the opportunity cost is negligible. The 7% annual return on $5,000 for 90 days is roughly $87. If you can pay it back quickly without triggering the 60-day termination rule, the math is less damaging.

The summary

For most people, in most situations, the right move is:

  1. Avoid 401k loans for discretionary spending.
  2. Treat the borrowed $20,000 as if it earned 7%, not 5%.
  3. Account for the $2,500 opportunity cost and double taxation on every dollar repaid.

The math says “leave it alone” is mathematically best. The behavior says “use the loan” only when the alternative cost is higher than the 7% opportunity cost plus the tax risk. The two-step compromise costs almost nothing and protects you from yourself.