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

Frequently Asked Questions

What if my payment only covers interest?

If your payment equals or is less than the monthly interest charge, you will never pay off the loan. Increase payments above the interest amount.

How much does an extra $100/month help?

Extra payments go directly to principal, significantly reducing payoff time and total interest. Run the calculator with different amounts to compare.

Should I pay off loans early?

Generally yes, unless you have higher-interest debt or can earn more by investing. There is no prepayment penalty on federal student loans.

Ready to run the numbers?

Open Student Loan Payoff Calculator