Determining "how much house can I afford?" is the critical first step in the home buying journey. This Mortgage Affordability Calculator uses the standard debt-to-income (DTI) qualification ratios used by lenders to estimate your purchasing power. By analyzing your income, current debts, and down payment savings, we can project a realistic price range that keeps you financially secure.
How Is Affordability Calculated?
Lenders primarily use two metrics, known as the "28/36 Rule," to decide how much they are willing to lend you:
The Front-End Ratio (28%): This rule states that your monthly housing costs (principal, interest, property taxes, and homeowners insurance) should not exceed 28% of your gross monthly income.
The Back-End Ratio (36%): This rule states that your total monthly debt payments (housing costs plus student loans, car payments, credit cards, etc.) should not exceed 36% of your gross monthly income.
Our calculator checks both limits and uses the lower of the two to determine your maximum allowable monthly mortgage payment, ensuring a conservative and safe estimate.
Factors Impacting Your Buying Power
Several variables can significantly shift your affordability:
Interest Rates: Even a 1% increase in rates can reduce your buying power by tens of thousands of dollars because more of your monthly payment goes toward interest rather than the principal loan balance.
Down Payment: A larger down payment not only reduces the loan amount but may also eliminate the need for Private Mortgage Insurance (PMI), freeing up monthly cash flow for a more expensive home.
Existing Debt: Reducing monthly obligations like car loans or credit card minimums lowers your back-end DTI ratio, directly increasing the amount a bank is willing to lend you for a mortgage.
Why Include Taxes and Insurance?
Many first-time buyers focus solely on the mortgage principal and interest. However, property taxes and homeowners insurance (often bundled into escrow) can account for 20-30% of your total monthly housing expense. This tool deducts these estimated costs from your maximum allowable payment to show you the true loan amount you can support.
function calculateMortgageAffordability() {
// 1. Get Input Values
var annualIncome = parseFloat(document.getElementById('ma_income').value);
var downPayment = parseFloat(document.getElementById('ma_down_payment').value);
var monthlyDebts = parseFloat(document.getElementById('ma_debts').value);
var interestRate = parseFloat(document.getElementById('ma_interest').value);
var years = parseFloat(document.getElementById('ma_term').value);
var taxAndIns = parseFloat(document.getElementById('ma_tax_ins').value);
// 2. Validate Inputs
if (isNaN(annualIncome) || annualIncome <= 0) {
alert("Please enter a valid annual income.");
return;
}
if (isNaN(downPayment)) downPayment = 0;
if (isNaN(monthlyDebts)) monthlyDebts = 0;
if (isNaN(interestRate) || interestRate <= 0) {
alert("Please enter a valid interest rate.");
return;
}
if (isNaN(years) || years <= 0) {
alert("Please enter a valid loan term.");
return;
}
if (isNaN(taxAndIns)) taxAndIns = 0;
// 3. Calculate Monthly Gross Income
var monthlyGross = annualIncome / 12;
// 4. Apply 28/36 Rules
// Front-end limit: Max housing payment allowed based on income alone
var maxHousingFront = monthlyGross * 0.28;
// Back-end limit: Max total debt allowed minus current non-housing debts
var maxTotalBack = monthlyGross * 0.36;
var maxHousingBack = maxTotalBack – monthlyDebts;
// The allowable housing payment is the lesser of the two
var maxAllowablePayment = Math.min(maxHousingFront, maxHousingBack);
// 5. Calculate Principal & Interest (P&I) Capacity
// We must subtract tax/insurance from the total allowable payment to see what's left for the loan
var maxPIPayment = maxAllowablePayment – taxAndIns;
// Handle case where debts are too high
if (maxPIPayment <= 0) {
document.getElementById('ma_result_display').style.display = 'block';
document.getElementById('ma_max_home_price').innerHTML = "$0";
document.getElementById('ma_monthly_payment').innerHTML = "$0";
document.getElementById('ma_loan_amount').innerHTML = "$0";
document.getElementById('ma_dti_ratio').innerHTML = "N/A (Debts too high)";
return;
}
// 6. Calculate Max Loan Amount using Annuity Formula
// P = (M * (1 – (1 + r)^-n)) / r
var monthlyRate = (interestRate / 100) / 12;
var numberOfPayments = years * 12;
// Formula: Loan Amount = Payment * [ (1 – (1+r)^-n) / r ]
var maxLoanAmount = maxPIPayment * ( (1 – Math.pow(1 + monthlyRate, -numberOfPayments)) / monthlyRate );
// 7. Calculate Results
var maxHomePrice = maxLoanAmount + downPayment;
var totalMonthlyPayment = maxPIPayment + taxAndIns; // This should equal maxAllowablePayment roughly
// Calculate actual DTI based on this result
var actualTotalDebt = totalMonthlyPayment + monthlyDebts;
var actualDTI = (actualTotalDebt / monthlyGross) * 100;
// 8. Format and Display
var formatter = new Intl.NumberFormat('en-US', {
style: 'currency',
currency: 'USD',
maximumFractionDigits: 0
});
document.getElementById('ma_max_home_price').innerHTML = formatter.format(maxHomePrice);
document.getElementById('ma_monthly_payment').innerHTML = formatter.format(totalMonthlyPayment);
document.getElementById('ma_loan_amount').innerHTML = formatter.format(maxLoanAmount);
document.getElementById('ma_dti_ratio').innerHTML = actualDTI.toFixed(1) + "%";
document.getElementById('ma_result_display').style.display = 'block';
}