Determine how much house you can realistically afford based on your income and debt.
(Car loans, student loans, credit cards, etc.)
30 Years
20 Years
15 Years
10 Years
Estimated Maximum Home Price:
$0
Maximum Loan Amount:
$0
Est. Monthly Payment (PITI):
$0
Based on a conservative 43% back-end Debt-to-Income (DTI) ratio.
function calculateAffordability() {
// 1. Get Inputs and validate
var annualIncome = parseFloat(document.getElementById("annualIncome").value);
var monthlyDebt = parseFloat(document.getElementById("monthlyDebt").value);
var downPayment = parseFloat(document.getElementById("downPaymentAvail").value);
var taxInsuranceYr = parseFloat(document.getElementById("estTaxInsurance").value);
var years = parseInt(document.getElementById("loanTermYears").value);
var rateStr = document.getElementById("interestRateAfford").value;
var annualRate = parseFloat(rateStr);
if (isNaN(annualIncome) || annualIncome <= 0 || isNaN(monthlyDebt) || monthlyDebt < 0 || isNaN(downPayment) || downPayment < 0 || isNaN(taxInsuranceYr) || taxInsuranceYr < 0 || isNaN(years) || isNaN(annualRate) || annualRate < 0 || rateStr === "") {
alert("Please enter valid numbers for all fields.");
return;
}
// 2. Define DTI limit (Back-end ratio)
// Lenders typically prefer total debt payments to be under 43% of gross income.
var dtiLimit = 0.43;
// 3. Calculate Monthly Gross Income
var monthlyGrossIncome = annualIncome / 12;
// 4. Calculate Max Allowed Total Monthly Debt Payment
var maxTotalMonthlyDebt = monthlyGrossIncome * dtiLimit;
// 5. Calculate Max Available for Housing (PITI)
// This is the total allowed debt minus existing non-housing debts.
var maxAllowedPITI = maxTotalMonthlyDebt – monthlyDebt;
if (maxAllowedPITI <= 0) {
document.getElementById("maxHomePriceOutput").innerHTML = "$0";
document.getElementById("maxLoanOutput").innerHTML = "$0";
document.getElementById("monthlyPaymentOutput").innerHTML = "N/A – Existing debt is too high";
document.getElementById("affordabilityResult").style.display = "block";
return;
}
// 6. Calculate Monthly Taxes and Insurance component
var monthlyTaxIns = taxInsuranceYr / 12;
// 7. Calculate Max Available for Principal & Interest (P&I)
var availableForPI = maxAllowedPITI – monthlyTaxIns;
if (availableForPI <= 0) {
document.getElementById("maxHomePriceOutput").innerHTML = "$0 (Taxes/Insurance exceed limit)";
document.getElementById("maxLoanOutput").innerHTML = "$0";
document.getElementById("monthlyPaymentOutput").innerHTML = "$" + maxAllowedPITI.toFixed(2) + " (Max PITI)";
document.getElementById("affordabilityResult").style.display = "block";
return;
}
// 8. Calculate Maximum Loan Amount based on Available P&I
// We rearrange the standard mortgage formula to solve for Principal (P).
// P = M * ( ((1+r)^n)-1 ) / ( r*(1+r)^n )
var monthlyRate = (annualRate / 100) / 12;
var totalPayments = years * 12;
var maxLoanAmount = 0;
if (monthlyRate === 0) {
maxLoanAmount = availableForPI * totalPayments;
} else {
// The complex math part to determine principal from payment capacity
var compoundFactor = Math.pow(1 + monthlyRate, totalPayments);
maxLoanAmount = availableForPI * ((compoundFactor – 1) / (monthlyRate * compoundFactor));
}
// 9. Calculate Max Home Price
var maxHomePrice = maxLoanAmount + downPayment;
// 10. Format and Display Results
var formatter = new Intl.NumberFormat('en-US', {
style: 'currency',
currency: 'USD',
minimumFractionDigits: 0,
maximumFractionDigits: 0,
});
var formatterDec = new Intl.NumberFormat('en-US', {
style: 'currency',
currency: 'USD',
minimumFractionDigits: 2,
maximumFractionDigits: 2,
});
document.getElementById("maxHomePriceOutput").innerHTML = formatter.format(maxHomePrice);
document.getElementById("maxLoanOutput").innerHTML = formatter.format(maxLoanAmount);
// The monthly payment they can afford is the max PITI calculated earlier
document.getElementById("monthlyPaymentOutput").innerHTML = formatterDec.format(maxAllowedPITI);
document.getElementById("affordabilityResult").style.display = "block";
}
Understanding Home Affordability
Determining how much house you can afford is the crucial first step in the homebuying process. It goes beyond just checking current interest rates or having a down payment saved; lenders look closely at your ability to repay the loan alongside your existing financial obligations.
The Role of Debt-to-Income (DTI) Ratio
The most significant factor lenders use to determine affordability is your Debt-to-Income (DTI) ratio. This is a percentage that compares your total monthly gross income to your total monthly debt payments. This calculator uses a standard "back-end" DTI limit of 43%.
Gross Income: Your income before taxes and deductions.
Total Debt: This includes your proposed new mortgage payment (Principal, Interest, Taxes, and Insurance – PITI) plus existing debts like car payments, student loans, and minimum credit card payments.
If your existing debts are high, it significantly reduces the amount of income left over to qualify for a mortgage payment.
How This Calculator Works
This tool works backward from your financial limits to find the home price. Here is the process:
It calculates 43% of your monthly gross income to find the maximum total debt payment allowed.
It subtracts your current monthly debts from that total. The remaining amount is the maximum you can allocate toward a new home's PITI (Principal, Interest, Taxes, Insurance).
It subtracts estimated monthly taxes and insurance costs to find the exact amount available for the actual loan repayment (Principal & Interest).
Using your specified interest rate and loan term, it calculates how large a loan that monthly payment can support.
Finally, it adds your available down payment to that loan amount to give you the estimated maximum home price.
Important Note: This calculator provides an estimate based on standard lender guidelines. Actual qualification depends on credit scores, loan types (FHA, VA, Conventional), and specific lender requirements. Always consult with a qualified mortgage professional for a pre-approval.