Use this calculator to estimate the maximum mortgage you might be able to afford based on your income, debts, and estimated mortgage payments.
Understanding Mortgage Affordability
Determining how much house you can afford is a crucial step in the home-buying process. While lenders will provide you with a pre-approval amount, understanding your own comfortable budget is essential for making a sound financial decision.
Key Factors in Affordability:
Annual Gross Income: This is your total income before taxes and deductions. Lenders often use debt-to-income (DTI) ratios, and a common guideline is that your total housing costs (including principal, interest, property taxes, and insurance – PITI) should not exceed 28% of your gross monthly income.
Monthly Debt Payments: This includes car loans, student loans, credit card minimum payments, and any other recurring debt. Lenders typically want your total monthly debt (including the estimated PITI) to be no more than 36% to 43% of your gross monthly income.
Down Payment: A larger down payment reduces the amount you need to borrow, which can lower your monthly payments and potentially help you avoid Private Mortgage Insurance (PMI).
Interest Rate: Even a small difference in interest rates can significantly impact your monthly payments and the total interest paid over the life of the loan.
Loan Term: Shorter loan terms (like 15 years) have higher monthly payments but less interest paid overall. Longer terms (like 30 years) have lower monthly payments but more interest paid over time.
Property Taxes: These are levied by local governments and can vary significantly by location. They are a crucial part of your monthly housing cost.
Homeowners Insurance: This protects you financially against damage to your home and property.
Private Mortgage Insurance (PMI): If your down payment is less than 20% of the home's purchase price, lenders typically require PMI to protect them against default. This adds to your monthly housing cost.
How the Calculator Works:
This calculator estimates your maximum affordable mortgage by working backward. It considers your income, existing debts, and typical lender guidelines for debt-to-income ratios. It then factors in the estimated costs of property taxes, homeowners insurance, and PMI to arrive at a potential maximum loan amount. This is an estimate; your actual borrowing capacity will depend on the specific lender and your complete financial profile.
Disclaimer: This calculator provides an estimation for educational purposes only. It does not constitute financial advice. Consult with a mortgage professional or financial advisor for personalized guidance.
function calculateMortgageAffordability() {
var annualIncome = parseFloat(document.getElementById("annualIncome").value);
var monthlyDebt = parseFloat(document.getElementById("monthlyDebt").value);
var downPayment = parseFloat(document.getElementById("downPayment").value);
var interestRate = parseFloat(document.getElementById("interestRate").value) / 100;
var loanTermYears = parseFloat(document.getElementById("loanTermYears").value);
var propertyTaxRate = parseFloat(document.getElementById("propertyTaxRate").value) / 100;
var homeInsuranceAnnual = parseFloat(document.getElementById("homeInsuranceAnnual").value);
var pmiRate = parseFloat(document.getElementById("pmiRate").value) / 100;
var resultElement = document.getElementById("result");
resultElement.innerHTML = ""; // Clear previous results
// Input validation
if (isNaN(annualIncome) || isNaN(monthlyDebt) || isNaN(downPayment) || isNaN(interestRate) || isNaN(loanTermYears) || isNaN(propertyTaxRate) || isNaN(homeInsuranceAnnual) || isNaN(pmiRate)) {
resultElement.innerHTML = "Please enter valid numbers for all fields.";
return;
}
if (annualIncome <= 0 || monthlyDebt < 0 || downPayment < 0 || interestRate < 0 || loanTermYears <= 0 || propertyTaxRate < 0 || homeInsuranceAnnual < 0 || pmiRate < 0) {
resultElement.innerHTML = "Please enter positive values where appropriate.";
return;
}
var grossMonthlyIncome = annualIncome / 12;
// Lender typically allows PITI to be ~28% of gross monthly income.
// Also, total debt (PITI + other debts) typically ~36-43% of gross monthly income.
// We will use the more conservative 28% for housing costs as the primary driver for max affordable PITI.
var maxMonthlyHousingCost = grossMonthlyIncome * 0.28;
// Let's assume we need to find a loan amount such that the PITI fits within maxMonthlyHousingCost.
// PITI = Principal & Interest (P&I) + Taxes + Insurance + PMI
// To find the max loan amount, we need to make an iterative guess or use a financial formula.
// A simpler approach is to estimate the maximum P&I payment and then derive the loan amount.
// Max P&I = Max Monthly Housing Cost – Estimated Monthly Taxes – Estimated Monthly Insurance – Estimated Monthly PMI
// Initial guess for loan amount to estimate monthly PMI
var estimatedMaxLoanAmount = grossMonthlyIncome * 12 * 4; // A rough starting point
var monthlyTaxes = (estimatedMaxLoanAmount * propertyTaxRate) / 12;
var monthlyInsurance = homeInsuranceAnnual / 12;
var monthlyPMI = (estimatedMaxLoanAmount * pmiRate) / 12;
var maxMonthlyPI = maxMonthlyHousingCost – monthlyTaxes – monthlyInsurance – monthlyPMI;
// If maxMonthlyPI is negative, it means even without a loan, costs exceed income.
if (maxMonthlyPI 0) {
// Formula for Present Value of an Ordinary Annuity
maxLoanAmount = maxMonthlyPI * (1 – Math.pow(1 + monthlyInterestRate, -numberOfPayments)) / monthlyInterestRate;
} else {
// Handle zero interest rate case
maxLoanAmount = maxMonthlyPI * numberOfPayments;
}
// Re-calculate taxes, insurance, and PMI with the derived maxLoanAmount for accuracy
monthlyTaxes = (maxLoanAmount * propertyTaxRate) / 12;
monthlyInsurance = homeInsuranceAnnual / 12;
monthlyPMI = (maxLoanAmount * pmiRate) / 12;
var calculatedPITI = maxMonthlyPI + monthlyTaxes + monthlyInsurance + monthlyPMI;
// Let's also check the total debt to income ratio
var totalMonthlyDebtIncludingEstimatedPITI = monthlyDebt + calculatedPITI;
var maxAllowedTotalDebtRatio = grossMonthlyIncome * 0.43; // Using 43% as a common upper limit
if (totalMonthlyDebtIncludingEstimatedPITI > maxAllowedTotalDebtRatio) {
resultElement.innerHTML = "While your estimated PITI fits within the 28% housing cost guideline, your total estimated monthly debt (including PITI) might exceed typical lender limits (around 43% of gross income).";
// We still show the affordability based on the 28% rule, but flag the potential issue.
}
var affordablePurchasePrice = maxLoanAmount + downPayment;
var formattedMaxLoanAmount = maxLoanAmount.toLocaleString(undefined, { style: 'currency', currency: 'USD' });
var formattedAffordablePurchasePrice = affordablePurchasePrice.toLocaleString(undefined, { style: 'currency', currency: 'USD' });
var formattedMonthlyPI = maxMonthlyPI.toLocaleString(undefined, { style: 'currency', currency: 'USD' });
var formattedMonthlyTaxes = monthlyTaxes.toLocaleString(undefined, { style: 'currency', currency: 'USD' });
var formattedMonthlyInsurance = monthlyInsurance.toLocaleString(undefined, { style: 'currency', currency: 'USD' });
var formattedMonthlyPMI = monthlyPMI.toLocaleString(undefined, { style: 'currency', currency: 'USD' });
var formattedCalculatedPITI = calculatedPITI.toLocaleString(undefined, { style: 'currency', currency: 'USD' });
resultElement.innerHTML =
"