The loan payoff calculator formula is n = -ln(1 − B·r/P) / ln(1 + r), where B is your current balance, P is your fixed monthly payment, and r is your monthly interest rate (APR ÷ 12). This single closed-form equation answers one specific question: starting from a balance you already owe and a payment you can actually afford, how many months until the balance reaches zero? Unlike the standard amortization formula that solves for a payment given a loan amount and term, this version is inverted — you supply the payment and it solves for the number of periods, which is why it is sometimes called the inverse amortization or NPER formula. Plug the three variables into the equation, take a natural logarithm of two quantities, divide, and the answer comes out as a single real number you can convert into months and years. The formula is what powers every loan payoff calculator on the web, including the Loan Payoff Calculator, which uses it to return your exact payoff time the instant you change an input.

loan payoff calculator formula
Loan Payoff Calculator Formula: A Plain-English Breakdown

What Each Variable in the Formula Represents

The formula n = -ln(1 − B·r/P) / ln(1 + r) looks intimidating on paper, but it has only three inputs. Once you know what each symbol stands for and where it comes from on your statement, the equation becomes much easier to read.

B — your current balance. This is the amount you still owe right now, not the original loan amount. Use the figure from your most recent statement, after any payments already applied. For a credit card, that is the "new balance" or "statement balance." For an installment loan, it is the remaining principal shown on your amortization schedule.

P — your fixed monthly payment. This is the dollar amount you actually pay each month, every month, until the balance is gone. It must be the same from one month to the next for the formula to hold. If you sometimes pay $200 and other times $350, the closed-form answer will only approximate your real payoff time.

r — your monthly interest rate. Convert your annual percentage rate (APR) into a monthly figure by dividing by 12. An 18% APR becomes r = 0.18 ÷ 12 = 0.015. If your statement quotes a different periodic rate, use that directly. The decimal — not the percent — is what the formula needs.

Notice what the formula does not require: a loan term, a start date, or an original principal. Those are inputs to the standard amortization formula, not this one. By design, the formula only takes the three numbers a person with an existing debt already knows.

How to Use the Loan Payoff Calculator

  1. Open the Loan Payoff Calculator in your browser — nothing to install, no sign-up, and your numbers stay on your device.
  2. Enter your current balance in the first field, your APR as a percent in the second, and the fixed monthly payment you actually make in the third.
  3. Read the payoff time shown in months, with a years-and-months breakdown next to it, along with total interest and total paid.
  4. Raise the monthly payment or lower the rate to see how many months come off your timeline and how much interest you save.
  5. If the tool reports that your payment is too low, increase it until it exceeds the first month's interest — the formula needs the payment to outpace interest before the balance can ever reach zero.

Applying the Formula by Hand: A Worked Example

The fastest way to see the formula in action is to run through one substitution. Suppose you owe $5,000 on a credit card, the APR is 18%, and you can pay $200 a month.

Step 1 — convert APR to a monthly rate. r = 18 ÷ 100 ÷ 12 = 0.015.

Step 2 — compute the first month's interest to confirm the payment is large enough. B × r = 5,000 × 0.015 = $75. Because $200 is greater than $75, the payment will reduce principal, so the formula has a valid answer.

Step 3 — plug into the formula.

n = -ln(1 − (B × r) ÷ P) ÷ ln(1 + r) = -ln(1 − (5,000 × 0.015) ÷ 200) ÷ ln(1.015) = -ln(1 − 75 ÷ 200) ÷ ln(1.015) = -ln(1 − 0.375) ÷ ln(1.015) = -ln(0.625) ÷ ln(1.015) ≈ -(-0.47000) ÷ 0.01489 ≈ 0.47000 ÷ 0.01489 ≈ 31.57 months.

That result means roughly 31 full payments of $200, plus a smaller final payment in month 32 to clear the last few dollars. Total paid comes to approximately 31.57 × $200 = $6,314, and total interest comes to approximately $6,314 − $5,000 = $1,314. Run the same numbers through the calculator and you will get the same payoff time, because the tool is solving the exact same equation you just solved by hand.

Why the Formula Is the Inverse of Standard Amortization

Standard amortization assumes you know three things — loan amount, interest rate, and term — and asks for the monthly payment. The formula most loan calculators use is the PMT equation: P = B × r ÷ (1 − (1 + r)−n), the same identity used to build any standard amortization schedule (see the amortization calculator overview). Rearrange that equation to solve for n instead of P, and you arrive at n = -ln(1 − B·r/P) ÷ ln(1 + r). It is the same loan math, just solved for a different unknown.

This is why the loan payoff calculator formula is sometimes called the "NPER formula" in spreadsheet software. In Excel, the function =NPER(rate, pmt, pv) returns the number of periods for a fixed payment, and that function is implemented as the same logarithmic equation. Open a spreadsheet, type the numbers from the worked example, and =NPER(0.015, -200, 5000) returns about 31.57 — matching the formula and the calculator exactly. For a side-by-side walkthrough of the spreadsheet path, see the guide on calculating loan payment in Excel with PMT, NPER, or a tool.

Understanding that the formula is just a rearrangement removes a lot of mystery. You are not looking at a separate "loan payoff equation" — you are looking at the standard amortization formula with the unknowns swapped.

Edge Cases: Zero Interest and Payments That Are Too Low

Two special cases deserve their own attention because they reveal what the formula assumes.

Zero interest. If r = 0, the natural-log terms become ln(1), which is 0, and you cannot divide by zero. In that limit, the formula simplifies to its simplest possible form: n = B ÷ P. No interest, just divide the balance by the payment. The Loan Payoff Calculator handles this case automatically and shows the result directly.

Payment equal to or below the first month's interest. If P ≤ B × r, the quantity 1 − B·r/P is zero or negative, and the logarithm is undefined (or the answer becomes infinite). That is not a bug — it is the formula telling you the truth. If your payment only covers interest, the principal never shrinks, and the balance can never reach zero. This is the exact arithmetic behind decades-long minimum-payment traps on credit cards: a $5,000 balance at 24% APR with a $100 minimum payment covers $100 of interest per month, and the $5,000 principal is essentially permanent. The calculator surfaces this with a plain "payment too low" message rather than displaying a misleading infinite figure.

Equation What you know What it solves for
PMT (standard amortization) Balance, rate, term Monthly payment
NPER (loan payoff formula) Balance, rate, monthly payment Months to zero balance
FV (future value) Starting balance, rate, payments Remaining balance after n months

Each equation rearranges the same amortization identity to isolate a different unknown. The loan payoff calculator formula is NPER in this family, and it is the right tool when you already know what you can pay each month and want a debt-free date.

Where the Formula and a Real Account Will Diverge

The formula is mathematically exact for the model it describes: a fixed rate, a fixed monthly payment, monthly compounding, and no new charges. Real debt accounts relax one or more of those assumptions, and the divergence between formula and reality grows with each one.

Credit cards typically compound interest daily rather than monthly, which produces a slightly higher effective rate than the formula assumes. Promotional 0% APR windows expire on a specific date and revert to a much higher standard rate, so a "low rate" input that ignores the upcoming reset will underestimate your real payoff time. Installment loans usually match the formula closely because the rate and payment are fixed by contract, but late fees, prepayment penalties, or rate changes after a missed payment can push the actual numbers off the formula's clean prediction.

None of this makes the formula wrong — it makes the inputs a model rather than a quote. Use the Loan Payoff Calculator as a planning baseline, treat the result as an estimate rather than a promise, and confirm exact terms with your lender before making any financial decision based on the numbers.

For a deeper look, see Simple Interest Calculator Formula: A Complete Walkthrough.