Understanding how much house you can afford is a crucial step in the home-buying process. This mortgage affordability calculator helps you estimate your potential borrowing capacity based on your income, debts, and down payment. By inputting these figures, you can get a clearer picture of the price range you should be considering.
How it Works:
Lenders typically use a set of debt-to-income (DTI) ratios to determine how much they are willing to lend you. The two most common ratios are:
Front-end DTI (Housing Ratio): This measures the percentage of your gross monthly income that would go towards your housing expenses (principal, interest, property taxes, and homeowner's insurance). Lenders often prefer this to be no more than 28%.
Back-end DTI (Total Debt Ratio): This measures the percentage of your gross monthly income that would go towards all your monthly debt obligations, including your potential mortgage payment, credit card payments, student loans, car loans, and other recurring debts. Lenders often prefer this to be no more than 36%.
This calculator considers both ratios to give you a more conservative estimate of your affordability.
Factors Influencing Affordability:
Gross Monthly Income: Your total income before taxes and deductions.
Monthly Debt Payments: All your existing monthly debt obligations (credit cards, car loans, student loans, etc.).
Down Payment: The upfront cash you'll pay towards the purchase of the home. A larger down payment reduces the loan amount needed.
Estimated Annual Property Taxes: Taxes levied on your property, which contribute to your monthly housing cost.
Estimated Annual Homeowner's Insurance: Insurance to protect your home against damage, also part of your monthly housing cost.
Interest Rate: The annual interest rate on your mortgage. A lower rate means a lower monthly payment.
Loan Term: The duration of the mortgage, typically 15 or 30 years.
Mortgage Affordability Calculator
30 Years
15 Years
function calculateAffordability() {
var grossMonthlyIncome = parseFloat(document.getElementById("grossMonthlyIncome").value);
var monthlyDebtPayments = parseFloat(document.getElementById("monthlyDebtPayments").value);
var downPayment = parseFloat(document.getElementById("downPayment").value);
var estimatedAnnualPropertyTaxes = parseFloat(document.getElementById("estimatedAnnualPropertyTaxes").value);
var estimatedAnnualHomeownersInsurance = parseFloat(document.getElementById("estimatedAnnualHomeownersInsurance").value);
var interestRate = parseFloat(document.getElementById("interestRate").value);
var loanTerm = parseInt(document.getElementById("loanTerm").value);
var resultDiv = document.getElementById("result");
resultDiv.innerHTML = ""; // Clear previous results
if (isNaN(grossMonthlyIncome) || grossMonthlyIncome <= 0 ||
isNaN(monthlyDebtPayments) || monthlyDebtPayments < 0 ||
isNaN(downPayment) || downPayment < 0 ||
isNaN(estimatedAnnualPropertyTaxes) || estimatedAnnualPropertyTaxes < 0 ||
isNaN(estimatedAnnualHomeownersInsurance) || estimatedAnnualHomeownersInsurance < 0 ||
isNaN(interestRate) || interestRate 100 ||
isNaN(loanTerm) || (loanTerm !== 15 && loanTerm !== 30)) {
resultDiv.innerHTML = "Please enter valid numbers for all fields.";
return;
}
// Constants for DTI limits
var maxFrontEndDTI = 0.28; // 28%
var maxBackEndDTI = 0.36; // 36%
// Calculate maximum allowed total monthly debt payment based on back-end DTI
var maxTotalMonthlyDebt = grossMonthlyIncome * maxBackEndDTI;
// Calculate maximum allowed monthly PITI (Principal, Interest, Taxes, Insurance)
var maxPITI = maxTotalMonthlyDebt – monthlyDebtPayments;
// Ensure maxPITI is not negative
if (maxPITI < 0) {
resultDiv.innerHTML = "Your existing debt payments are too high to qualify for a mortgage based on a 36% back-end DTI.";
return;
}
// Calculate maximum allowed monthly housing expenses (PITI) based on front-end DTI
var maxHousingPaymentFrontEnd = grossMonthlyIncome * maxFrontEndDTI;
// Use the more restrictive of the two (front-end or back-end) for PITI
var actualMaxPITI = Math.min(maxPITI, maxHousingPaymentFrontEnd);
var monthlyPropertyTaxes = estimatedAnnualPropertyTaxes / 12;
var monthlyHomeownersInsurance = estimatedAnnualHomeownersInsurance / 12;
// We need to find the maximum loan amount (P) that satisfies the P&I part of the mortgage payment
// ActualMaxPITI = P + monthlyPropertyTaxes + monthlyHomeownersInsurance
// P = ActualMaxPITI – monthlyPropertyTaxes – monthlyHomeownersInsurance
var maxPrincipalAndInterest = actualMaxPITI – monthlyPropertyTaxes – monthlyHomeownersInsurance;
// Ensure maxPrincipalAndInterest is not negative
if (maxPrincipalAndInterest 0) {
maxLoanAmount = maxPrincipalAndInterest * (Math.pow(1 + monthlyInterestRate, numberOfPayments) – 1) / (monthlyInterestRate * Math.pow(1 + monthlyInterestRate, numberOfPayments));
} else {
// Handle the case of 0% interest rate (though unlikely for mortgages)
maxLoanAmount = maxPrincipalAndInterest * numberOfPayments;
}
var estimatedMaxHomePrice = maxLoanAmount + downPayment;
// Format the results for display
var formattedMaxHomePrice = estimatedMaxHomePrice.toLocaleString(undefined, { style: 'currency', currency: 'USD' });
var formattedMaxLoanAmount = maxLoanAmount.toLocaleString(undefined, { style: 'currency', currency: 'USD' });
var formattedMaxPITI = actualMaxPITI.toLocaleString(undefined, { style: 'currency', currency: 'USD' });
resultDiv.innerHTML =
"
Estimated Affordability:
" +
"Based on your inputs, your estimated maximum home price could be around: " + formattedMaxHomePrice + "" +
"This includes a down payment of " + downPayment.toLocaleString(undefined, { style: 'currency', currency: 'USD' }) + " and a maximum loan amount of approximately: " + formattedMaxLoanAmount + "" +
"Your estimated maximum monthly PITI (Principal, Interest, Taxes, Insurance) payment would be: " + formattedMaxPITI + "" +
"Disclaimer: This is an estimate only. Actual loan approval and terms will depend on lender underwriting, credit score, market conditions, and other factors. Consult with a mortgage professional for precise figures.";
}