The amortization formula in words
A level payment is the amount that, paid every month for the whole term, exactly retires the principal plus interest accrued on the declining balance. The formula divides the monthly interest on the original principal by one minus a discount factor; that discount factor, (1 + r)^−n, is what a dollar due n months from now is worth today at the monthly rate r. The smaller the discount factor (longer term or higher rate), the closer the denominator gets to 1 and the closer the payment gets to simple monthly interest on the full balance. A ten-year loan at a high rate is mostly interest for the first several years for exactly this reason.
Inside each payment the split moves. Month one, interest = balance × r and principal = payment − interest. Month two, the balance is a little smaller, so interest is a little smaller and principal a little larger. Lenders publish this schedule as an amortization table; the early payoff calculator reproduces any row of it. Understanding the split explains why a lender's 'no prepayment penalty' claim matters more on a seven-year loan than a one-year one, and why paying an extra $500 in month three saves more than the same $500 in month thirty.