Buying a home is a significant financial decision, and understanding how much you can afford is crucial.
This Mortgage Affordability Calculator helps you estimate the maximum mortgage amount you might qualify for,
based on your income, debts, and a few other key financial factors.
Several factors influence how much a lender will be willing to lend you. The primary ones include your gross monthly income,
your existing monthly debt payments, and the estimated interest rate on the mortgage. Lenders typically look at your Debt-to-Income (DTI) ratio.
A common guideline is that your total monthly debt payments (including the estimated mortgage payment) should not exceed a certain percentage of your gross monthly income,
often around 36% for the front-end DTI (housing costs only) and 43% for the back-end DTI (all debts).
This calculator simplifies the process by asking for your gross monthly income and your total monthly debt payments (excluding the potential mortgage).
It then uses a common lending guideline to estimate your maximum affordable monthly mortgage payment and, subsequently, the maximum mortgage amount you might be able to borrow.
Remember, this is an estimate, and your actual loan approval will depend on a lender's specific underwriting criteria, credit score, down payment, and other personal financial details.
function calculateAffordability() {
var grossMonthlyIncome = parseFloat(document.getElementById("grossMonthlyIncome").value);
var monthlyDebtPayments = parseFloat(document.getElementById("monthlyDebtPayments").value);
var interestRate = parseFloat(document.getElementById("interestRate").value);
var loanTerm = parseFloat(document.getElementById("loanTerm").value);
var resultDiv = document.getElementById("result");
resultDiv.innerHTML = ""; // Clear previous results
// Input validation
if (isNaN(grossMonthlyIncome) || grossMonthlyIncome <= 0) {
resultDiv.innerHTML = "Please enter a valid Gross Monthly Income.";
return;
}
if (isNaN(monthlyDebtPayments) || monthlyDebtPayments < 0) {
resultDiv.innerHTML = "Please enter a valid Total Monthly Debt Payments.";
return;
}
if (isNaN(interestRate) || interestRate = 20) {
resultDiv.innerHTML = "Please enter a valid Mortgage Interest Rate (between 1% and 19%).";
return;
}
if (isNaN(loanTerm) || loanTerm 50) {
resultDiv.innerHTML = "Please enter a valid Loan Term (up to 50 years).";
return;
}
// Using a common DTI guideline (e.g., 36% for housing costs)
var maxHousingPayment = grossMonthlyIncome * 0.36;
var affordableMonthlyMortgage = maxHousingPayment – monthlyDebtPayments;
// Ensure affordable monthly mortgage is not negative
if (affordableMonthlyMortgage 0) {
// Formula for present value of an ordinary annuity (loan amount)
// P = M * [1 – (1 + r)^(-n)] / r
// Where P is the principal loan amount, M is the monthly payment, r is the monthly interest rate, and n is the number of payments.
maxLoanAmount = affordableMonthlyMortgage * (1 – Math.pow(1 + monthlyInterestRate, -numberOfPayments)) / monthlyInterestRate;
} else {
// If interest rate is 0, loan amount is simply monthly payment * number of payments
maxLoanAmount = affordableMonthlyMortgage * numberOfPayments;
}
// Display results
resultDiv.innerHTML = "
Estimated Affordability:
";
resultDiv.innerHTML += "Maximum Affordable Monthly Mortgage Payment: $" + affordableMonthlyMortgage.toFixed(2) + "";
resultDiv.innerHTML += "Estimated Maximum Mortgage Amount You Can Borrow: $" + maxLoanAmount.toFixed(2) + "";
resultDiv.innerHTML += "Note: This is an estimation. Actual loan amounts depend on lender criteria, credit score, down payment, and other factors.";
}