Estimate your monthly mortgage payments including taxes and insurance.
30 Years
20 Years
15 Years
10 Years
Please enter valid numbers for all fields.
Total Monthly Payment:$0.00
Principal & Interest:$0.00
Property Tax (Monthly):$0.00
Home Insurance (Monthly):$0.00
Loan Amount:$0.00
Total Interest Paid (Over Life of Loan):$0.00
How Your Mortgage Payment is Calculated
Understanding the breakdown of your monthly mortgage payment is crucial for financial planning when buying a home. This calculator uses the standard amortization formula to determine your principal and interest payments, while also accounting for escrow items like taxes and insurance.
The 4 Key Components of a Mortgage Payment (PITI)
Lenders often refer to your monthly payment as PITI, which stands for:
Principal: The portion of your payment that goes toward paying down the loan balance (the home price minus your down payment).
Interest: The cost of borrowing money, determined by your interest rate and remaining loan balance. In the early years of a mortgage, a larger percentage of your payment goes toward interest.
Taxes: Property taxes assessed by your local government. These are typically divided by 12 and collected monthly into an escrow account.
Insurance: Homeowners insurance protects your property against damage. Like taxes, the annual premium is usually split into monthly payments.
How Interest Rates Affect Affordability
Even a small difference in interest rates can significantly impact your monthly payment and the total cost of the loan. For example, on a $300,000 loan, a 1% increase in interest rate can raise your monthly payment by over $150 and add tens of thousands of dollars to the total interest paid over 30 years.
Tips for Lowering Your Payment
If the calculated payment is higher than your budget allows, consider these strategies:
Increase your down payment: This reduces the principal loan amount.
Improve your credit score: A better score often qualifies you for a lower interest rate.
Shop for cheaper insurance: Compare quotes from different insurance providers.
Consider a different loan term: While a 30-year term has lower monthly payments than a 15-year term, you will pay significantly more interest over the life of the loan.
function calculateMortgage() {
// 1. 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 loanTermYears = parseInt(document.getElementById('loanTerm').value);
var propertyTaxYearly = parseFloat(document.getElementById('propertyTax').value);
var homeInsuranceYearly = parseFloat(document.getElementById('homeInsurance').value);
// 2. Validate Inputs
var errorDiv = document.getElementById('errorMessage');
var resultsDiv = document.getElementById('results');
if (isNaN(homePrice) || isNaN(downPayment) || isNaN(interestRate) || isNaN(loanTermYears)) {
errorDiv.style.display = 'block';
resultsDiv.style.display = 'none';
return;
}
// Set defaults for optional fields if empty but not NaN (parsefloat returns NaN on empty string)
if (isNaN(propertyTaxYearly)) propertyTaxYearly = 0;
if (isNaN(homeInsuranceYearly)) homeInsuranceYearly = 0;
errorDiv.style.display = 'none';
// 3. Perform Calculations
var loanAmount = homePrice – downPayment;
// Handle case where down payment >= home price
if (loanAmount <= 0) {
loanAmount = 0;
var monthlyPrincipalInterest = 0;
var totalInterest = 0;
} else {
var monthlyRate = (interestRate / 100) / 12;
var numberOfPayments = loanTermYears * 12;
// Mortgage Formula: M = P [ i(1 + i)^n ] / [ (1 + i)^n – 1 ]
if (interestRate === 0) {
var monthlyPrincipalInterest = loanAmount / numberOfPayments;
} else {
var mathPower = Math.pow(1 + monthlyRate, numberOfPayments);
var monthlyPrincipalInterest = loanAmount * ((monthlyRate * mathPower) / (mathPower – 1));
}
var totalLoanCost = monthlyPrincipalInterest * numberOfPayments;
var totalInterest = totalLoanCost – loanAmount;
}
var monthlyTax = propertyTaxYearly / 12;
var monthlyInsurance = homeInsuranceYearly / 12;
var totalMonthlyPayment = monthlyPrincipalInterest + monthlyTax + monthlyInsurance;
// 4. Update UI with formatted numbers
document.getElementById('totalMonthlyDisplay').innerText = formatCurrency(totalMonthlyPayment);
document.getElementById('piDisplay').innerText = formatCurrency(monthlyPrincipalInterest);
document.getElementById('taxDisplay').innerText = formatCurrency(monthlyTax);
document.getElementById('insDisplay').innerText = formatCurrency(monthlyInsurance);
document.getElementById('loanAmountDisplay').innerText = formatCurrency(loanAmount);
document.getElementById('totalInterestDisplay').innerText = formatCurrency(totalInterest);
// Show results
resultsDiv.style.display = 'block';
}
function formatCurrency(num) {
return '$' + num.toFixed(2).replace(/\d(?=(\d{3})+\.)/g, '$&,');
}