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)) / 12Total Interest Paid
total_interest = monthly_payment * ceil(-1 * log(1 - balance * monthly_rate / monthly_payment) / log(1 + monthly_rate)) - balanceVariables
| Variable | Description | Default |
|---|---|---|
balance | Current Balance ($) | 28000 |
annual_rate | Annual Interest Rate (%) | 5 |
monthly_payment | Monthly Payment ($) | 400 |
monthly_rate | Derived value= annual_rate / 100 / 12 | calculated |
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
- 01Monthly rate = 5% / 12 = 0.004167
- 02Monthly interest = $28,000 x 0.004167 = $116.67
- 03Months = ceil(-log(1 - 28000 x 0.004167 / 400) / log(1.004167)) = 81 months
- 04Years = 81 / 12 = 6.75 years
- 05Total interest = $400 x 81 - $28,000 = $4,400
Ready to run the numbers?
Open Student Loan Payoff Calculator