Calculate your purchasing power based on income, debt, and interest rates.
Your total income before taxes
Car loans, student loans, credit cards (min payment)
30 Years
15 Years
20 Years
Property tax, HOA, and home insurance
You Can Afford A Home Price Of
$0
With a loan amount of $0
Max Monthly Payment
$0
Debt-to-Income (Front)
28%
Debt-to-Income (Back)
36%
*Calculation uses the standard 28/36 qualifying ratio rule.
function calculateMortgageAffordability() {
// 1. Get Inputs
var incomeInput = document.getElementById("grossAnnualIncome").value;
var debtInput = document.getElementById("monthlyDebt").value;
var downPaymentInput = document.getElementById("downPayment").value;
var rateInput = document.getElementById("interestRate").value;
var termInput = document.getElementById("loanTerm").value;
var taxInsInput = document.getElementById("estTaxIns").value;
// 2. Validate Inputs
if (incomeInput === "" || rateInput === "" || termInput === "") {
alert("Please fill in at least Income, Interest Rate, and Loan Term.");
return;
}
// Convert strings to floats
var annualIncome = parseFloat(incomeInput);
var monthlyDebt = (debtInput === "") ? 0 : parseFloat(debtInput);
var downPayment = (downPaymentInput === "") ? 0 : parseFloat(downPaymentInput);
var interestRate = parseFloat(rateInput);
var years = parseFloat(termInput);
var taxIns = (taxInsInput === "") ? 0 : parseFloat(taxInsInput);
// 3. Logic: 28/36 Rule
var monthlyIncome = annualIncome / 12;
// Front-End Ratio (Housing Expense Ratio): Max 28% of Gross Income
var maxHousingPaymentFront = monthlyIncome * 0.28;
// Back-End Ratio (Total Debt Ratio): Max 36% of Gross Income
var maxTotalDebtPayment = monthlyIncome * 0.36;
var maxHousingPaymentBack = maxTotalDebtPayment – monthlyDebt;
// The bank takes the LOWER of the two
var maxAffordableTotalPayment = Math.min(maxHousingPaymentFront, maxHousingPaymentBack);
// Subtract Taxes and Insurance to find Max P&I (Principal & Interest)
var maxPIPayment = maxAffordableTotalPayment – taxIns;
// Result Variables
var maxLoanAmount = 0;
var maxHomeValue = 0;
var resultContainer = document.getElementById("calc-results");
var homePriceEl = document.getElementById("maxHomePrice");
var loanAmountEl = document.getElementById("maxLoanAmount");
var paymentEl = document.getElementById("maxMonthlyPayment");
// Show results container
resultContainer.style.display = "block";
if (maxPIPayment <= 0) {
// User has too much debt
homePriceEl.innerHTML = "$0";
loanAmountEl.innerHTML = "$0";
paymentEl.innerHTML = "$0";
homePriceEl.style.color = "#e53e3e"; // Red
return;
} else {
homePriceEl.style.color = "#2c3e50"; // Reset color
}
// 4. Calculate Max Loan Amount based on Max P&I
// Formula: P = [r*PV] / [1 – (1+r)^-n]
// Inverse: PV = P * [1 – (1+r)^-n] / r
var monthlyRate = (interestRate / 100) / 12;
var numberOfPayments = years * 12;
if (interestRate === 0) {
maxLoanAmount = maxPIPayment * numberOfPayments;
} else {
maxLoanAmount = maxPIPayment * (1 – Math.pow(1 + monthlyRate, -numberOfPayments)) / monthlyRate;
}
maxHomeValue = maxLoanAmount + downPayment;
// 5. Update UI
homePriceEl.innerHTML = "$" + Math.floor(maxHomeValue).toLocaleString();
loanAmountEl.innerHTML = "$" + Math.floor(maxLoanAmount).toLocaleString();
paymentEl.innerHTML = "$" + Math.floor(maxAffordableTotalPayment).toLocaleString();
// Update DTI Display for visual confirmation
// Front End Actual
var actualFrontDTI = (maxAffordableTotalPayment / monthlyIncome) * 100;
document.getElementById("dtiFront").innerHTML = actualFrontDTI.toFixed(1) + "%";
// Back End Actual
var actualBackDTI = ((maxAffordableTotalPayment + monthlyDebt) / monthlyIncome) * 100;
document.getElementById("dtiBack").innerHTML = actualBackDTI.toFixed(1) + "%";
}
Understanding Your Home Buying Power
Buying a home is likely the largest financial decision you will make in your lifetime. Before you start touring open houses or browsing listings, it is crucial to answer the question: "How much house can I afford?" using a reliable mortgage affordability calculator.
This tool helps you estimate a realistic home price based on your current financial situation, ensuring you don't overextend yourself financially. By analyzing your income, current debts, down payment, and the current interest rate environment, you can determine a budget that keeps your finances healthy.
How the Affordability Calculation Works
Mortgage lenders typically use two key metrics, known as the Debt-to-Income (DTI) ratios, to determine how much money they are willing to lend you. This calculator applies the standard "28/36 Rule" used by most conventional lenders.
1. The Front-End Ratio (28%)
The front-end ratio looks exclusively at your housing costs. Lenders generally prefer that your total monthly housing payment—including principal, interest, property taxes, and homeowners insurance (PITI)—does not exceed 28% of your gross monthly income (income before taxes).
2. The Back-End Ratio (36%)
The back-end ratio provides a broader view of your financial health. It calculates the percentage of your gross monthly income that goes toward all debt obligations. This includes your potential mortgage payment plus credit card payments, student loans, car loans, and alimony. Most lenders want this total to be under 36%.
Key Factors That Impact Your Affordability
Several variables can significantly change the maximum home price you can afford:
Interest Rates: Even a small increase in interest rates can reduce your buying power by tens of thousands of dollars, as more of your monthly payment goes toward interest rather than principal.
Down Payment: A larger down payment reduces the loan amount needed, lowering your monthly payments and potentially allowing you to purchase a more expensive home.
Monthly Debts: Reducing your existing monthly debts (like paying off a car or credit card) lowers your back-end DTI ratio, directly increasing the amount a bank is willing to lend you for a mortgage.
Loan Term: Opting for a 30-year term instead of a 15-year term lowers your monthly payment obligation, which may increase the total loan amount you qualify for, though you will pay more interest over time.
Why Estimated Taxes and Insurance Matter
Many homebuyers focus solely on the mortgage principal and interest, forgetting that property taxes and homeowners insurance are often bundled into the monthly payment. In high-tax areas, these costs can account for a significant portion of your monthly budget, reducing the amount of loan principal you can afford. Always include realistic estimates for these costs to get an accurate calculation.