Calculator Tips
Loan Mathematics Every Developer Should Know
Understand amortization, the PMT formula, APR vs interest rate, and how to build accurate loan calculators in your applications.
The PMT Formula Explained
The monthly payment for an amortizing loan is: M = P × [r(1+r)^n] / [(1+r)^n - 1], where P is principal, r is monthly interest rate (annual rate / 12), and n is the number of payments (years × 12). Each payment first covers the interest accrued since the last payment, then the remainder reduces principal. Over time, the interest portion decreases and principal portion increases.
Amortization Schedules
A full amortization schedule shows every payment's principal/interest split and the remaining balance after each payment. For a 30-year mortgage at 6% on a $300,000 loan, the first payment is $449 interest + $350 principal. Payment 360: $2 interest + $797 principal. Total interest paid: ~$347,000 — more than the principal. Adding $50/month extra saves $30,000+ interest and shortens the term by 4-5 years.
APR vs Interest Rate
The interest rate determines your monthly payment. APR includes points, origination fees, and closing costs, giving the true annual cost. APR is always >= the interest rate. When comparing loans, use APR. When computing monthly payment waterfalls, use the interest rate. Our loan calculator shows both and generates the full amortization table.