Credit Card Payoff Calculator

Plan your debt freedom. This script helps users visualize the impact of interest rates and payment amounts on their payoff timeline.

Copy the Script

<script>
function calculateMonths() {
    var balance = parseFloat(document.getElementById('balance').value);
    var rate = parseFloat(document.getElementById('rate').value) / 100 / 12;
    var payment = parseFloat(document.getElementById('payment').value);

    // Interest only check
    if (payment <= balance * rate) {
        alert("Payment is too low to cover interest!");
        return;
    }

    var months = -Math.log(1 - (rate * balance) / payment) / Math.log(1 + rate);
    alert("Months to payoff: " + Math.ceil(months));
}
</script>

<input type="text" id="balance" placeholder="Balance">
<input type="text" id="rate" placeholder="APR">
<input type="text" id="payment" placeholder="Monthly Payment">
<button onclick="calculateMonths()">Calculate</button>

Frequently Asked Questions

It uses the NPER financial formula: `N = -log(1 - (rate * balance) / payment) / log(1 + rate)`. This calculates the number of periods (months) required.

If your monthly payment is lower than the monthly interest accrued, the balance will grow forever. The script checks for this condition.

This basic calculator covers principal and interest. It does not account for annual fees or late penalties.