function calculateMortgage() {
var propertyPrice = parseFloat(document.getElementById('propertyPrice').value);
var upfrontContribution = parseFloat(document.getElementById('upfrontContribution').value);
var annualCostFunds = parseFloat(document.getElementById('annualCostFunds').value);
var repaymentYears = parseFloat(document.getElementById('repaymentYears').value);
if (isNaN(propertyPrice) || propertyPrice <= 0) {
alert("Please enter a valid Property Purchase Price.");
return;
}
if (isNaN(upfrontContribution) || upfrontContribution = propertyPrice) {
alert("Upfront Cash Contribution must be less than the Property Purchase Price.");
return;
}
if (isNaN(annualCostFunds) || annualCostFunds < 0) {
alert("Please enter a valid Annual Cost of Funds.");
return;
}
if (isNaN(repaymentYears) || repaymentYears <= 0) {
alert("Please enter a valid number of Years to Pay Off.");
return;
}
var principal = propertyPrice – upfrontContribution;
var monthlyRate = (annualCostFunds / 100) / 12;
var numPayments = repaymentYears * 12;
var monthlyPayment;
if (monthlyRate === 0) {
monthlyPayment = principal / numPayments;
} else {
monthlyPayment = principal * (monthlyRate * Math.pow(1 + monthlyRate, numPayments)) / (Math.pow(1 + monthlyRate, numPayments) – 1);
}
var totalPayments = monthlyPayment * numPayments;
var totalCostBorrowing = totalPayments – principal;
document.getElementById('borrowedAmount').innerText = '$' + principal.toFixed(2);
document.getElementById('monthlyPayment').innerText = '$' + monthlyPayment.toFixed(2);
document.getElementById('totalPayments').innerText = '$' + totalPayments.toFixed(2);
document.getElementById('totalCostBorrowing').innerText = '$' + totalCostBorrowing.toFixed(2);
}
// Calculate on page load with default values
window.onload = calculateMortgage;
Understanding Your House Mortgage Payment
Buying a home is one of the most significant financial decisions you'll make. A house mortgage allows you to borrow a large sum of money to purchase property, which you then repay over an extended period, typically 15 to 30 years. Understanding how your monthly payments are calculated is crucial for effective financial planning.
Key Components of Your Mortgage
Our House Mortgage Payment Estimator helps you break down the core elements that determine your monthly financial commitment:
Property Purchase Price: This is the total agreed-upon cost of the home you are buying. It forms the basis for how much you will need to borrow.
Upfront Cash Contribution: Often referred to as a down payment, this is the amount of money you pay out of pocket at the time of purchase. A larger upfront contribution reduces the amount you need to borrow, which can lead to lower monthly payments and less total cost over the life of the mortgage.
Annual Cost of Funds: This represents the yearly percentage cost of borrowing the money. It's the rate at which the lender charges you for the use of their capital. This percentage significantly impacts your monthly payment and the total amount you'll pay back.
Years to Pay Off: This is the duration, in years, over which you agree to repay the borrowed amount. Common terms are 15, 20, or 30 years. A shorter repayment period typically means higher monthly payments but less total cost of funds over the life of the mortgage, while a longer period offers lower monthly payments but a higher overall cost.
How the Calculation Works
The calculator uses a standard mortgage formula to estimate your monthly payment. It first determines the 'principal' amount, which is the Property Purchase Price minus your Upfront Cash Contribution. This is the actual amount you are borrowing.
The Annual Cost of Funds is converted into a monthly rate, and this, along with the total number of monthly payments (Years to Pay Off multiplied by 12), is used to calculate your fixed monthly payment. This payment covers both a portion of the principal borrowed and the cost of funds.
What the Results Mean
Total Amount Borrowed: This is the principal amount of your mortgage, after your upfront contribution.
Estimated Monthly Payment: This is the amount you would typically pay each month to cover the principal and the cost of funds. This figure is essential for budgeting.
Total Payments Over Term: This shows the grand total of all your monthly payments combined over the entire repayment period.
Total Cost of Borrowing: This figure represents the total amount of money you will pay in excess of the principal borrowed. It highlights the financial impact of the Annual Cost of Funds over the full term of your mortgage.
Example Scenario:
Let's say you're looking at a house with a Property Purchase Price of $300,000. You plan to make an Upfront Cash Contribution of $60,000. The lender offers an Annual Cost of Funds of 6.5%, and you choose a 30-year repayment period.
Total Amount Borrowed: $300,000 – $60,000 = $240,000.00
Estimated Monthly Payment: Approximately $1,516.90
Total Payments Over Term: $1,516.90 * 360 months = $546,084.00
Total Cost of Borrowing: $546,084.00 – $240,000.00 = $306,084.00
This example demonstrates how the Annual Cost of Funds significantly increases the total amount paid over a long repayment period. Use this calculator to experiment with different scenarios and understand the financial implications of your house mortgage.