Understanding how much house you can afford is a crucial first step in the home-buying process. This mortgage affordability calculator helps you estimate your maximum mortgage amount based on your income, debts, and down payment. It's important to remember that this is an estimation, and your actual mortgage approval will depend on a lender's specific underwriting criteria, credit score, and other financial factors.
Understanding Your Mortgage Affordability
Several factors determine how much mortgage you can qualify for. Lenders typically use debt-to-income ratios (DTI) to assess your ability to manage monthly payments. There are generally two types of DTI ratios:
Front-end DTI (Housing DTI): This ratio compares your potential monthly housing expenses (principal, interest, taxes, insurance, and HOA fees) to your gross monthly income. Many lenders prefer this to be 28% or lower.
Back-end DTI (Total DTI): This ratio compares all your monthly debt obligations (including the potential mortgage payment, credit cards, car loans, student loans, etc.) to your gross monthly income. A common guideline is for this ratio to be 36% or lower, though some programs may allow up to 43% or even higher.
Our calculator uses a simplified approach focusing on your income and existing debts to estimate your potential borrowing power. It assumes a standard DTI limit to provide a ballpark figure. Remember to factor in closing costs, moving expenses, and potential home maintenance when budgeting for your new home.
Example Calculation:
Let's say you have an annual gross income of $75,000, meaning your gross monthly income is $6,250 ($75,000 / 12). You have existing monthly debt payments of $500. You plan to make a down payment of $20,000 and are looking at a 30-year mortgage with an estimated interest rate of 6.5%.
Using a common guideline of a 36% back-end DTI, your total monthly debt payments (including the potential mortgage) should not exceed $2,250 ($6,250 * 0.36). Since you already have $500 in monthly debts, this leaves $1,750 for your potential mortgage payment ($2,250 – $500).
Based on these figures and the loan parameters, the calculator will estimate the maximum loan amount you could potentially afford, which you can then add your down payment to determine your maximum home price.
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);
var loanTerm = parseFloat(document.getElementById("loanTerm").value);
var resultDiv = document.getElementById("result");
// Clear previous results
resultDiv.innerHTML = "";
// Input validation
if (isNaN(annualIncome) || annualIncome <= 0 ||
isNaN(monthlyDebt) || monthlyDebt < 0 ||
isNaN(downPayment) || downPayment < 0 ||
isNaN(interestRate) || interestRate <= 0 ||
isNaN(loanTerm) || loanTerm <= 0) {
resultDiv.innerHTML = "Please enter valid positive numbers for all fields.";
return;
}
var grossMonthlyIncome = annualIncome / 12;
// Using a common DTI guideline of 36% for total debt
var maxTotalMonthlyObligation = grossMonthlyIncome * 0.36;
var maxMortgagePayment = maxTotalMonthlyObligation – monthlyDebt;
if (maxMortgagePayment <= 0) {
resultDiv.innerHTML = "Based on your income and existing debts, it may be difficult to qualify for a new mortgage at this time. Consider increasing income or reducing debt.";
return;
}
// Mortgage payment formula: M = P [ i(1 + i)^n ] / [ (1 + i)^n – 1]
// Where:
// M = monthly payment
// P = principal loan amount
// i = monthly interest rate (annual rate / 12)
// n = total number of payments (loan term in years * 12)
var monthlyInterestRate = (interestRate / 100) / 12;
var numberOfPayments = loanTerm * 12;
// Rearranging the formula to solve for P (Principal Loan Amount)
// P = M [ (1 + i)^n – 1] / [ i(1 + i)^n ]
var principalLoanAmount = maxMortgagePayment * (Math.pow(1 + monthlyInterestRate, numberOfPayments) – 1) / (monthlyInterestRate * Math.pow(1 + monthlyInterestRate, numberOfPayments));
// Add down payment to get estimated maximum home price
var estimatedMaxHomePrice = principalLoanAmount + downPayment;
// Format and display results
var formattedPrincipal = principalLoanAmount.toLocaleString(undefined, { style: 'currency', currency: 'USD' });
var formattedMaxHomePrice = estimatedMaxHomePrice.toLocaleString(undefined, { style: 'currency', currency: 'USD' });
resultDiv.innerHTML =
"