Use this calculator to estimate how much mortgage you can afford based on your income and debts.
Understanding Mortgage Affordability
Buying a home is a significant financial decision, and understanding how much mortgage you can afford is a crucial first step. A mortgage affordability calculator helps you estimate the maximum loan amount you might qualify for, considering various financial factors. This isn't a guarantee of loan approval, as lenders have their own specific criteria, but it provides a valuable baseline for your home-buying journey.
Key Factors in Mortgage Affordability:
Annual Gross Income: This is your total income before taxes and other deductions. Lenders use this as a primary indicator of your ability to repay a loan.
Existing Monthly Debt Payments: This includes minimum payments on credit cards, car loans, student loans, personal loans, and any other recurring debt obligations. Lenders look at your debt-to-income ratio (DTI), which compares your total monthly debt payments to your gross monthly income. A lower DTI generally means you can afford a larger mortgage.
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 also influence interest rates and private mortgage insurance (PMI) requirements.
Interest Rate: The annual percentage rate charged by the lender on the loan. Even small differences in interest rates can significantly impact your monthly payment and the total interest paid over the life of the loan.
Loan Term: The duration of the mortgage, typically 15 or 30 years. A shorter loan term will result in higher monthly payments but less interest paid overall. A longer term means lower monthly payments but more interest paid over time.
How the Calculator Works:
This calculator uses common lending guidelines to estimate your affordability. It considers a maximum front-end debt-to-income ratio (often around 28% for PITI – Principal, Interest, Taxes, and Insurance) and a back-end debt-to-income ratio (often around 36% to 43%, including PITI and all other debts). It then works backward from these ratios, along with your down payment, interest rate, and loan term, to estimate the maximum loan amount you might qualify for.
Remember, this is an estimation. Your actual borrowing power may vary based on lender policies, your credit score, the property's appraised value, and other underwriting factors. It's always recommended to speak with a mortgage lender for a pre-approval.
function calculateMortgageAffordability() {
var annualIncome = parseFloat(document.getElementById("annualIncome").value);
var existingMonthlyDebt = parseFloat(document.getElementById("existingMonthlyDebt").value);
var downPayment = parseFloat(document.getElementById("downPayment").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(annualIncome) || annualIncome <= 0 ||
isNaN(existingMonthlyDebt) || existingMonthlyDebt < 0 ||
isNaN(downPayment) || downPayment < 0 ||
isNaN(interestRate) || interestRate <= 0 ||
isNaN(loanTermYears) || loanTermYears <= 0) {
resultDiv.innerHTML = "Please enter valid positive numbers for all fields.";
return;
}
var monthlyIncome = annualIncome / 12;
// Common DTI ratios (can be adjusted based on lender standards)
var maxFrontEndDTI = 0.28; // For PITI (Principal, Interest, Taxes, Insurance)
var maxBackEndDTI = 0.36; // For PITI + existing debts
// Calculate maximum total housing payment allowed (PITI)
var maxPITI = (monthlyIncome * maxBackEndDTI) – existingMonthlyDebt;
// If maxPITI is negative, it means existing debts are too high for this income bracket
if (maxPITI < 0) {
resultDiv.innerHTML = "Based on your existing debt and income, qualifying for a mortgage may be challenging. Your estimated maximum monthly housing payment (PITI) is negative.";
return;
}
// Estimate monthly property taxes and homeowner's insurance (as a percentage of estimated home price)
// This is a simplification. Actual costs vary greatly by location and home value.
// We'll assume a combined 1.2% of home value annually, or 0.1% monthly for estimation.
// Since we don't know the home price yet, this requires an iterative approach or assumption.
// A common approach is to assume a loan amount and refine. For simplicity here, let's try to back-calculate.
// Let's estimate the maximum loan amount first, assuming taxes/insurance are a small part initially.
// We'll use an iterative approach to account for PITI more accurately.
var estimatedMaxLoan = 0;
var iterations = 100; // Number of iterations for refinement
var tolerance = 0.01; // Tolerance for convergence
for (var i = 0; i 0) {
monthlyPI = currentEstimatedLoan * (monthlyInterestRate * Math.pow(1 + monthlyInterestRate, numberOfPayments)) / (Math.pow(1 + monthlyInterestRate, numberOfPayments) – 1);
} else { // Handle 0% interest rate case
monthlyPI = currentEstimatedLoan / numberOfPayments;
}
// Estimate monthly property taxes and insurance. Let's assume they are a percentage of the *potential* home price,
// which is roughly the loan amount + down payment.
// A common estimate for taxes + insurance might be 1% of home value annually / 12 months = 0.0833% monthly.
// For simplicity, let's estimate based on the P&I part. A very rough heuristic: PITI is ~1.25x P&I.
// Or, let's try to estimate taxes/insurance as a percentage of the estimated total home price (Loan + Down Payment).
// If we assume the total home price is roughly `currentEstimatedLoan + downPayment`, then:
var estimatedHomePrice = currentEstimatedLoan + downPayment;
var estimatedMonthlyTaxesInsurance = (estimatedHomePrice * 0.01) / 12; // 1% of home value annually for taxes+insurance
var totalMonthlyHousingCost = monthlyPI + estimatedMonthlyTaxesInsurance;
// Calculate the implied loan amount that would result in this total housing cost
// We need to find a loan amount where P&I + Taxes/Insurance = maxPITI
// This is tricky because taxes/insurance depend on the home price, which depends on the loan.
// Simpler approach: Calculate P&I from maxPITI, then estimate loan based on that P&I.
// This assumes taxes/insurance are a fixed portion of maxPITI.
// Let's assume Taxes+Insurance are ~20% of PITI for estimation purposes.
var estimatedMonthlyPI = maxPITI * 0.80; // Assume 20% of PITI is for taxes/insurance
var calculatedLoanFromPI = 0;
if (monthlyInterestRate > 0) {
calculatedLoanFromPI = estimatedMonthlyPI * (Math.pow(1 + monthlyInterestRate, numberOfPayments) – 1) / (monthlyInterestRate * Math.pow(1 + monthlyInterestRate, numberOfPayments));
} else {
calculatedLoanFromPI = estimatedMonthlyPI * numberOfPayments;
}
// Now, let's re-evaluate PITI based on this calculated loan, and see if it fits maxPITI.
var recalculatedHomePrice = calculatedLoanFromPI + downPayment;
var recalculatedMonthlyTaxesInsurance = (recalculatedHomePrice * 0.01) / 12; // Using 1% annual estimate
var recalculatedPITI = calculatedLoanFromPI * (monthlyInterestRate * Math.pow(1 + monthlyInterestRate, numberOfPayments)) / (Math.pow(1 + monthlyInterestRate, numberOfPayments) – 1) + recalculatedMonthlyTaxesInsurance;
if (isNaN(recalculatedPITI)) recalculatedPITI = 0; // Handle potential NaN
if (recalculatedPITI <= maxPITI) {
estimatedMaxLoan = calculatedLoanFromPI;
} else {
// If PITI is too high, we need to reduce the loan.
// This iterative adjustment can be complex. For a simpler calculator, we might cap.
// Or, adjust estimatedMaxLoan downwards.
estimatedMaxLoan = calculatedLoanFromPI * (maxPITI / recalculatedPITI); // Scale down
}
if (Math.abs(estimatedMaxLoan – currentEstimatedLoan) 0) {
finalMonthlyPI = estimatedMaxLoan * (finalMonthlyInterestRate * Math.pow(1 + finalMonthlyInterestRate, finalNumberOfPayments)) / (Math.pow(1 + finalMonthlyInterestRate, finalNumberOfPayments) – 1);
} else {
finalMonthlyPI = estimatedMaxLoan / finalNumberOfPayments;
}
var finalEstimatedHomePrice = estimatedMaxLoan + downPayment;
var finalEstimatedMonthlyTaxesInsurance = (finalEstimatedHomePrice * 0.01) / 12; // 1% annual estimate
var finalPITI = finalMonthlyPI + finalEstimatedMonthlyTaxesInsurance;
var totalMonthlyDebt = existingMonthlyDebt + finalPITI;
var actualBackEndDTI = (totalMonthlyDebt / monthlyIncome) * 100;
// Display results
var formattedMaxLoan = estimatedMaxLoan.toFixed(2);
var formattedDownPayment = downPayment.toFixed(2);
var estimatedMaxHomePrice = (parseFloat(formattedMaxLoan) + downPayment).toFixed(2);
var formattedFinalPITI = finalPITI.toFixed(2);
resultDiv.innerHTML =
"
Estimated Mortgage Affordability
" +
"Estimated Maximum Home Price You Can Afford: $" + estimatedMaxHomePrice + "" +
"(This is based on your down payment of $" + formattedDownPayment + " + estimated maximum loan)" +
"Estimated Maximum Mortgage Loan Amount: $" + formattedMaxLoan + "" +
"Estimated Maximum Monthly Payment (PITI): $" + formattedFinalPITI + "" +
"(PITI = Principal, Interest, Taxes, and Insurance)" +
"Your Estimated Back-End DTI Ratio: " + actualBackEndDTI.toFixed(2) + "%" +
"Note: These are estimations. Actual loan approval and amounts depend on lender underwriting, credit score, property appraisal, and current market conditions.";
}