Buying a home is a significant financial decision, and understanding how much you can realistically afford for a mortgage is crucial. This mortgage affordability calculator helps you estimate your maximum loan amount based on your income, debts, and estimated interest rate.
How Mortgage Affordability is Calculated
Lenders typically use a debt-to-income (DTI) ratio to determine how much they are willing to lend you. There are generally two DTI ratios they look at:
Front-End Ratio (Housing Ratio): This ratio compares your potential monthly housing expenses (principal, interest, property taxes, homeowner's insurance, and HOA dues) to your gross monthly income. A common guideline is to keep this below 28%.
Back-End Ratio (Total Debt Ratio): This ratio compares all your monthly debt obligations (including the potential mortgage payment, credit card payments, auto loans, student loans, etc.) to your gross monthly income. A common guideline is to keep this below 36%.
This calculator simplifies the process by focusing on your ability to service a loan based on your income and existing debts, and then estimating the maximum loan amount you could qualify for assuming a standard amortization schedule and a reasonable interest rate. It also accounts for your down payment.
Disclaimer: This calculator provides an estimate only and does not guarantee loan approval. Actual loan amounts may vary based on lender policies, credit score, loan type, and other factors.
function calculateMortgageAffordability() {
var grossMonthlyIncome = parseFloat(document.getElementById("grossMonthlyIncome").value);
var monthlyDebtPayments = parseFloat(document.getElementById("monthlyDebtPayments").value);
var downPayment = parseFloat(document.getElementById("downPayment").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
if (isNaN(grossMonthlyIncome) || isNaN(monthlyDebtPayments) || isNaN(downPayment) || isNaN(interestRate) || isNaN(loanTerm)) {
resultDiv.innerHTML = "Please enter valid numbers for all fields.";
return;
}
// Let's use common DTI ratios as a guideline, aiming for a conservative approach.
// For simplicity, we'll focus on the back-end DTI, as it includes all debts.
// A common guideline is a maximum of 36% for total debt payments (including housing).
var maxTotalDebtPayment = grossMonthlyIncome * 0.36;
// Maximum allowed monthly mortgage payment
var maxMortgagePayment = maxTotalDebtPayment – monthlyDebtPayments;
if (maxMortgagePayment 0 && numberOfPayments > 0) {
// Rearranging the formula to solve for P:
// P = M [ (1 + i)^n – 1] / [ i(1 + i)^n ]
var numerator = Math.pow(1 + monthlyInterestRate, numberOfPayments) – 1;
var denominator = monthlyInterestRate * Math.pow(1 + monthlyInterestRate, numberOfPayments);
maxLoanAmount = maxMortgagePayment * (numerator / denominator);
} else if (monthlyInterestRate === 0 && numberOfPayments > 0) {
// Handle 0% interest rate
maxLoanAmount = maxMortgagePayment * numberOfPayments;
}
// The maximum affordability is the loan amount plus the down payment
var totalAffordability = maxLoanAmount + downPayment;
resultDiv.innerHTML = "