Determining how much house you can afford is a crucial step in the home-buying process.
While lenders will provide pre-approval amounts, understanding your own affordability
based on your income, existing debts, and desired financial goals is equally important.
This mortgage affordability calculator helps you estimate the maximum home price you
might be able to afford, considering key financial factors.
Key Factors in Mortgage Affordability:
Annual Household Income: This is the primary driver of your borrowing capacity.
Lenders and affordability models use your gross annual income to assess your ability to
repay a loan. A higher income generally means you can afford a more expensive home.
Debt-to-Income Ratio (DTI): This ratio compares your total monthly debt payments
(including potential mortgage payments, student loans, car loans, credit card minimums) to your
gross monthly income. Lenders typically prefer a DTI of 43% or lower, though some may allow higher
ratios depending on other factors. A lower DTI indicates more financial flexibility.
Down Payment: The amount you put down upfront significantly impacts your loan amount
and potentially your interest rate. A larger down payment reduces the amount you need to borrow,
lowers your monthly payments, and can help you avoid private mortgage insurance (PMI) if it's
20% or more of the home's price.
Interest Rate: The interest rate on your mortgage has a substantial effect on your
monthly payment and the total cost of the loan over its lifetime. Even small changes in the interest
rate can lead to significant differences in affordability.
Loan Term: The number of years you have to repay your mortgage (e.g., 15, 20, 30 years).
A shorter loan term results 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 a common guideline where lenders assess affordability based on a maximum
allowable debt-to-income ratio. It first calculates your maximum allowable monthly debt based on your
income and the target DTI. Then, it estimates the maximum loan amount you can support with that monthly
debt payment, considering the provided interest rate and loan term. Finally, it adds your down payment
to this maximum loan amount to estimate your maximum affordable home price.
Disclaimer: This calculator provides an estimate for informational purposes only and
should not be considered financial advice. Actual mortgage approval and amounts may vary based on lender
criteria, credit score, market conditions, and other individual financial factors. It's always recommended
to speak with a mortgage professional for personalized guidance.
function calculateMortgageAffordability() {
var annualIncome = parseFloat(document.getElementById("annualIncome").value);
var debtToIncomeRatio = parseFloat(document.getElementById("debtToIncomeRatio").value) / 100; // Convert percentage to decimal
var downPayment = parseFloat(document.getElementById("downPayment").value);
var interestRate = parseFloat(document.getElementById("interestRate").value) / 100; // Convert percentage to decimal
var loanTerm = parseFloat(document.getElementById("loanTerm").value);
var resultElement = document.getElementById("result");
resultElement.innerHTML = ""; // Clear previous results
// Input validation
if (isNaN(annualIncome) || annualIncome <= 0 ||
isNaN(debtToIncomeRatio) || debtToIncomeRatio 1 ||
isNaN(downPayment) || downPayment < 0 ||
isNaN(interestRate) || interestRate < 0 ||
isNaN(loanTerm) || loanTerm <= 0) {
resultElement.innerHTML = "Please enter valid positive numbers for all fields.";
return;
}
// 1. Calculate Gross Monthly Income
var grossMonthlyIncome = annualIncome / 12;
// 2. Calculate Maximum Allowable Monthly Debt Payment (including PITI and other debts)
// For simplicity in this calculator, we are assuming the DTI applies primarily to the housing payment
// plus existing debts. A more complex calculator would factor in existing debts separately.
// Here, we'll calculate the maximum housing payment based on DTI.
var maxMonthlyHousingPayment = grossMonthlyIncome * debtToIncomeRatio;
// 3. Calculate the maximum loan amount based on the maxMonthlyHousingPayment, interest rate, and loan term
var monthlyInterestRate = interestRate / 12;
var numberOfPayments = loanTerm * 12;
var maxLoanAmount = 0;
// Handle zero interest rate case to avoid division by zero
if (monthlyInterestRate === 0) {
maxLoanAmount = maxMonthlyHousingPayment * numberOfPayments;
} else {
// M = P [ i(1 + i)^n ] / [ (1 + i)^n – 1]
// P = M [ (1 + i)^n – 1] / i(1 + i)^n
// Where P is the loan principal (maxLoanAmount), M is the monthly payment (maxMonthlyHousingPayment),
// i is the monthly interest rate, and n is the number of payments.
var numerator = Math.pow(1 + monthlyInterestRate, numberOfPayments) – 1;
var denominator = monthlyInterestRate * Math.pow(1 + monthlyInterestRate, numberOfPayments);
maxLoanAmount = maxMonthlyHousingPayment * (numerator / denominator);
}
// 4. Estimate Maximum Affordable Home Price
var maxAffordableHomePrice = maxLoanAmount + downPayment;
// Display the results
resultElement.innerHTML =
"