Student Loan Repayment Calculator Formula

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

Formulas Used

Standard Monthly Payment

standard_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 Interest (Standard)

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

Extended (25yr) Payment

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

Total Interest (25yr)

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

Variables

VariableDescriptionDefault
loan_balanceTotal Student Loan Balance(USD)40000
interest_rateInterest Rate(%)5.5
standard_termStandard Repayment Term(years)10
monthly_rateDerived value= interest_rate / 12 / 100calculated
num_paymentsDerived value= standard_term * 12calculated

How It Works

Student Loan Repayment Options

Standard Repayment (10 years)

Fixed monthly payments. Highest payment but lowest total interest.

Extended Repayment (25 years)

Lower monthly payments but significantly more total interest.

Income-Driven Plans

Payments capped at 10-20% of discretionary income with forgiveness after 20-25 years.

Formula

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

Where P is the loan balance, r is the monthly rate, and n is total payments.

Worked Example

$40,000 student loan at 5.5% interest.

loan_balance = 40000interest_rate = 5.5standard_term = 10
  1. 01Standard (10yr): $434/month, $12,052 total interest
  2. 02Extended (25yr): $245/month, $33,567 total interest
  3. 03Standard saves $21,515 in interest
  4. 04Standard costs $189 more per month

Frequently Asked Questions

Which repayment plan is best?

The standard 10-year plan minimizes total cost. If you cannot afford the payment, income-driven plans protect your budget. Extended plans are a middle ground but cost significantly more over time.

Should I pay extra on student loans?

If your rate exceeds 5-6%, paying extra saves meaningful interest. For lower rates, you might earn more by investing extra money. Always specify that extra payments go toward principal, not future payments.

What about student loan forgiveness?

Public Service Loan Forgiveness (PSLF) forgives remaining balance after 120 qualifying payments while working for a qualifying employer. Income-driven plans forgive after 20-25 years, but the forgiven amount may be taxable.