Buying a home is a significant financial decision, and understanding how much you can realistically afford for a mortgage is crucial. A mortgage affordability calculator helps you estimate the maximum loan amount you might be approved for based on your income, debts, and other financial factors. This tool is not a guarantee of loan approval but a helpful guide to understand your borrowing potential.
Key Factors Influencing Mortgage Affordability:
Gross Monthly Income: This is your total income before taxes and deductions. Lenders use this as a primary indicator of your ability to repay a loan.
Monthly Debt Payments: This includes all your existing recurring debts, such as credit card payments, student loans, car loans, and personal loans. Lenders want to ensure your new mortgage payment won't overburden you.
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 and secure better interest rates.
Interest Rate: The percentage charged by the lender for borrowing money. Higher interest rates mean higher monthly payments and a lower affordable loan amount.
Loan Term: The length of time you have to repay the mortgage, typically 15 or 30 years. Shorter terms result in higher monthly payments but less interest paid over time.
Property Taxes and Homeowner's Insurance: These are often included in your monthly mortgage payment (in an escrow account) and significantly impact affordability.
Private Mortgage Insurance (PMI): If your down payment is less than 20%, you'll likely need to pay PMI, adding to your monthly costs.
This calculator simplifies these factors to give you an estimated maximum loan amount. Remember to consult with a mortgage lender for a precise pre-approval.
Mortgage Affordability Calculator
15 Years
30 Years
<input type="number" id="pmiRate" placeholder="e.g., 0.5 (if down payment
function calculateMortgageAffordability() {
var grossMonthlyIncome = parseFloat(document.getElementById("grossMonthlyIncome").value);
var monthlyDebtPayments = parseFloat(document.getElementById("monthlyDebtPayments").value);
var downPayment = parseFloat(document.getElementById("downPayment").value);
var annualInterestRate = parseFloat(document.getElementById("interestRate").value);
var loanTermYears = parseInt(document.getElementById("loanTerm").value);
var annualPropertyTaxes = parseFloat(document.getElementById("propertyTaxesAnnual").value);
var annualHomeInsurance = parseFloat(document.getElementById("homeInsuranceAnnual").value);
var pmiRate = parseFloat(document.getElementById("pmiRate").value);
var resultDiv = document.getElementById("result");
resultDiv.innerHTML = ""; // Clear previous results
// Input validation
if (isNaN(grossMonthlyIncome) || grossMonthlyIncome <= 0 ||
isNaN(monthlyDebtPayments) || monthlyDebtPayments < 0 ||
isNaN(downPayment) || downPayment < 0 ||
isNaN(annualInterestRate) || annualInterestRate <= 0 ||
isNaN(loanTermYears) || loanTermYears <= 0 ||
isNaN(annualPropertyTaxes) || annualPropertyTaxes < 0 ||
isNaN(annualHomeInsurance) || annualHomeInsurance < 0 ||
isNaN(pmiRate) || pmiRate < 0) {
resultDiv.innerHTML = "Please enter valid positive numbers for all fields.";
return;
}
// Lender typically uses DTI ratios (e.g., 28% for PITI, 36% for total debt)
// We'll aim for a PITI ratio of ~28% of gross income and cap total debt ratio
var maxPITIratio = 0.28; // Front-end ratio
var maxTotalDebtRatio = 0.36; // Back-end ratio
var maxMonthlyPITI = grossMonthlyIncome * maxPITIratio;
var maxTotalMonthlyObligation = grossMonthlyIncome * maxTotalDebtRatio;
// Calculate the maximum allowable monthly payment for PITI (Principal, Interest, Taxes, Insurance)
var maxAllowedMortgagePayment = maxMonthlyPITI – (annualPropertyTaxes / 12) – (annualHomeInsurance / 12);
// Adjust maxAllowedMortgagePayment for PMI if applicable
var pmiMonthly = 0;
var effectiveMaxMortgagePayment = maxAllowedMortgagePayment; // Will be adjusted for PMI
// We can't directly know the loan amount to calculate PMI without iteration.
// A common approach is to estimate PMI's impact or iterate.
// For simplicity in this calculator, we will assume PMI is a percentage of the loan *after* it's calculated and then check against the total debt ratio.
// A more robust calculator would iterate or use approximations.
var monthlyInterestRate = annualInterestRate / 100 / 12;
var loanTermMonths = loanTermYears * 12;
var estimatedLoanAmount = 0;
var calculatedPITI = 0;
// Iterative approach to find loan amount considering PMI's impact on total debt ratio
var increment = 1000; // Start with increments of $1000
var maxPossibleLoan = grossMonthlyIncome * 100; // A reasonable upper bound to prevent infinite loops
for (var potentialLoanAmount = 0; potentialLoanAmount <= maxPossibleLoan; potentialLoanAmount += increment) {
var currentPmiMonthly = 0;
if (downPayment < 0.20 * (potentialLoanAmount + downPayment)) { // Check if down payment is less than 20% of total house price
currentPmiMonthly = (potentialLoanAmount * (pmiRate / 100)) / 12;
}
var totalMonthlyPayment = (potentialLoanAmount * monthlyInterestRate) / (1 – Math.pow(1 + monthlyInterestRate, -loanTermMonths));
var totalMonthlyPaymentWithPITI = totalMonthlyPayment + (annualPropertyTaxes / 12) + (annualHomeInsurance / 12) + currentPmiMonthly;
var totalMonthlyObligation = monthlyDebtPayments + totalMonthlyPaymentWithPITI;
// Check if both PITI ratio and Total Debt Ratio are within limits
if (totalMonthlyPaymentWithPITI <= maxMonthlyPITI && totalMonthlyObligation 0 && (monthlyDebtPayments + maxAllowedMortgagePayment) <= maxTotalMonthlyObligation) {
// This is a fallback if the iterative loop didn't find a value but PITI seems to be the limiting factor.
// It's less precise regarding PMI's effect at the very edge.
var loanForMaxPITI = (maxAllowedMortgagePayment * (1 – Math.pow(1 + monthlyInterestRate, -loanTermMonths))) / monthlyInterestRate;
// Re-check total debt ratio with this loan
var pmiForLoanForMaxPITI = 0;
if (downPayment < 0.20 * (loanForMaxPITI + downPayment)) {
pmiForLoanForMaxPITI = (loanForMaxPITI * (pmiRate / 100)) / 12;
}
if (monthlyDebtPayments + maxAllowedMortgagePayment + pmiForLoanForMaxPITI 0) {
var maxHomePrice = estimatedLoanAmount + downPayment;
var monthlyMortgagePayment = (estimatedLoanAmount * monthlyInterestRate) / (1 – Math.pow(1 + monthlyInterestRate, -loanTermMonths));
var totalMonthlyPayment = monthlyMortgagePayment + (annualPropertyTaxes / 12) + (annualHomeInsurance / 12);
// Recalculate PMI based on the final estimated loan amount for display
var finalPmiMonthly = 0;
if (downPayment < 0.20 * maxHomePrice) {
finalPmiMonthly = (estimatedLoanAmount * (pmiRate / 100)) / 12;
}
totalMonthlyPayment += finalPmiMonthly; // Add final PMI to display
resultDiv.innerHTML =
"