Understanding how much mortgage you can afford is a crucial step in the home-buying process.
This calculator helps you estimate your maximum loan amount based on your income, debts,
and estimated interest rate. It's important to remember that this is an estimate, and your
actual borrowing power may vary based on lender-specific criteria, credit score, down payment,
and other factors.
Key Factors to Consider:
Gross Monthly Income: This is your income before taxes and other deductions. Lenders
typically look at your total household income.
Existing Monthly Debt Payments: Include credit card minimum payments, car loans, student loans,
personal loans, and any other recurring debt obligations.
Estimated Interest Rate: This is the annual interest rate you expect to pay on your mortgage.
It significantly impacts your monthly payment and the total amount you can borrow.
Loan Term: The length of the mortgage, usually 15 or 30 years.
Property Taxes and Homeowner's Insurance: While not directly in this calculator's core loan
amount calculation, these are essential components of your total monthly housing payment (PITI – Principal, Interest, Taxes, Insurance) and will affect your overall affordability. Many lenders use the "front-end ratio" (housing costs only) and "back-end ratio" (all debt) to determine affordability. This calculator focuses on the debt-to-income ratio to estimate loan capacity.
Lenders often use debt-to-income (DTI) ratios to assess risk. A common guideline is that your total monthly
debt payments (including the estimated mortgage principal and interest, plus taxes and insurance)
should not exceed a certain percentage of your gross monthly income. For the purpose of estimating maximum
loan amount, we will use a simplified approach focusing on the impact of your income and existing debts.
Mortgage Affordability Calculator
function calculateMortgageAffordability() {
var grossMonthlyIncome = parseFloat(document.getElementById("grossMonthlyIncome").value);
var existingMonthlyDebt = parseFloat(document.getElementById("existingMonthlyDebt").value);
var interestRate = parseFloat(document.getElementById("interestRate").value);
var loanTermYears = parseInt(document.getElementById("loanTermYears").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(existingMonthlyDebt) || existingMonthlyDebt < 0) {
resultDiv.innerHTML = "Please enter a valid Existing Monthly Debt Payments.";
return;
}
if (isNaN(interestRate) || interestRate = 100) {
resultDiv.innerHTML = "Please enter a valid Interest Rate between 1% and 99%.";
return;
}
if (isNaN(loanTermYears) || loanTermYears <= 0) {
resultDiv.innerHTML = "Please enter a valid Loan Term in years.";
return;
}
// Typical DTI ratios used by lenders (can vary)
// Front-end ratio (housing costs) might be up to 28%
// Back-end ratio (all debts including P&I, taxes, insurance) might be up to 36%
// For this calculator, we'll estimate maximum P&I payment capacity based on income
// and a common back-end DTI target (e.g., 36% of gross income)
var maxTotalDebtPayment = grossMonthlyIncome * 0.36; // Example: 36% DTI ratio
var maxMortgagePayment = maxTotalDebtPayment – existingMonthlyDebt;
if (maxMortgagePayment 0) {
maxLoanAmount = maxMortgagePayment * (1 – Math.pow(1 + monthlyInterestRate, -numberOfPayments)) / monthlyInterestRate;
} else { // Handle 0% interest rate, though unlikely for mortgages
maxLoanAmount = maxMortgagePayment * numberOfPayments;
}
// Display the results
var formattedMaxLoanAmount = maxLoanAmount.toFixed(2);
var formattedMaxMortgagePayment = maxMortgagePayment.toFixed(2);
resultDiv.innerHTML =
"Estimated Maximum Mortgage Payment (Principal & Interest): $" + formattedMaxMortgagePayment + "" +
"Estimated Maximum Loan Amount: $" + formattedMaxLoanAmount + "" +
"This calculation is an estimate based on a " + (0.36 * 100) + "% debt-to-income ratio and does not include property taxes, homeowner's insurance, or potential Private Mortgage Insurance (PMI). Your actual affordability may vary.";
}