Debt Payoff Calculator Formula
Understand the math behind the debt payoff calculator. Each variable explained with a worked example.
Formulas Used
Months to Pay Off
months_to_payoff = monthly_rate > 0 ? ceil(-log(1 - monthly_rate * debt_amount / monthly_payment) / log(1 + monthly_rate)) : ceil(debt_amount / monthly_payment)Total Paid
total_paid = months_to_payoff * monthly_paymentTotal Interest
total_interest = total_paid - debt_amountVariables
| Variable | Description | Default |
|---|---|---|
debt_amount | Total Debt(USD) | 15000 |
annual_rate | Interest Rate(%) | 12 |
monthly_payment | Monthly Payment(USD) | 400 |
monthly_rate | Derived value= annual_rate / 12 / 100 | calculated |
How It Works
Debt Payoff Formula
Months = -log(1 - r × D / P) / log(1 + r)
Where D = debt, P = monthly payment, r = monthly rate. Payment must exceed monthly interest (D × r) for the debt to decrease.
Worked Example
$15,000 debt at 12% APR with $400 monthly payments.
debt_amount = 15000annual_rate = 12monthly_payment = 400
- 01Monthly rate = 12% / 12 = 1%
- 02Months = -log(1 - 0.01 × 15000 / 400) / log(1.01)
- 03= -log(0.625) / 0.00995 = 47.2 → 48 months (4 years)
- 04Total paid = 48 × $400 = $19,200
- 05Total interest = $19,200 - $15,000 = $4,200
Ready to run the numbers?
Open Debt Payoff Calculator