How loan amortization works mathematically
Short answer
Fixed-rate loan amortization models a remaining balance that compounds interest each period before subtracting a constant payment. Solving the recurrence relation so the final balance reaches zero yields a closed-form payment formula using a geometric series. Early payments go mostly toward interest, while later payments steadily shift toward principal reduction.
Step-by-step derivation and symbol definitions
Symbol Definitions
State the Period-by-Period Balance Recurrence
Each period, the prior unpaid balance B_(t-1) accrues periodic interest B_(t-1) * r, and the borrower sends a fixed payment M. The remaining principal balance after period t equals the grown balance minus the payment.
Unroll the Recurrence Across n Periods
Expanding B_1, B_2, up to B_n shows initial principal compounding by (1 + r)^n while each payment M offsets future compounding from its payment date through period n.
Collapse the Geometric Series
For any r > 0, the sum of (1 + r)^k from k = 0 to n - 1 is a finite geometric series equal to ((1 + r)^n - 1) / r.
Impose the Zero-Balance Terminal Condition (B_n = 0)
Setting B_n = 0 and solving for M isolates the fixed payment. Dividing numerator and denominator by (1 + r)^n yields the compact negative-exponent form used in calculators and spreadsheets.
Why Early Payments Are Mostly Interest
Although total monthly payment M never changes on a fixed-rate loan, the split between interest and principal shifts continuously. In Month 1 of a $300,000 loan at 6.50% APR (r = 0.065 / 12 = 0.0054167), the interest charge on the full $300,000 balance is $1,625.00. That leaves just $271.20 of the $1,896.20 payment to reduce principal—an interest share of 85.70%.
By Month 360, the remaining balance has fallen to $1,885.99, so interest for the final month drops to $10.22 (0.54% of the payment), while $1,885.99 clears the remaining principal to $0.00.
15-Year vs. 30-Year Terms and Extra Principal Payments
Because total interest paid over a standard schedule equals n * M - P, shortening the term n or applying extra principal directly cuts the balance on which future interest accrues.
Sending just one extra full payment toward principal at the end of each year (equivalent to 13 payments per year) eliminates several years of payments from the back of a 30-year mortgage and saves substantial cumulative interest without altering the monthly contract obligation.
| Loan Strategy | Payoff Horizon | Base Monthly Payment | Total Paid | Total Interest | Interest Saved vs. Base |
|---|---|---|---|---|---|
| 30-Year Fixed (Baseline) | 30.0 years (360 mo) | $1,896.20 | $682,633.47 | $382,633.47 | Baseline |
| 30-Year + 1 Extra Payment/Yr | 24.3 years (292 mo) | $1,896.20 | $598,648.95 | $298,648.95 | $83,984.52 |
| 15-Year Fixed | 15.0 years (180 mo) | $2,613.32 | $470,397.98 | $170,397.98 | $212,235.49 |
Worked Schedule: $300,000 Mortgage at 6.50% for 30 Years
Every value below is computed month-by-month from P = $300,000, nominal annual rate 6.50% (r = 0.065 / 12), and n = 360 monthly payments.
| Month | Monthly Payment | Interest Paid | Principal Paid | Ending Balance |
|---|---|---|---|---|
| Month 1 | $1,896.20 | $1,625.00 | $271.20 | $299,728.80 |
| Month 2 | $1,896.20 | $1,623.53 | $272.67 | $299,456.12 |
| Month 3 | $1,896.20 | $1,622.05 | $274.15 | $299,181.97 |
| Month 4 | $1,896.20 | $1,620.57 | $275.64 | $298,906.34 |
| Month 5 | $1,896.20 | $1,619.08 | $277.13 | $298,629.21 |
| Month 6 | $1,896.20 | $1,617.57 | $278.63 | $298,350.58 |
| Month 7 | $1,896.20 | $1,616.07 | $280.14 | $298,070.44 |
| Month 8 | $1,896.20 | $1,614.55 | $281.66 | $297,788.79 |
| Month 9 | $1,896.20 | $1,613.02 | $283.18 | $297,505.60 |
| Month 10 | $1,896.20 | $1,611.49 | $284.72 | $297,220.89 |
| Month 11 | $1,896.20 | $1,609.95 | $286.26 | $296,934.63 |
| Month 12 | $1,896.20 | $1,608.40 | $287.81 | $296,646.82 |
| Month 60 | $1,896.20 | $1,523.20 | $373.01 | $280,832.93 |
| Month 120 | $1,896.20 | $1,380.41 | $515.80 | $254,328.38 |
| Month 180 | $1,896.20 | $1,182.95 | $713.25 | $217,677.42 |
| Month 240 | $1,896.20 | $909.90 | $986.30 | $166,995.85 |
| Month 300 | $1,896.20 | $532.33 | $1,363.87 | $96,912.49 |
| Month 360 | $1,896.20 | $10.22 | $1,885.99 | $0.00 |
Amortization Payment Formula (Python & JavaScript)
Closed-form monthly payment calculation from principal, annual nominal rate, and loan years.
def monthly_payment(principal, annual_rate, years):
r = annual_rate / 12.0
n = years * 12
return principal * r / (1.0 - (1.0 + r) ** (-n))
print(round(monthly_payment(300000, 0.065, 30), 2))function monthlyPayment(principal, annualRate, years) {
const r = annualRate / 12;
const n = years * 12;
return (principal * r) / (1 - Math.pow(1 + r, -n));
}
console.log(Number(monthlyPayment(300000, 0.065, 30).toFixed(2)));Common mistakes
- 01.Plugging the annual interest rate (e.g., 0.065) directly into r instead of dividing by 12 for monthly payments.
- 02.Mixing period counts and payment frequency—such as entering 30 years instead of 360 months alongside a monthly interest rate.
- 03.Confusing principal-and-interest (P&I) with total housing outflow, which omits property taxes, homeowners insurance, and HOA dues.
- 04.Assuming prepaying extra principal lowers next month's required contractual payment rather than shortening the remaining schedule.
Key assumptions and limits
- Applies strictly to fixed-rate, fully amortizing loans with uniform end-of-period payments.
- Excludes adjustable-rate mortgage (ARM) index resets, interest-only periods, and balloon payments.
- Omits closing costs, discount points, private mortgage insurance (PMI), property taxes, and escrow adjustments.
- Lender statements may differ by a few cents due to per-payment cent rounding and final-month penny reconciliation.
Related resources
Compound Interest Explained as a Feedback Loop
How the same geometric series machinery governs compounding savings and loan balances.
The Debt Loop (Money Under the Hood)
Reverse compounding, amortization mechanics, and systematic debt payoff models.
How Is the Compound Interest Formula Derived?
Proof of geometric series summation and exponential recurrence relations.
Amortization (Glossary)
Gradual repayment of principal and interest through scheduled equal installments.
APR — Annual Percentage Rate (Glossary)
Annualized borrowing rate versus effective monthly compounding yield.