Use this calculator to estimate how much house you can afford based on your income, debts, and down payment.
Understanding Mortgage Affordability
Determining how much house you can afford is a crucial step in the home-buying process. This calculator provides an estimate based on common lending guidelines and your financial inputs.
Key Factors Explained:
Annual Gross Income: This is your total income before taxes and other deductions. Lenders use this as a primary indicator of your ability to repay a loan.
Total Monthly Debt Payments: This includes all your existing monthly financial obligations, such as car loans, student loans, and credit card minimum payments. These debts reduce the amount of income available for a mortgage.
Down Payment: The upfront amount you pay towards the purchase price of the home. A larger down payment reduces the loan amount needed and can lead to better loan terms.
Estimated Mortgage Interest Rate: The annual interest rate you expect to pay on your mortgage. Higher interest rates increase your monthly payments.
Mortgage Loan Term: The duration of the loan, typically 15 or 30 years. Longer terms result in lower monthly payments but more interest paid over time.
How the Calculator Works (General Principles):
Lenders typically use debt-to-income ratios (DTI) to assess affordability. A common guideline is that your total housing expenses (including principal, interest, property taxes, homeowner's insurance, and potentially HOA fees) should not exceed 28% of your gross monthly income (Front-End DTI). Additionally, your total debt (housing plus all other debts) should not exceed 36% of your gross monthly income (Back-End DTI). This calculator estimates a maximum affordable home price by working backward from these principles, considering your down payment and estimating a maximum P&I (Principal and Interest) payment you could qualify for.
Disclaimer: This calculator is for estimation purposes only and does not constitute financial advice or a loan approval. Actual affordability will depend on lender-specific criteria, credit score, market conditions, and other factors.
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");
resultDiv.innerHTML = ""; // Clear previous results
// — 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;
}
// — Calculations —
var monthlyIncome = annualIncome / 12;
// Max P&I payment based on 28% Front-End DTI (simplified, excluding taxes/insurance for estimation)
var maxHousingPayment = monthlyIncome * 0.28;
// Max total debt payment based on 36% Back-End DTI
var maxTotalDebt = monthlyIncome * 0.36;
// Remaining debt capacity for mortgage P&I
var maxMortgagePI = maxTotalDebt – monthlyDebt;
// Use the more conservative (lower) of the two calculated max P&I payments
var maxMonthlyPI = Math.min(maxHousingPayment, maxMortgagePI);
if (maxMonthlyPI <= 0) {
resultDiv.innerHTML = "Based on your income and existing debts, the estimated affordable mortgage payment is $0.00. You may need to reduce debt or increase income.";
return;
}
// Mortgage P&I calculation formula: M = P [ i(1 + i)^n ] / [ (1 + i)^n – 1]
// Where: M = Monthly Payment, P = Principal Loan Amount, i = monthly interest rate, n = number of payments
var monthlyInterestRate = (interestRate / 100) / 12;
var numberOfPayments = loanTerm * 12;
// To find P (Principal Loan Amount), we rearrange the formula:
// P = M [ (1 + i)^n – 1] / [ i(1 + i)^n ]
var principalLoanAmount = maxMonthlyPI * (Math.pow(1 + monthlyInterestRate, numberOfPayments) – 1) / (monthlyInterestRate * Math.pow(1 + monthlyInterestRate, numberOfPayments));
// Maximum affordable home price = Loan Amount + Down Payment
var affordableHomePrice = principalLoanAmount + downPayment;
// — Formatting Results —
var formattedAffordableHomePrice = affordableHomePrice.toLocaleString('en-US', { style: 'currency', currency: 'USD' });
var formattedMaxMonthlyPI = maxMonthlyPI.toLocaleString('en-US', { style: 'currency', currency: 'USD' });
var formattedPrincipalLoanAmount = principalLoanAmount.toLocaleString('en-US', { style: 'currency', currency: 'USD' });
resultDiv.innerHTML = `
Estimated Affordability:
Maximum Affordable Home Price: ${formattedAffordableHomePrice}
Estimated Maximum Monthly Principal & Interest Payment: ${formattedMaxMonthlyPI}
Estimated Maximum Loan Amount: ${formattedPrincipalLoanAmount}
Note: This estimation excludes property taxes, homeowner's insurance, and potential HOA fees. These will increase your actual total monthly housing cost.