Loan Payment Calculator
Monthly payment and total interest for any loan or mortgage. M = P * (i / (1 - (1+i)^-n)) where M = monthly payment, P = loan amount, i = monthly rate (annual rate / 12), n = total number of payments (term in years * 12). Total Paid = M * n. Total Interest = Total Paid - P. Amortization schedule calculated iteratively: Interest Paid for month = Balance * i, Principal Paid for month = M - Interest Paid, New Balance = Balance - Principal Paid. Yearly values sum the 12 monthly values. HOW IT WORKS Extra payments go straight to principal, shortening the term and reducing total interest. Even small regular overpayments have outsized effects on long loans. Validation: Must handle 0% interest rate; Must handle very short or long terms; Loan amount must be positive.