Skip to content

The math behind the calculator

The Loan Payment Formula, Explained

Every fixed-rate installment loan payment (personal loan, auto loan, student loan, or mortgage) is calculated using the same standard amortization formula. This page walks through exactly what the formula is, what each variable means, and a complete worked example calculated by hand so you can see precisely where the number in the calculator comes from.

The formula

The standard fixed-rate loan payment formula is:

M = P × [ i(1 + i)n ] / [ (1 + i)n − 1 ]

Where:

This formula comes from the mathematics of a fixed annuity: it finds the single payment amount that, applied every month with interest calculated on the remaining balance, brings the balance to exactly zero after exactly n payments.

Why the formula looks the way it does

The formula isn't arbitrary. Every month, interest accrues on whatever balance remains, and part of your payment covers that interest while the rest reduces the principal. Because the balance keeps shrinking, a plain "principal divided by number of payments" calculation would not work: it would ignore the fact that interest is still being charged on a balance that changes every month. The i(1+i)n / [(1+i)n - 1] term is what algebraically accounts for that: it is the fraction of the loan that has to be paid each month, factoring in that both the balance AND the interest charged on it shrink together over the life of the loan, to reach precisely zero on the final payment.

The special case is a 0% interest loan (i = 0): the formula above involves a division by zero at i = 0, so it falls back to the much simpler M = P / n, since there is no interest to account for at all, and each payment is just the principal split evenly across the term.

A complete worked example

Take a $10,000 loan at a 5% annual interest rate for 3 years (36 months), the same example used on the loan calculator homepage:

  1. Convert the annual rate to a monthly rate: i = 5% / 100 / 12 = 0.05 / 12 = 0.0041667.
  2. Find the number of payments: n = 3 years × 12 = 36.
  3. Calculate (1 + i)n: (1.0041667)36 = 1.161472.
  4. Plug everything into the formula: M = 10,000 × [0.0041667 × 1.161472] / [1.161472 − 1] = 10,000 × 0.0048395 / 0.161472 = $299.71.

That $299.71 is the fixed monthly payment for the entire 36-month term. Multiplying it out: 36 payments × $299.71 = $10,789.52 total paid, meaning $789.52 of that is interest (the rest is the $10,000 principal you originally borrowed).

How the first payment splits between principal and interest

Continuing the same $10,000 / 5% / 36-month example, here is exactly how the very first monthly payment of $299.71 is split:

After that first payment, the new balance is $10,000 − $258.04 = $9,741.96. The second month's interest is then calculated on that new, slightly lower balance, which is why the interest portion of every subsequent payment is a little smaller than the one before it, even though the total payment ($299.71) never changes. See the amortization schedule explainer for the full year-by-year breakdown of this same loan.

Using the formula yourself vs. using the calculator

The formula above is exact and works for any fixed-rate loan, but computing (1+i)n by hand for a 30-year mortgage (n = 360) is tedious and easy to get slightly wrong with rounding. The loan calculator runs the identical formula instantly, then goes a step further by simulating every individual month to produce a full amortization schedule, something that would take a very long time to compute by hand one payment at a time. Every calculation happens locally in your browser using JavaScript, nothing you enter is sent to a server; see the privacy policy for the full details on what is (and is not) collected.

For the complete breakdown of how a full amortization schedule is built from this same formula, see the amortization schedule explainer, which walks through this exact $10,000 example year by year.

Frequently asked questions

What does 'i' mean in the loan payment formula?
i is the monthly interest rate: your loan's annual interest rate divided by 12. For example, a 6% annual rate gives i = 0.06 / 12 = 0.005 (0.5% per month).
What does 'n' mean in the loan payment formula?
n is the total number of monthly payments over the life of the loan: the loan term in years multiplied by 12. A 4-year loan has n = 48 payments.
Does this formula work for a 0% interest loan?
The formula as written involves dividing by zero when the interest rate is 0%, so the calculator falls back to the simpler payment = principal / number of payments in that specific case, since there is no interest to factor in at all.
Why is the interest portion of my payment higher at the start of the loan?
Interest is calculated each month on your current outstanding balance, which is at its highest right at the beginning of the loan. As you pay down principal and the balance shrinks, the interest charged each month shrinks along with it, even though your total payment stays exactly the same.

Skip the manual math

Plug in your own loan amount, rate and term and get the exact payment instantly.

Open the loan calculator

Free. No sign-up.