Mortgage Calculator
This free mortgage calculator takes in three inputs:
1- Principal Amount (in dollars)
2- Annual Interest Rate (as a percentage)
3- Loan Term (in years)
When the user clicks the “Calculate Mortgage” button, the JavaScript code calculates the monthly payment using the formula for monthly payments on a fixed-rate loan:
M = P * (r / n) * (1 + r/n)^(n*t) / ((1 + r/n)^(n*t) – 1)
Where:
M = monthly payment
P = principal amount
r = monthly interest rate (annual interest rate / 12)
n = number of payments per year (12)
t = loan term (in years)
The result is displayed on the page in a bold font, showing the monthly payment amount.
Note that this is a simple mortgage calculator and does not take into account many factors that can affect mortgage payments, such as property taxes, insurance, and fees.