Credit Card Payoff Calculator Formula

Understand the math behind the credit card 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 * balance / monthly_payment) / log(1 + monthly_rate)) : ceil(balance / monthly_payment)

Total Amount Paid

total_paid = months_to_payoff * monthly_payment

Total Interest Paid

total_interest = total_paid - balance

Variables

VariableDescriptionDefault
balanceCurrent Balance(USD)5000
annual_rateAnnual Interest Rate (APR)(%)22
monthly_paymentMonthly Payment(USD)200
monthly_rateDerived value= annual_rate / 12 / 100calculated

How It Works

How Credit Card Payoff Is Calculated

The number of months to pay off is:

n = -log(1 - r × B / P) / log(1 + r)

Where B = balance, P = monthly payment, r = monthly interest rate. Your payment must exceed the monthly interest charge (B × r) or the balance will never decrease.

Worked Example

$5,000 balance at 22% APR with $200 monthly payment.

balance = 5000annual_rate = 22monthly_payment = 200
  1. 01Monthly rate = 22% / 12 = 1.833%
  2. 02Months = -log(1 - 0.01833 × 5000 / 200) / log(1.01833)
  3. 03= -log(1 - 0.4583) / log(1.01833)
  4. 04= -log(0.5417) / 0.01817 = 33.7 → 34 months
  5. 05Total paid = 34 × $200 = $6,800
  6. 06Total interest = $6,800 - $5,000 = $1,800

Ready to run the numbers?

Open Credit Card Payoff Calculator