Understanding how much mortgage you can afford is a crucial first step in the home-buying process. This calculator helps you estimate your maximum affordable mortgage amount based on your income, debts, and desired monthly payment. It's important to remember that lenders will also consider your credit score, down payment, and other financial factors.
How it Works:
This calculator uses a common guideline for mortgage affordability: that your total monthly debt payments (including the estimated mortgage payment, property taxes, homeowner's insurance, and potentially HOA fees) should not exceed a certain percentage of your gross monthly income. Lenders often use two ratios: the Debt-to-Income (DTI) ratio. The front-end DTI (housing costs only) is typically around 28%, and the back-end DTI (all debts) is typically around 36%.
Our calculator focuses on estimating the maximum loan amount you can qualify for based on a target monthly payment, factoring in estimated taxes and insurance. You can input your desired maximum monthly payment (principal, interest, taxes, and insurance) and provide details about your existing debts and income.
Mortgage Affordability Calculator
function calculateAffordableMortgage() {
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 loanTerm = parseFloat(document.getElementById("loanTerm").value);
var estimatedMonthlyTaxesInsurance = parseFloat(document.getElementById("estimatedMonthlyTaxesInsurance").value);
var resultDiv = document.getElementById("result");
resultDiv.innerHTML = ""; // Clear previous results
if (isNaN(grossMonthlyIncome) || grossMonthlyIncome <= 0 ||
isNaN(existingMonthlyDebt) || existingMonthlyDebt < 0 ||
isNaN(downPayment) || downPayment < 0 ||
isNaN(interestRate) || interestRate <= 0 ||
isNaN(loanTerm) || loanTerm <= 0 ||
isNaN(estimatedMonthlyTaxesInsurance) || estimatedMonthlyTaxesInsurance < 0) {
resultDiv.innerHTML = "Please enter valid positive numbers for all fields.";
return;
}
// Using a common DTI guideline of 36% for total debt payments
var maxTotalMonthlyPayment = grossMonthlyIncome * 0.36;
var maxMortgagePayment = maxTotalMonthlyPayment – existingMonthlyDebt;
if (maxMortgagePayment <= estimatedMonthlyTaxesInsurance) {
resultDiv.innerHTML = "Based on your income and existing debts, your maximum affordable monthly payment for PITI (Principal, Interest, Taxes, Insurance) is too low to cover estimated taxes and insurance alone. Consider increasing your income, reducing debts, or adjusting your expectations.";
return;
}
var principalAndInterestLimit = maxMortgagePayment – estimatedMonthlyTaxesInsurance;
if (principalAndInterestLimit <= 0) {
resultDiv.innerHTML = "Based on your income and existing debts, your maximum affordable monthly payment for PITI (Principal, Interest, Taxes, Insurance) is too low to cover estimated taxes and insurance alone. Consider increasing your income, reducing debts, or adjusting your expectations.";
return;
}
var monthlyInterestRate = (interestRate / 100) / 12;
var numberOfPayments = loanTerm * 12;
// Calculate max loan amount using the mortgage payment formula rearranged
// M = P [ i(1 + i)^n ] / [ (1 + i)^n – 1]
// P = M [ (1 + i)^n – 1] / [ i(1 + i)^n ]
var maxLoanAmount = principalAndInterestLimit * (Math.pow(1 + monthlyInterestRate, numberOfPayments) – 1) / (monthlyInterestRate * Math.pow(1 + monthlyInterestRate, numberOfPayments));
var affordableHomePrice = maxLoanAmount + downPayment;
resultDiv.innerHTML = "
Estimated Affordability:
" +
"Your estimated maximum affordable loan amount is: $" + maxLoanAmount.toFixed(2).replace(/\d(?=(\d{3})+\.)/g, '$&,') + "" +
"This suggests you could potentially afford a home priced around: $" + affordableHomePrice.toFixed(2).replace(/\d(?=(\d{3})+\.)/g, '$&,') + "";
}