Buying a home is one of the biggest financial decisions you'll ever make. Understanding how much mortgage you can realistically afford is crucial before you start house hunting. This mortgage affordability calculator helps you estimate the maximum loan amount you might qualify for, based on your income, debts, and down payment.
Key Factors Affecting Affordability:
Gross Monthly Income: This is your income before taxes and deductions. Lenders typically look at the combined income of all borrowers.
Existing Monthly Debt Payments: This includes payments for credit cards, auto loans, student loans, personal loans, and any other recurring debts.
Down Payment: The amount of money you pay upfront towards the purchase price of the home. A larger down payment reduces the loan amount needed and can improve your chances of approval.
Estimated Annual Property Taxes: These are taxes levied by local governments on the value of your property.
Estimated Annual Homeowner's Insurance: This covers potential damages to your home.
Estimated Monthly HOA Fees: If applicable, these are fees paid to a homeowners association for community maintenance and amenities.
Interest Rate: The annual rate charged by the lender for the loan. This significantly impacts your monthly payment.
Loan Term: The length of time you have to repay the mortgage, typically 15 or 30 years.
Lenders often use debt-to-income (DTI) ratios to assess affordability. A common guideline is that your total monthly housing costs (principal, interest, taxes, insurance, and HOA fees – often called PITI) should not exceed 28% of your gross monthly income (front-end DTI), and your total monthly debt payments (including PITI) should not exceed 36% of your gross monthly income (back-end DTI). This calculator uses a simplified approach, but it provides a good starting point for your budgeting.
Mortgage Affordability Calculator
Enter your financial details to estimate your affordable mortgage amount.
function calculateMortgageAffordability() {
var grossMonthlyIncome = parseFloat(document.getElementById("grossMonthlyIncome").value);
var totalMonthlyDebt = parseFloat(document.getElementById("totalMonthlyDebt").value);
var downPayment = parseFloat(document.getElementById("downPayment").value);
var estimatedAnnualTaxes = parseFloat(document.getElementById("estimatedAnnualTaxes").value);
var estimatedAnnualInsurance = parseFloat(document.getElementById("estimatedAnnualInsurance").value);
var hoaFees = parseFloat(document.getElementById("hoaFees").value);
var interestRate = parseFloat(document.getElementById("interestRate").value);
var loanTermYears = parseFloat(document.getElementById("loanTermYears").value);
var resultDiv = document.getElementById("result");
resultDiv.innerHTML = ""; // Clear previous results
// Input validation
if (isNaN(grossMonthlyIncome) || grossMonthlyIncome <= 0 ||
isNaN(totalMonthlyDebt) || totalMonthlyDebt < 0 ||
isNaN(downPayment) || downPayment < 0 ||
isNaN(estimatedAnnualTaxes) || estimatedAnnualTaxes < 0 ||
isNaN(estimatedAnnualInsurance) || estimatedAnnualInsurance < 0 ||
isNaN(hoaFees) || hoaFees < 0 ||
isNaN(interestRate) || interestRate <= 0 ||
isNaN(loanTermYears) || loanTermYears <= 0) {
resultDiv.innerHTML = "Please enter valid positive numbers for all fields.";
return;
}
// Calculate estimated monthly PITI components
var monthlyTaxes = estimatedAnnualTaxes / 12;
var monthlyInsurance = estimatedAnnualInsurance / 12;
var monthlyHOA = hoaFees; // Already in monthly format
// Calculate maximum allowable monthly housing payment based on back-end DTI (e.g., 36%)
var maxTotalMonthlyPayment = grossMonthlyIncome * 0.36;
var maxHousingPayment = maxTotalMonthlyPayment – totalMonthlyDebt;
if (maxHousingPayment <= 0) {
resultDiv.innerHTML = "Based on your debts and income, you may not qualify for an additional mortgage payment. Consider reducing debt or increasing income.";
return;
}
// Use the more restrictive of front-end or back-end DTI for housing
var maxFrontEndHousingPayment = grossMonthlyIncome * 0.28;
var actualMaxHousingPayment = Math.min(maxHousingPayment, maxFrontEndHousingPayment);
// If actualMaxHousingPayment is less than PITI, no loan is possible at these rates/terms
var minimumPITI = monthlyTaxes + monthlyInsurance + monthlyHOA;
if (actualMaxHousingPayment 0) {
var numerator = Math.pow(1 + monthlyInterestRate, numberOfMonths) – 1;
var denominator = monthlyInterestRate * Math.pow(1 + monthlyInterestRate, numberOfMonths);
if (denominator > 0) {
loanAmount = (affordablePITI – monthlyTaxes – monthlyInsurance – monthlyHOA) * (numerator / denominator);
}
} else { // Handle 0% interest rate edge case (though rare for mortgages)
if (monthlyInterestRate === 0) {
loanAmount = (affordablePITI – monthlyTaxes – monthlyInsurance – monthlyHOA) * numberOfMonths;
}
}
// Ensure loan amount is not negative
if (loanAmount < 0) {
loanAmount = 0;
}
var maxLoanAmount = loanAmount;
var affordableHomePrice = maxLoanAmount + downPayment;
resultDiv.innerHTML = `
Estimated Maximum Loan Amount: $${maxLoanAmount.toFixed(2)}
Estimated Affordable Home Price: $${affordableHomePrice.toFixed(2)}
`;
}