Student Loan Calculator Formula

Understand the math behind the student loan calculator. Each variable explained with a worked example.

Formulas Used

Monthly Payment

monthly_payment = monthly_rate > 0 ? loan_balance * monthly_rate * pow(1 + monthly_rate, num_payments) / (pow(1 + monthly_rate, num_payments) - 1) : loan_balance / num_payments

Total Repaid

total_paid = monthly_payment * num_payments

Total Interest

total_interest = total_paid - loan_balance

Variables

VariableDescriptionDefault
loan_balanceLoan Balance(USD)35000
annual_rateInterest Rate(%)5.5
repayment_yearsRepayment Term(years)10
monthly_rateDerived value= annual_rate / 12 / 100calculated
num_paymentsDerived value= repayment_years * 12calculated

How It Works

Student Loan Payment Formula

Uses the standard amortization formula:

M = P × [r(1+r)^n] / [(1+r)^n - 1]

Federal student loans typically use a 10-year standard repayment plan.

Worked Example

$35,000 in student loans at 5.5% over 10 years.

loan_balance = 35000annual_rate = 5.5repayment_years = 10
  1. 01Monthly rate = 5.5% / 12 = 0.4583%
  2. 02Payments = 10 × 12 = 120
  3. 03Monthly payment = $379.61
  4. 04Total repaid = $379.61 × 120 = $45,553
  5. 05Total interest = $45,553 - $35,000 = $10,553

Ready to run the numbers?

Open Student Loan Calculator