Please enter valid positive numbers for all fields.
Monthly Payment Breakdown
Principal & Interest:–
Property Tax (Monthly):–
Home Insurance (Monthly):–
Total Monthly Payment:–
*Total Loan Amount:
function calculateMortgage() {
// Get input values
var homePrice = parseFloat(document.getElementById("homePrice").value);
var downPayment = parseFloat(document.getElementById("downPayment").value);
var interestRate = parseFloat(document.getElementById("interestRate").value);
var loanTerm = parseFloat(document.getElementById("loanTerm").value);
var propertyTax = parseFloat(document.getElementById("propertyTax").value);
var homeInsurance = parseFloat(document.getElementById("homeInsurance").value);
var errorMsg = document.getElementById("errorMsg");
var resultsDiv = document.getElementById("calc-results");
// Validate inputs
if (isNaN(homePrice) || isNaN(downPayment) || isNaN(interestRate) || isNaN(loanTerm) ||
isNaN(propertyTax) || isNaN(homeInsurance) || homePrice <= 0 || loanTerm home price
if (principal < 0) principal = 0;
var monthlyRate = (interestRate / 100) / 12;
var numberOfPayments = loanTerm * 12;
var monthlyPrincipalInterest = 0;
// Mortgage formula: M = P [ i(1 + i)^n ] / [ (1 + i)^n – 1 ]
if (interestRate === 0) {
monthlyPrincipalInterest = principal / numberOfPayments;
} else {
var x = Math.pow(1 + monthlyRate, numberOfPayments);
monthlyPrincipalInterest = (principal * x * monthlyRate) / (x – 1);
}
var monthlyTax = propertyTax / 12;
var monthlyInsurance = homeInsurance / 12;
var totalMonthly = monthlyPrincipalInterest + monthlyTax + monthlyInsurance;
// Display Results
document.getElementById("resPrincipalInterest").innerHTML = "$" + monthlyPrincipalInterest.toFixed(2);
document.getElementById("resTax").innerHTML = "$" + monthlyTax.toFixed(2);
document.getElementById("resInsurance").innerHTML = "$" + monthlyInsurance.toFixed(2);
document.getElementById("resTotal").innerHTML = "$" + totalMonthly.toFixed(2);
document.getElementById("resLoanAmount").innerHTML = "$" + principal.toFixed(2);
resultsDiv.style.display = "block";
}
Understanding Your Mortgage Payment
Calculating your monthly mortgage payment is a critical step in the home buying process. This Mortgage Payment Calculator helps you estimate exactly how much you will need to budget every month by accounting for the principal, interest, taxes, and insurance (often referred to as PITI).
How the Calculation Works
Your monthly mortgage payment is composed of several distinct parts:
Principal: This is the portion of your payment that goes directly toward paying down the loan balance (the Home Price minus your Down Payment).
Interest: This is the cost of borrowing money from your lender. The rate is determined by the annual interest rate divided by 12 months.
Escrow Components: Most lenders require you to pay a portion of your annual Property Tax and Home Insurance monthly. These funds are held in an escrow account and paid on your behalf when due.
Why Your Interest Rate Matters
Even a small difference in your interest rate can have a significant impact on your monthly payment and the total cost of your loan over time. For example, on a $300,000 loan, a 1% difference in interest rate can change your monthly payment by hundreds of dollars.
Using This Calculator
To get the most accurate result, ensure you input your current local property tax estimates and home insurance quotes. While the calculator provides a robust estimate, your final payment may vary slightly based on the specific closing date and lender fees.