Understanding how much you can afford for a mortgage is a crucial first step in the home-buying process. This Mortgage Affordability Calculator helps you estimate the maximum loan amount you might qualify for based on your income, debts, and estimated interest rate. It considers key factors like your gross monthly income, existing monthly debt payments, and a potential mortgage interest rate to give you a realistic idea of your borrowing capacity.
How it Works
The calculator uses a common guideline for mortgage lenders: the debt-to-income (DTI) ratio. Lenders typically look at two DTI ratios:
Front-end DTI (Housing Ratio): This is the percentage of your gross monthly income that would go towards your mortgage payment (principal, interest, taxes, and insurance – PITI). A common guideline is to keep this below 28%.
Back-end DTI (Total Debt Ratio): This is the percentage of your gross monthly income that would cover all your monthly debt obligations, including your potential mortgage payment, credit cards, auto loans, student loans, etc. A common guideline is to keep this below 36% to 43%, depending on the lender and your credit profile.
This calculator focuses on a simplified approach to estimate affordability, primarily using the back-end DTI to determine a maximum total monthly debt, and then working backward to estimate the maximum loan amount. Remember, this is an estimate, and your actual approved loan amount may vary based on lender-specific criteria, credit score, down payment, and other financial factors.
Factors to Consider
Gross Monthly Income: This is your income before taxes and other deductions.
Estimated Mortgage Interest Rate: Higher interest rates mean higher monthly payments for the same loan amount.
Loan Term: Typically 15 or 30 years. Longer terms result in lower monthly payments but more interest paid over time.
Estimated Property Taxes: Annual property taxes divided by 12.
Estimated Homeowner's Insurance: Annual insurance premium divided by 12.
Existing Monthly Debt Payments: Include credit card minimums, auto loans, student loans, personal loans, alimony, child support, etc.
Down Payment: The amount you plan to pay upfront. This reduces the loan amount needed.
Mortgage Affordability Calculator
30 Years
15 Years
function calculateMortgageAffordability() {
var grossMonthlyIncome = parseFloat(document.getElementById("grossMonthlyIncome").value);
var interestRate = parseFloat(document.getElementById("interestRate").value);
var loanTerm = parseInt(document.getElementById("loanTerm").value);
var propertyTaxes = parseFloat(document.getElementById("propertyTaxes").value);
var homeownersInsurance = parseFloat(document.getElementById("homeownersInsurance").value);
var monthlyDebt = parseFloat(document.getElementById("monthlyDebt").value);
var downPayment = parseFloat(document.getElementById("downPayment").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(interestRate) || interestRate < 0) {
resultDiv.innerHTML = "Please enter a valid Interest Rate.";
return;
}
if (isNaN(propertyTaxes) || propertyTaxes < 0) {
resultDiv.innerHTML = "Please enter a valid amount for Property Taxes.";
return;
}
if (isNaN(homeownersInsurance) || homeownersInsurance < 0) {
resultDiv.innerHTML = "Please enter a valid amount for Homeowner's Insurance.";
return;
}
if (isNaN(monthlyDebt) || monthlyDebt < 0) {
resultDiv.innerHTML = "Please enter a valid amount for Existing Monthly Debt Payments.";
return;
}
if (isNaN(downPayment) || downPayment < 0) {
resultDiv.innerHTML = "Please enter a valid Down Payment amount.";
return;
}
var annualPropertyTaxes = propertyTaxes;
var annualHomeownersInsurance = homeownersInsurance;
var monthlyPropertyTaxes = annualPropertyTaxes / 12;
var monthlyHomeownersInsurance = annualHomeownersInsurance / 12;
// Using a common DTI guideline (e.g., 43% back-end DTI) to estimate max total monthly debt
var maxTotalMonthlyDebt = grossMonthlyIncome * 0.43;
var maxMortgagePaymentAllowed = maxTotalMonthlyDebt – monthlyDebt;
if (maxMortgagePaymentAllowed <= 0) {
resultDiv.innerHTML = "Based on your existing debts, you may not qualify for additional mortgage payments at this income level and DTI ratio.";
return;
}
var monthlyInterestRate = interestRate / 100 / 12;
var numberOfMonths = loanTerm * 12;
// Formula to calculate loan amount from monthly payment (M):
// L = M * [1 – (1 + r)^-n] / r
// Where:
// L = Loan Amount
// M = Monthly Payment (maxMortgagePaymentAllowed – PITI portion)
// r = monthly interest rate
// n = number of months
// We need to find the loan amount where (Principal + Interest + Taxes + Insurance) 0) {
calculatedLoanAmount = maxMortgagePaymentAllowed * (1 – Math.pow(1 + monthlyInterestRate, -numberOfMonths)) / monthlyInterestRate;
} else { // Handle 0% interest rate case
calculatedLoanAmount = maxMortgagePaymentAllowed * numberOfMonths;
}
// Now, let's refine this. The `maxMortgagePaymentAllowed` should be for PITI.
// So, the actual P&I budget is `maxMortgagePaymentAllowed – monthlyPropertyTaxes – monthlyHomeownersInsurance`.
var monthlyPIBudget = maxMortgagePaymentAllowed – monthlyPropertyTaxes – monthlyHomeownersInsurance;
if (monthlyPIBudget 0) {
loanAmountBasedOnPITI = monthlyPIBudget * (1 – Math.pow(1 + monthlyInterestRate, -numberOfMonths)) / monthlyInterestRate;
} else { // Handle 0% interest rate case
loanAmountBasedOnPITI = monthlyPIBudget * numberOfMonths;
}
// The loan amount is the price of the house minus the down payment.
// So, if we found the loan amount, the affordable house price is loanAmount + downPayment.
var affordableHousePrice = loanAmountBasedOnPITI + downPayment;
// Final check of the total DTI with this affordable price
var estimatedMonthlyMortgagePayment = monthlyPIBudget + monthlyPropertyTaxes + monthlyHomeownersInsurance;
var totalMonthlyObligations = estimatedMonthlyMortgagePayment + monthlyDebt;
var finalDTI = (totalMonthlyObligations / grossMonthlyIncome) * 100;
resultDiv.innerHTML = "
Estimated Mortgage Affordability
";
resultDiv.innerHTML += "Estimated Maximum Affordable House Price: $" + affordableHousePrice.toFixed(2).replace(/\B(?=(\d{3})+(?!\d))/g, ",") + "";
resultDiv.innerHTML += "This estimate is based on a " + loanTerm + "-year loan term at an interest rate of " + interestRate + "%.";
resultDiv.innerHTML += "Estimated Maximum Loan Amount: $" + loanAmountBasedOnPITI.toFixed(2).replace(/\B(?=(\d{3})+(?!\d))/g, ",") + "";
resultDiv.innerHTML += "Estimated Maximum Monthly P&I Payment: $" + monthlyPIBudget.toFixed(2).replace(/\B(?=(\d{3})+(?!\d))/g, ",") + "";
resultDiv.innerHTML += "Estimated Monthly PITI (Principal, Interest, Taxes, Insurance): $" + estimatedMonthlyMortgagePayment.toFixed(2).replace(/\B(?=(\d{3})+(?!\d))/g, ",") + "";
resultDiv.innerHTML += "Your estimated total monthly debt (including estimated mortgage PITI): $" + totalMonthlyObligations.toFixed(2).replace(/\B(?=(\d{3})+(?!\d))/g, ",") + "";
resultDiv.innerHTML += "Your estimated back-end Debt-to-Income (DTI) ratio: " + finalDTI.toFixed(2) + "%";
resultDiv.innerHTML += "Disclaimer: This is an estimate. Actual loan approval and amounts may vary based on lender, credit score, down payment, and other financial factors.";
}