A mortgage is often the largest financial commitment most individuals make. While the standard amortization schedule helps you pay off your loan over time, making extra payments can significantly accelerate this process, save you a substantial amount of money in interest, and build equity faster. This calculator helps you visualize the impact of making additional payments on your mortgage payoff.
The Math Behind Your Mortgage
The standard monthly mortgage payment (P&I – Principal and Interest) is calculated using the following formula:
$M = P \frac{r(1+r)^n}{(1+r)^n – 1}$
Where:
M = Your total monthly mortgage payment
P = The principal loan amount
r = Your monthly interest rate (annual rate divided by 12)
n = The total number of payments over the loan's lifetime (loan term in years multiplied by 12)
When you make an extra payment, that entire amount goes directly towards reducing the principal balance. This is crucial because interest is calculated on the remaining principal. By lowering the principal faster, you reduce the amount of interest you'll pay over the life of the loan.
How Extra Payments Work
Our calculator takes your regular P&I payment and adds your specified monthly extra payment. It then recalculates the amortization schedule month by month, applying the total payment (regular + extra) to the outstanding principal and interest. This accelerated principal reduction leads to:
Interest Savings: Less interest accrues over time.
Faster Payoff: Your loan is paid off years sooner.
Increased Equity: You own more of your home sooner.
When to Use This Calculator
This calculator is ideal for:
Homeowners who have received a windfall (bonus, inheritance, tax refund) and want to see the impact of applying it to their mortgage.
Individuals who can comfortably afford slightly higher monthly payments and want to understand the long-term benefits.
Anyone looking to become mortgage-free sooner and gain financial freedom.
Disclaimer: This calculator provides an estimate based on the inputs provided. It does not include potential fees, taxes, insurance, or other costs associated with homeownership. Consult with a financial advisor for personalized advice.
function calculateMortgage() {
var principal = parseFloat(document.getElementById("loanAmount").value);
var annualRate = parseFloat(document.getElementById("annualInterestRate").value);
var years = parseInt(document.getElementById("loanTermYears").value);
var extraPayment = parseFloat(document.getElementById("extraPayment").value);
// Input validation
if (isNaN(principal) || principal <= 0 ||
isNaN(annualRate) || annualRate < 0 ||
isNaN(years) || years <= 0 ||
isNaN(extraPayment) || extraPayment 0) {
standardMonthlyPayment = principal * (monthlyRate * Math.pow(1 + monthlyRate, numberOfMonths)) / (Math.pow(1 + monthlyRate, numberOfMonths) – 1);
} else {
standardMonthlyPayment = principal / numberOfMonths; // Simple division if rate is 0
}
var totalPayment = standardMonthlyPayment + extraPayment;
var remainingBalance = principal;
var totalInterestPaid = 0;
var monthsPaid = 0;
var totalAmountPaid = 0;
// Amortization with extra payments
while (remainingBalance > 0) {
var interestForMonth = remainingBalance * monthlyRate;
var principalForMonth = totalPayment – interestForMonth;
if (principalForMonth > remainingBalance) {
// Last payment adjustment
principalForMonth = remainingBalance;
totalPayment = interestForMonth + principalForMonth;
}
remainingBalance -= principalForMonth;
totalInterestPaid += interestForMonth;
totalAmountPaid += totalPayment;
monthsPaid++;
if (monthsPaid > numberOfMonths * 5) { // Safety break to prevent infinite loops
alert("Calculation exceeded maximum iterations. Please check your inputs.");
return;
}
}
// Standard amortization calculation for comparison
var standardTotalInterest = 0;
var currentBalanceStandard = principal;
var standardMonthsPaid = 0;
while(currentBalanceStandard > 0) {
var interest = currentBalanceStandard * monthlyRate;
var principalPayment = standardMonthlyPayment – interest;
if (principalPayment > currentBalanceStandard) {
principalPayment = currentBalanceStandard;
standardMonthlyPayment = interest + principalPayment;
}
currentBalanceStandard -= principalPayment;
standardTotalInterest += interest;
standardMonthsPaid++;
if (standardMonthsPaid > numberOfMonths * 5) break; // Safety break
}
var interestSaved = standardTotalInterest – totalInterestPaid;
var yearsSaved = Math.floor((numberOfMonths – monthsPaid) / 12);
var monthsSaved = (numberOfMonths – monthsPaid) % 12;
var newPayoffTimeYears = Math.floor(monthsPaid / 12);
var newPayoffTimeMonths = monthsPaid % 12;
// Display results
document.getElementById("interestSaved").innerText = "$" + formatCurrency(Math.max(0, interestSaved));
document.getElementById("yearsSaved").innerText = yearsSaved + (monthsSaved > 0 ? ` and ${monthsSaved} months` : "");
document.getElementById("newPayoffTime").innerText = newPayoffTimeYears + (newPayoffTimeMonths > 0 ? ` years and ${newPayoffTimeMonths} months` : " years");
document.getElementById("totalPaid").innerText = "$" + formatCurrency(totalAmountPaid);
}
function formatCurrency(amount) {
return amount.toFixed(2).replace(/\d(?=(\d{3})+\.)/g, '$&,');
}
// Initial calculation on load (optional, can be removed if not desired)
document.addEventListener('DOMContentLoaded', function() {
calculateMortgage();
});