The Mortgage Calculator is a Java Script calculator that computes the size of a monthly payment for a given loan duration and totals interest paid. It also computes the effects of paying extra principal.
To operate the calculator, first enter the amount borrowed, the annual interest rate, and the duration in months. Press the Compute button to get the principal and interest portions of a mortgage payment as well as a total of the interest to be paid for the duration of the loan. Press the Listing button to generate the principal and interest portions of each monthly payment.
Extra principal payments reduce the duration of the mortgage and the total interest to be paid. Enter the value of extra principal to be paid each month; press Compute to see the effect on duration and total interest. Listing generates a list of the principal and interest portions of each monthly payment with extra principal included.
On invalid entries, the output windows will display:
NaN -- Not a Number
Return to Contents
The Java Script source code for this program can be viewed by using the View|Source command of your web browser.
You may use or modify this source code in any way you find useful, provided that you agree that the author has no warranty, obligations or liability. You must determine the suitability of this source code for your use.
Return to Contents
When a loan of principal P is amortized, interest P·i is added to remaining balance and a payment amount M > P·i is subtracted from the remaining balance each period. The required periodic payment to amortize a loan of P at periodic interest rate i in N periods can be calculated from:
(1 + i)N
M = P·i·--------------
(1 + i)N - 1
Since payment M > P·i, each payment reduces the remaining principal. The early payments include a small amount of principal and a large amount of interest. The principal part, pp, and interest part, ip of payment can be calculated from:
The principal is reduced after each payment by:ip = Pk·i pp = M - ip
Adding extra principal to each payment will reduce the duration of a loan and the total amount of interest paid. The largest savings are obtained by including extra principal with the early payments.Pk+1 = Pk - pp
Return to Contents
AbCd Classics - free on-line books