Estimate how much house you can buy based on your income and debts.
Total income before taxes.
Car loans, student loans, credit cards.
30 Years
15 Years
20 Years
10 Years
Your Affordability Estimate
Maximum Home Price$0
Est. Monthly Payment:
$0
(Principal, Interest, Taxes, Insurance)
Loan Amount:
$0
Note based on DTI: Lenders typically prefer your total monthly debts (including mortgage) not to exceed 36% of your gross income. This calculation uses a conservative 36% Debt-to-Income ratio limit.
function calculateAffordability() {
// 1. Get Input Values
var income = parseFloat(document.getElementById("annualIncome").value);
var monthlyDebts = parseFloat(document.getElementById("monthlyDebts").value);
var downPayment = parseFloat(document.getElementById("downPayment").value);
var rate = parseFloat(document.getElementById("interestRate").value);
var termYears = parseInt(document.getElementById("loanTerm").value);
var tax = parseFloat(document.getElementById("propertyTax").value);
var insurance = parseFloat(document.getElementById("homeInsurance").value);
// 2. Validation
if (isNaN(income) || income <= 0) {
alert("Please enter a valid annual income.");
return;
}
if (isNaN(monthlyDebts)) monthlyDebts = 0;
if (isNaN(downPayment)) downPayment = 0;
if (isNaN(rate) || rate <= 0) {
alert("Please enter a valid interest rate.");
return;
}
if (isNaN(tax)) tax = 0;
if (isNaN(insurance)) insurance = 0;
// 3. Calculation Logic
// Calculate Monthly Gross Income
var monthlyIncome = income / 12;
// Determine Max Allowable Payment based on DTI (Debt-to-Income) Rules
// Rule 1: Front-End Ratio (Housing Expense Ratio) – typically 28%
var maxHousingPaymentRule1 = monthlyIncome * 0.28;
// Rule 2: Back-End Ratio (Total Debt Ratio) – typically 36%
// Total Debt (House + Other Debts) must be <= 36% of Income
var maxTotalDebt = monthlyIncome * 0.36;
var maxHousingPaymentRule2 = maxTotalDebt – monthlyDebts;
// Use the lower of the two limits (conservative lender approach)
var maxAllowedMonthlyPayment = Math.min(maxHousingPaymentRule1, maxHousingPaymentRule2);
// If debts are too high, affordability might be 0
if (maxAllowedMonthlyPayment 0) {
// Calculate Max Loan Amount using the Annuity Formula (PV)
// PV = PMT * (1 – (1+r)^-n) / r
var monthlyRate = (rate / 100) / 12;
var numberOfPayments = termYears * 12;
if (monthlyRate === 0) {
maxLoanAmount = availableForPI * numberOfPayments;
} else {
maxLoanAmount = availableForPI * (1 – Math.pow(1 + monthlyRate, -numberOfPayments)) / monthlyRate;
}
// Total Home Price = Loan + Down Payment
maxPrice = maxLoanAmount + downPayment;
} else {
// Taxes and insurance consume all affordability
maxPrice = downPayment; // Can only afford what they pay cash for (unlikely scenario for calculator user)
availableForPI = 0;
}
// 4. Update Output
// Format Currency Function
var formatter = new Intl.NumberFormat('en-US', {
style: 'currency',
currency: 'USD',
maximumFractionDigits: 0
});
document.getElementById("resultsArea").style.display = "block";
document.getElementById("maxHomePriceDisplay").innerHTML = formatter.format(maxPrice);
// The Monthly Payment displayed is the max allowed (PITI) that was calculated
var totalMonthlyPayment = availableForPI + monthlyTax + monthlyInsurance;
document.getElementById("monthlyPaymentDisplay").innerHTML = formatter.format(totalMonthlyPayment);
document.getElementById("loanAmountDisplay").innerHTML = formatter.format(maxLoanAmount);
}
Understanding Mortgage Affordability
Determining "how much house can I afford" is the critical first step in the home buying process. Unlike a simple mortgage payment calculator, a mortgage affordability calculator works backwards from your income and existing debts to determine a responsible purchasing budget. This ensures you don't overextend yourself financially.
How Affordability is Calculated
Lenders typically use two main metrics, known as Debt-to-Income (DTI) ratios, to decide how much they are willing to lend you. This calculator uses standard conservative banking rules:
Front-End Ratio (28% Rule): This rule states that your total housing costs (Principal, Interest, Taxes, and Insurance) should not exceed 28% of your gross monthly income.
Back-End Ratio (36% Rule): This rule looks at your total debt burden. It states that your total monthly debt payments (including your new mortgage plus student loans, car payments, and credit cards) should not exceed 36% of your gross monthly income.
The calculator determines the maximum monthly payment allowed under both rules and uses the lower number to ensure you stay within a safe financial range.
Factors That Impact Your Buying Power
Several variables can significantly change your maximum home price:
Down Payment: The more cash you put down upfront, the higher the home price you can afford, as it reduces the loan amount needed.
Interest Rates: A higher interest rate increases your monthly payment for the same loan amount, effectively reducing your buying power. Even a 1% increase in rates can reduce your affordability by tens of thousands of dollars.
Existing Debts: High monthly payments for cars or credit cards directly reduce the amount of income available for a mortgage. Paying off a monthly debt of $400 could increase your mortgage affordability by approximately $60,000-$70,000 depending on rates.
Property Taxes & Insurance: These are "sunk costs" in your monthly payment. Areas with high property taxes will reduce the amount of money left over for the mortgage principal and interest, lowering the loan amount you can qualify for.
Improving Your Affordability
If the result is lower than current home prices in your area, consider these strategies: pay down high-interest consumer debt to improve your DTI ratio, save for a larger down payment to avoid Private Mortgage Insurance (PMI) and reduce the loan size, or look for a lower interest rate by improving your credit score.