Buying a home is one of the biggest financial decisions you'll make. Determining how much you can realistically afford for a mortgage is crucial to ensure you can manage your payments comfortably without stretching your budget too thin. This mortgage affordability calculator is designed to give you an estimate of the maximum home price you might be able to purchase, considering your income, existing debts, down payment, and loan terms.
Key Factors in Mortgage Affordability:
Annual Household Income: This is the primary driver of your borrowing capacity. Lenders will assess your stable income to determine your ability to repay the loan.
Existing Monthly Debt Payments: This includes payments for credit cards, auto loans, student loans, and any other recurring debts. High existing debt can significantly reduce the amount you can borrow for a mortgage.
Down Payment: A larger down payment reduces the loan amount needed, making the mortgage more affordable and potentially lowering your interest rate and private mortgage insurance (PMI) costs.
Interest Rate: Even small variations in the interest rate can have a substantial impact on your monthly payments and the total cost of the loan over its lifetime.
Loan Term: A longer loan term (e.g., 30 years) results in lower monthly payments compared to a shorter term (e.g., 15 years), but you'll pay more interest overall.
How the Calculator Works:
This calculator uses common lending guidelines to estimate affordability. It typically considers the "front-end" and "back-end" debt-to-income (DTI) ratios. A common guideline is that your total housing expenses (including principal, interest, taxes, and insurance – PITI) should not exceed 28% of your gross monthly income (front-end ratio), and your total debt payments (housing plus existing debts) should not exceed 36% of your gross monthly income (back-end ratio).
The calculator first determines your estimated maximum monthly mortgage payment based on these DTI ratios and your existing debt. It then works backward to calculate the maximum loan amount you could qualify for with that payment. Finally, it adds your down payment to estimate the maximum home price you might afford.
Please note: This calculator provides an estimate only. Your actual borrowing capacity may vary based on lender-specific criteria, credit score, property taxes, homeowner's insurance, and other factors. It is always recommended to speak with a mortgage lender for a personalized pre-approval.
function calculateAffordability() {
var annualIncome = parseFloat(document.getElementById("annualIncome").value);
var existingDebt = parseFloat(document.getElementById("existingDebt").value);
var downPayment = parseFloat(document.getElementById("downPayment").value);
var interestRate = parseFloat(document.getElementById("interestRate").value);
var loanTerm = parseFloat(document.getElementById("loanTerm").value);
var resultDiv = document.getElementById("result");
resultDiv.innerHTML = ""; // Clear previous results
if (isNaN(annualIncome) || isNaN(existingDebt) || isNaN(downPayment) || isNaN(interestRate) || isNaN(loanTerm) ||
annualIncome <= 0 || existingDebt < 0 || downPayment < 0 || interestRate <= 0 || loanTerm <= 0) {
resultDiv.innerHTML = "Please enter valid positive numbers for all fields.";
return;
}
var monthlyIncome = annualIncome / 12;
var maxHousingPaymentRatio = 0.28; // Front-end DTI ratio
var maxTotalDebtRatio = 0.36; // Back-end DTI ratio
var maxAllowedHousingPayment = monthlyIncome * maxHousingPaymentRatio;
var maxAllowedTotalDebt = monthlyIncome * maxTotalDebtRatio;
var maxMonthlyMortgagePayment = maxAllowedTotalDebt – existingDebt;
// Ensure maxMonthlyMortgagePayment is not negative and not more than what's allowed for housing alone
if (maxMonthlyMortgagePayment maxAllowedHousingPayment) {
maxMonthlyMortgagePayment = maxAllowedHousingPayment;
}
var monthlyInterestRate = interestRate / 100 / 12;
var numberOfPayments = loanTerm * 12;
var maxLoanAmount = 0;
if (monthlyInterestRate > 0 && numberOfPayments > 0) {
// Calculate max loan amount using mortgage payment formula rearranged
// M = P [ i(1 + i)^n ] / [ (1 + i)^n – 1]
// P = M [ (1 + i)^n – 1] / i(1 + i)^n
maxLoanAmount = maxMonthlyMortgagePayment * (Math.pow(1 + monthlyInterestRate, numberOfPayments) – 1) / (monthlyInterestRate * Math.pow(1 + monthlyInterestRate, numberOfPayments));
} else if (monthlyInterestRate === 0 && numberOfPayments > 0) {
// Handle zero interest rate case
maxLoanAmount = maxMonthlyMortgagePayment * numberOfPayments;
}
var maxHomePrice = maxLoanAmount + downPayment;
// Format results
var formattedMaxLoanAmount = maxLoanAmount.toLocaleString(undefined, { style: 'currency', currency: 'USD' });
var formattedMaxHomePrice = maxHomePrice.toLocaleString(undefined, { style: 'currency', currency: 'USD' });
var formattedMaxMonthlyMortgagePayment = maxMonthlyMortgagePayment.toLocaleString(undefined, { style: 'currency', currency: 'USD' });
resultDiv.innerHTML =
"