Home Loan Repayment Calculator NZ
Calculate your home loan repayments based on your loan amount, interest rate, and loan term.
function calculateRepayment() {
const loanAmount = parseFloat(document.getElementById(“loanAmount”).value);
const interestRate = parseFloat(document.getElementById(“interestRate”).value) / 100 / 12;
const loanTerm = parseInt(document.getElementById(“loanTerm”).value) * 12;
if (isNaN(loanAmount) || isNaN(interestRate) || isNaN(loanTerm) || loanAmount <= 0 || interestRate <= 0 || loanTerm <= 0) {
alert("Please enter valid positive values for all fields.");
return;
}
const monthlyRepayment = (loanAmount * interestRate) / (1 – Math.pow(1 + interestRate, -loanTerm));
document.getElementById("repaymentAmount").value = monthlyRepayment.toFixed(2);
}
function resetCalculator() {
document.getElementById("homeLoanRepaymentCalculator").reset();
document.getElementById("repaymentAmount").value = '';
}