Understanding the true cost of homeownership is crucial before signing a loan agreement. This Mortgage Amortization Calculator goes beyond simple monthly payments to give you a complete financial picture of your potential home loan.
Simply enter the home price, your planned down payment, the interest rate, and the loan term. To get the most accurate "out-the-door" monthly cost, be sure to include estimates for Property Taxes, Homeowners Insurance, and any HOA (Homeowners Association) fees.
Understanding the PITI Formula
Mortgage payments are often referred to as PITI, which stands for the four main components of your monthly bill:
Principal: The portion of your payment that reduces the loan balance.
Interest: The cost of borrowing the money, paid to the lender.
Taxes: Property taxes collected by your local government, often held in escrow.
Insurance: Hazard insurance to protect the property, also typically held in escrow.
How Amortization Works
Amortization is the process of paying off a debt over time through regular payments. In the early years of a 30-year fixed mortgage, a significant majority of your payment goes toward Interest rather than Principal. As time passes, this shifts, and more of your money goes toward building equity (paying down the Principal).
Use the "Yearly Amortization Schedule" generated above to see exactly how much equity you will build year over year and how the interest portion decreases over the life of the loan.
Tips to Lower Your Mortgage Costs
Even small changes can save you thousands of dollars over the life of a loan:
Increase your Down Payment: Putting 20% down eliminates Private Mortgage Insurance (PMI) and lowers your principal balance immediately.
Shorten the Term: A 15-year loan typically has lower interest rates and drastically reduces total interest paid, though monthly payments are higher.
Make Extra Payments: Applying even one extra payment per year directly to the principal can shave years off your loan term.
function calculateMortgage() {
// 1. Get Input Values
var price = parseFloat(document.getElementById('homePrice').value);
var down = parseFloat(document.getElementById('downPayment').value);
var rate = parseFloat(document.getElementById('interestRate').value);
var termYears = parseFloat(document.getElementById('loanTerm').value);
var yearlyTax = parseFloat(document.getElementById('propertyTax').value);
var yearlyIns = parseFloat(document.getElementById('homeInsurance').value);
var monthlyHOA = parseFloat(document.getElementById('hoaFees').value);
var errorDiv = document.getElementById('errorMessage');
// 2. Validation
if (isNaN(price) || isNaN(down) || isNaN(rate) || isNaN(termYears)) {
errorDiv.style.display = "block";
errorDiv.innerHTML = "Please enter valid numbers for Price, Down Payment, Rate, and Term.";
document.getElementById('calcResults').style.display = "none";
document.getElementById('amortizationContainer').style.display = "none";
return;
}
if (down >= price) {
errorDiv.style.display = "block";
errorDiv.innerHTML = "Down payment cannot be equal to or greater than the home price.";
return;
}
errorDiv.style.display = "none";
// 3. Core Calculations
var loanAmount = price – down;
var monthlyRate = (rate / 100) / 12;
var totalMonths = termYears * 12;
var monthlyPrincipalInterest = 0;
// Handle 0% interest edge case
if (rate === 0) {
monthlyPrincipalInterest = loanAmount / totalMonths;
} else {
// Standard Mortgage Formula: M = P [ i(1 + i)^n ] / [ (1 + i)^n – 1 ]
monthlyPrincipalInterest = loanAmount * (monthlyRate * Math.pow(1 + monthlyRate, totalMonths)) / (Math.pow(1 + monthlyRate, totalMonths) – 1);
}
var monthlyTax = isNaN(yearlyTax) ? 0 : yearlyTax / 12;
var monthlyIns = isNaN(yearlyIns) ? 0 : yearlyIns / 12;
var hoa = isNaN(monthlyHOA) ? 0 : monthlyHOA;
var totalMonthlyPayment = monthlyPrincipalInterest + monthlyTax + monthlyIns + hoa;
var totalInterest = (monthlyPrincipalInterest * totalMonths) – loanAmount;
var totalCost = (totalMonthlyPayment * totalMonths); // This includes taxes/ins/hoa over time
var totalLoanCost = (monthlyPrincipalInterest * totalMonths) + down; // Total cost of buying house (Principal + Interest + Down)
// 4. Update Result Display
document.getElementById('resPrincipalInterest').innerText = formatMoney(monthlyPrincipalInterest);
document.getElementById('resExtras').innerText = formatMoney(monthlyTax + monthlyIns + hoa);
document.getElementById('resTotalMonthly').innerText = formatMoney(totalMonthlyPayment);
document.getElementById('resTotalInterest').innerText = formatMoney(totalInterest);
document.getElementById('resTotalCost').innerText = formatMoney(monthlyPrincipalInterest * totalMonths); // Total paid to lender
// Calculate Payoff Date
var today = new Date();
today.setFullYear(today.getFullYear() + termYears);
var options = { month: 'long', year: 'numeric' };
document.getElementById('resPayoffDate').innerText = today.toLocaleDateString("en-US", options);
document.getElementById('calcResults').style.display = "block";
// 5. Generate Amortization Table (Aggregated by Year)
var tableBody = document.getElementById('amortizationBody');
tableBody.innerHTML = "";
var balance = loanAmount;
var yearCounter = 1;
var yearlyInterest = 0;
var yearlyPrincipal = 0;
for (var i = 1; i <= totalMonths; i++) {
var interestPayment = balance * monthlyRate;
var principalPayment = monthlyPrincipalInterest – interestPayment;
if (rate === 0) {
interestPayment = 0;
principalPayment = monthlyPrincipalInterest;
}
// prevent negative balance at end
if (balance < principalPayment) {
principalPayment = balance;
}
balance -= principalPayment;
yearlyInterest += interestPayment;
yearlyPrincipal += principalPayment;
// End of year or end of loan
if (i % 12 === 0 || balance <= 0.1) {
var row = "