Determining how much mortgage you can afford is a crucial step in the home-buying process.
This calculator helps you estimate your potential borrowing power by considering your income,
debts, and desired down payment. Understanding your affordability upfront can save you time
and prevent disappointment during your house hunt.
Key factors influencing mortgage affordability include your gross monthly income (before taxes),
your existing monthly debt payments (such as credit cards, car loans, and student loans),
and the amount of money you have saved for a down payment. Lenders will also consider your credit score,
interest rates, and the property taxes and homeowner's insurance for the home you wish to purchase.
This calculator provides an estimate based on common lending guidelines, but your actual approved
loan amount may vary.
function calculateAffordability() {
var grossMonthlyIncome = parseFloat(document.getElementById("grossMonthlyIncome").value);
var existingMonthlyDebt = parseFloat(document.getElementById("existingMonthlyDebt").value);
var downPayment = parseFloat(document.getElementById("downPayment").value);
var interestRate = parseFloat(document.getElementById("interestRate").value);
var loanTermYears = parseFloat(document.getElementById("loanTermYears").value);
var resultDiv = document.getElementById("result");
resultDiv.innerHTML = ""; // Clear previous results
if (isNaN(grossMonthlyIncome) || isNaN(existingMonthlyDebt) || isNaN(downPayment) || isNaN(interestRate) || isNaN(loanTermYears) ||
grossMonthlyIncome <= 0 || existingMonthlyDebt < 0 || downPayment < 0 || interestRate <= 0 || loanTermYears 0) {
var numerator = Math.pow(1 + monthlyInterestRate, numberOfPayments) – 1;
var denominator = monthlyInterestRate * Math.pow(1 + monthlyInterestRate, numberOfPayments);
if (denominator > 0) {
maxLoanAmount = principalAndInterest * (numerator / denominator);
} else {
// Handle case where interest rate is very low or zero (though rate > 0 is checked)
maxLoanAmount = principalAndInterest * numberOfPayments;
}
}
var estimatedMaxHomePrice = maxLoanAmount + downPayment;
resultDiv.innerHTML = `