Estimate how much house you can afford based on income and debt.
Please enter valid positive numbers for all fields.
Maximum Home Price You Can Afford
$0
Monthly Principal & Interest
$0
Est. Monthly Tax & Ins.
$0
Total Monthly Payment
$0
*Calculation assumes a standard Debt-to-Income (DTI) ratio limit of 36% for total debts.
function calculateAffordability() {
// 1. Get input values
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 propertyTaxRate = parseFloat(document.getElementById('propertyTaxRate').value);
var homeInsurance = parseFloat(document.getElementById('homeInsurance').value);
// 2. Validate inputs
if (isNaN(annualIncome) || isNaN(monthlyDebt) || isNaN(downPayment) ||
isNaN(interestRate) || isNaN(loanTerm) || isNaN(propertyTaxRate) || isNaN(homeInsurance)) {
document.getElementById('errorMsg').style.display = 'block';
document.getElementById('resultBox').style.display = 'none';
return;
}
// Basic Logic Check
if (annualIncome <= 0 || loanTerm <= 0) {
document.getElementById('errorMsg').style.display = 'block';
return;
}
document.getElementById('errorMsg').style.display = 'none';
// 3. Calculation Logic
// Calculate Monthly Gross Income
var monthlyIncome = annualIncome / 12;
// Determine Allowable Monthly Housing Payment based on DTI Ratios
// Rule 1: Front-End Ratio (Housing only) – typically 28%
var maxHousingFront = monthlyIncome * 0.28;
// Rule 2: Back-End Ratio (Total Debt) – typically 36%
// Max Total Debt = Housing + Other Debts
// So, Max Housing = (Income * 0.36) – Other Debts
var maxTotalDebtAllowed = monthlyIncome * 0.36;
var maxHousingBack = maxTotalDebtAllowed – monthlyDebt;
// The bank will lend based on the lower of the two
var maxAffordablePayment = Math.min(maxHousingFront, maxHousingBack);
// If debts are too high, affordability might be 0 or negative
if (maxAffordablePayment <= 0) {
displayResults(0, 0, 0, 0);
return;
}
// We need to find the Home Price (P) that results in this Monthly Payment.
// Payment = Mortgage(PI) + MonthlyTax + MonthlyInsurance
// Mortgage(PI) = (Price – DownPayment) * r(1+r)^n / ((1+r)^n – 1)
// MonthlyTax = Price * (TaxRate/100/12)
// MonthlyInsurance = AnnualInsurance / 12
// var c = Mortgage Factor calculation
var monthlyRate = (interestRate / 100) / 12;
var numberOfPayments = loanTerm * 12;
// If interest rate is 0 (unlikely but possible edge case)
var mortgageFactor = 0;
if (monthlyRate === 0) {
mortgageFactor = 1 / numberOfPayments;
} else {
mortgageFactor = (monthlyRate * Math.pow(1 + monthlyRate, numberOfPayments)) / (Math.pow(1 + monthlyRate, numberOfPayments) – 1);
}
var monthlyTaxRate = (propertyTaxRate / 100) / 12;
var monthlyInsCost = homeInsurance / 12;
// Equation: MaxAffordablePayment = (Price – DownPayment)*mortgageFactor + Price*monthlyTaxRate + monthlyInsCost
// Rearranging to solve for Price:
// MaxAffordablePayment – monthlyInsCost + (DownPayment * mortgageFactor) = Price * (mortgageFactor + monthlyTaxRate)
var numerator = maxAffordablePayment – monthlyInsCost + (downPayment * mortgageFactor);
var denominator = mortgageFactor + monthlyTaxRate;
var affordablePrice = numerator / denominator;
// Edge case: If result is less than down payment or negative
if (affordablePrice < downPayment) {
// If you can't afford a mortgage, but you have cash, theoretically you can afford the Down Payment amount (if purchased outright),
// but here we are calculating mortgage affordability. Let's floor at Down Payment if calculation fails, or 0.
affordablePrice = downPayment;
}
// Calculate breakdown based on this price
var loanAmount = affordablePrice – downPayment;
if (loanAmount < 0) loanAmount = 0;
var monthlyPI = loanAmount * mortgageFactor;
var monthlyTax = affordablePrice * monthlyTaxRate;
var totalMonthlyCheck = monthlyPI + monthlyTax + monthlyInsCost;
// 4. Update UI
displayResults(affordablePrice, monthlyPI, monthlyTax + monthlyInsCost, totalMonthlyCheck);
}
function displayResults(price, pi, taxIns, total) {
// Formatting function
var formatter = new Intl.NumberFormat('en-US', {
style: 'currency',
currency: 'USD',
maximumFractionDigits: 0
});
document.getElementById('resultBox').style.display = 'block';
document.getElementById('affordablePrice').innerHTML = formatter.format(price);
document.getElementById('monthlyPI').innerHTML = formatter.format(pi);
document.getElementById('monthlyTaxIns').innerHTML = formatter.format(taxIns);
document.getElementById('totalMonthly').innerHTML = formatter.format(total);
}
Understanding Home Affordability
Buying a home is one of the most significant financial decisions you will make. Determining "how much house can I afford" requires more than just looking at the listing price; it involves a careful analysis of your income, existing debts, and the ongoing costs of homeownership. This calculator uses the standard 28/36 rule used by financial lenders to provide a realistic estimate of your purchasing power.
The 28/36 Qualification Rule
Most mortgage lenders use the 28/36 rule to determine how much money they are willing to lend you. This rule consists of two parts:
Front-End Ratio (28%): Your estimated monthly housing costs (principal, interest, property taxes, and insurance) should not exceed 28% of your gross monthly income.
Back-End Ratio (36%): Your total monthly debt payments (including the new mortgage, car loans, student loans, and credit card minimums) should not exceed 36% of your gross monthly income.
Our calculator checks both ratios and uses the lower limit to ensure you don't overextend yourself financially.
Key Factors Impacting Affordability
Several variables influence your buying power:
Down Payment: A larger down payment reduces the loan amount and your monthly payments, significantly increasing the price of the home you can afford.
Interest Rate: Even a small difference in interest rates can drastically change your monthly payment. Lower rates increase your purchasing power.
Debt Load: High existing monthly debts reduce the amount of income available for a mortgage, lowering your back-end ratio and total affordability.
Property Taxes & Insurance: These "hidden" costs are part of your monthly payment. Areas with high property taxes will reduce the maximum loan amount you can qualify for.
Why Use an Affordability Calculator?
Before you start attending open houses, it is crucial to have a clear budget. Using an affordability calculator helps you set realistic expectations, streamlines your home search to properties within your budget, and prepares you for the pre-approval process with a lender. Remember to also budget for closing costs, moving expenses, and an emergency fund for home repairs.