401(k) Loan Calculator
How to Use This Calculator
- 1
Enter the Loan Amount
Input the total principal amount you intend to borrow from your 401(k) account, typically up to $50,000 or 50% of your vested balance.
- 2
Specify the Annual Interest Rate
Provide the annual interest rate for the loan, which is often tied to the prime rate plus 1-2%.
- 3
Define the Loan Term
Indicate the number of years you plan to take to repay the loan, usually capped at 5 years (or longer for a home purchase).
- 4
Set Payments Per Year
Enter the frequency of your loan payments, such as 12 for monthly or 26 for bi-weekly payments, aligning with your payroll schedule.
- 5
Review your results
Examine the Payment Amount, Total Interest Paid, Total Amount Repaid, and Estimated Opportunity Cost. The breakdown bar shows principal vs interest in your total repayment.
Example Calculation
A project manager considers taking a $20,000 401(k) loan at 5% interest to cover unexpected home repairs, aiming to repay it over 3 years with monthly payments.
Loan Amount
$20,000
Annual Interest Rate
5%
Loan Term
3 years
Payments Per Year
12
Results
Payment Amount
$599.42
Total Interest Paid
$1,579.05
Total Amount Repaid
$21,579.05
Estimated Opportunity Cost
$4,500.86
Insights card shows loan analysis with interest-goes-to-you explanation and job change risk warning.
Tips
Consider the Opportunity Cost
Money borrowed from your 401(k) is not invested and growing during the loan term. For a $20,000 loan over 5 years, missing out on an average 7% annual return means foregoing about $8,051 in potential gains — more than the interest you'd pay on the loan itself.
Understand Job Change Risk
If you leave your job, the outstanding 401(k) loan balance typically becomes due within 60 days. If you can't repay it, the balance is treated as an early distribution — subject to income tax and a 10% penalty if you're under 59½.
Compare to External Loans
Before borrowing from your 401(k), compare the total cost (interest + opportunity cost) with alternatives like personal loans or home equity lines of credit. Even a higher-rate external loan may cost less overall because your 401(k) stays invested.
What the result includes
The payment is the fixed amount needed each period to repay the borrowed balance and interest over the selected term. The calculator also shows total interest, total repayment, an amortization schedule, and estimated opportunity cost: projected growth at a fixed 7% annual return on the amount borrowed.
How the payment is calculated
The payment uses the loan amount (P), periodic interest rate (r), and total number of payments (n). The periodic rate is the annual rate divided by payments per year, and (n) is the term in years multiplied by payments per year.
Payment = P × r / (1 − (1 + r)^(-n))
With the default inputs, (P = $20{,}000), (r = 0.05 / 12 = 0.0041666667), and (n = 3 × 12 = 36). Substitution gives ((20{,}000 × 0.0041666667) / (1 − (1 + 0.0041666667)^{-36}) = $599.42) per payment. Using the unrounded payment, total repayment is (36 × $599.4173… = $21{,}579.02), and total interest is ($21{,}579.02 − $20{,}000 = $1{,}579.02). The opportunity-cost estimate is ($20{,}000 × (1.07^3 − 1) = $4{,}500.86).
What changes the result
The loan term changes the opportunity-cost estimate because the calculator applies the assumed 7% annual return for the full term. With the default loan amount, changing the term from 3 years to 2 years changes that estimate from ($20{,}000 × (1.07^3 − 1) = $4{,}500.86) to ($20{,}000 × (1.07^2 − 1) = $2{,}898.00).
When this formula does not apply
This calculation holds the rate and payment amount constant; a loan with a rate that resets needs an adjustable-rate loan calculator. For the full cost of an amortizing loan outside a 401(k), use the amortized loan cost calculator. An auto loan that ends with a lump-sum balloon payment needs the auto loan balloon payment calculator.
The sourced rule next to the result
IRS rules generally limit a plan loan to the lesser of $50,000 or the greater of $10,000 and 50% of your vested account balance; repayment is generally due within 5 years, in substantially level payments made at least quarterly, with an exception for loans used to buy a principal residence. Your plan may set stricter terms, so check its loan provisions against the IRS plan-loan rules.
Frequently Asked Questions
What is the maximum amount I can borrow from my 401(k)?
Under IRS rules, you can typically borrow up to 50% of your vested account balance, or $50,000, whichever is less. However, if your vested balance is less than $20,000, you may be able to borrow up to $10,000.
Is the interest paid on a 401(k) loan tax-deductible?
No, the interest you pay on a 401(k) loan is generally not tax-deductible. While you are paying interest back to your own account, it's considered a repayment, not a new investment, and doesn't qualify for deductions.
What happens if I don't repay my 401(k) loan?
If you fail to repay your 401(k) loan on schedule, the outstanding balance is treated as a taxable distribution. This means it will be subject to ordinary income tax and, if you are under age 59½, a 10% early withdrawal penalty.
How long do I have to repay a 401(k) loan?
Most 401(k) loans must be repaid within five years. However, if the loan is used to purchase a primary residence, some plans allow a longer repayment period, often up to 15 or 25 years.
What is the opportunity cost of a 401(k) loan?
The opportunity cost is the investment growth you miss while your money is out of the market. For example, a $20,000 loan over 3 years at a 7% average market return costs roughly $4,501 in lost growth — on top of the interest you pay on the loan.
