Student Loan Payoff Calculator Formula

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

Formulas Used

Months to Payoff

months_to_payoff = ceil(-1 * log(1 - balance * monthly_rate / monthly_payment) / log(1 + monthly_rate))

Years to Payoff

years_to_payoff = ceil(-1 * log(1 - balance * monthly_rate / monthly_payment) / log(1 + monthly_rate)) / 12

Total Interest Paid

total_interest = monthly_payment * ceil(-1 * log(1 - balance * monthly_rate / monthly_payment) / log(1 + monthly_rate)) - balance

Variables

VariableDescriptionDefault
balanceCurrent Balance ($)28000
annual_rateAnnual Interest Rate (%)5
monthly_paymentMonthly Payment ($)400
monthly_rateDerived value= annual_rate / 100 / 12calculated

How It Works

How to Calculate Student Loan Payoff Time

The payoff time depends on your balance, rate, and payment amount.

Formula

Months = ceil(-log(1 - Balance x r / Payment) / log(1 + r))

Where r = monthly interest rate.

Your payment must exceed the monthly interest charge, or the loan will never be paid off.

Worked Example

A $28,000 balance at 5% interest with $400 monthly payments.

balance = 28000annual_rate = 5monthly_payment = 400
  1. 01Monthly rate = 5% / 12 = 0.004167
  2. 02Monthly interest = $28,000 x 0.004167 = $116.67
  3. 03Months = ceil(-log(1 - 28000 x 0.004167 / 400) / log(1.004167)) = 81 months
  4. 04Years = 81 / 12 = 6.75 years
  5. 05Total interest = $400 x 81 - $28,000 = $4,400

Ready to run the numbers?

Open Student Loan Payoff Calculator