How it works
First the fixed monthly payment is found with M = P × r(1 + r)n / ((1 + r)n − 1). Then, for each month: interest = remaining balance × r; principal = M − interest; new balance = old balance − principal. Early payments are mostly interest; later payments are mostly principal. The final payment is adjusted by a few cents to clear rounding.
Extra payments are added to principal in the month they are made (every month for the monthly extra, once for the lump sum). The schedule then gains an “Extra” column and ends early, and the results show months and interest saved compared with the original schedule.
Worked examples
$200,000 at 6% for 30 years
Monthly payment: $1,199.10. Payment #1 is $1,000.00 interest and $199.10 principal, leaving $199,800.90. By payment #360 only $5.97 is interest.
$200,000 at 6% for 30 years with $200 extra monthly and a $5,000 lump sum in month 12
The loan is paid off in 241 months (20 years 1 months) instead of 360, saving 119 months and $90,882.58 of interest.
$20,000 at 7% for 3 years
Monthly payment: $617.54. Payment #1: $116.67 interest, $500.88 principal; balance after 12 payments: $13,792.86.