Includes credit cards, car loans, student loans (excluding rent/existing mortgage)
Your Estimated Max Mortgage
Maximum Loan Amount
$0
Understanding Mortgage Affordability
Determining how much house you can afford is a crucial step in the homebuying process.
This calculator helps estimate your maximum loan amount based on your financial inputs,
primarily using the widely accepted "debt-to-income" (DTI) ratio guidelines.
How the Calculator Works
The calculator estimates your maximum affordable mortgage loan amount by considering:
Your Annual Gross Income: The total amount you earn before taxes.
Your Monthly Debt Payments: This includes existing loan payments (car, student, personal loans) and minimum credit card payments. It *excludes* your current rent or mortgage payment, as that will be replaced by your new housing cost.
Your Down Payment: The cash you have available to put towards the purchase price of the home.
Estimated Interest Rate: The anticipated annual interest rate for your mortgage.
Loan Term: The number of years you plan to repay the mortgage (commonly 15 or 30 years).
The Debt-to-Income (DTI) Ratio
Lenders use the Debt-to-Income (DTI) ratio to assess your ability to manage monthly mortgage payments and repay debts. It's calculated as:
DTI = (Total Monthly Debt Payments + Estimated New Housing Payment) / Gross Monthly Income
Most lenders prefer a DTI of 43% or lower, though some may allow slightly higher depending on other factors like credit score and down payment. This calculator works backward from this guideline to estimate your maximum loan.
Specifically, the calculator aims to find the maximum loan amount such that the total monthly housing cost (principal, interest, taxes, insurance – often simplified here to just P&I plus an estimate) combined with your other monthly debts does not exceed a target percentage (e.g., 36% to 43%) of your gross monthly income.
The Math Behind the Maximum Loan Amount
The core of the calculation involves determining the maximum monthly payment you can afford for P&I (Principal & Interest) and then using the mortgage payment formula in reverse.
1. Calculate Gross Monthly Income (GMI):GMI = Annual Gross Income / 12
2. Calculate Maximum Allowable Monthly Debt Payment:
We use a target DTI, often around 36% for housing-related debt.
Max Monthly Debt = GMI * Target_DTI_Ratio (e.g., 0.36)
3. Calculate Maximum Affordable P&I Payment:Max P&I Payment = Max Monthly Debt - Total Monthly Debt Payments
If this value is negative, it means your existing debts are too high for your income to qualify for a new mortgage.
4. Estimate Maximum Loan Amount (Loan):
This uses the standard mortgage payment formula (M) rearranged to solve for the loan principal (P):
M = P [ i(1 + i)^n ] / [ (1 + i)^n – 1]
Where:
n = Total number of payments = Loan Term (years) * 12
Rearranging for P:
P = M * [ (1 + i)^n – 1] / [ i(1 + i)^n ]
5. Adjust for Down Payment:
The loan amount calculated is the maximum mortgage you can take on. The total home price you might afford would be approximately:
Estimated Home Price = Maximum Loan Amount + Down PaymentNote: This calculator primarily focuses on the maximum loan amount. Actual affordability also depends on property taxes, homeowner's insurance, HOA fees, and lender-specific criteria.
Use Cases
First-Time Homebuyers: Get a realistic idea of borrowing power before house hunting.
Homeowners Considering a Move-Up: Understand how much equity from a current home sale could boost affordability for the next purchase.
Financial Planning: Incorporate potential mortgage costs into long-term financial strategies.
Budgeting: Set realistic expectations for monthly housing expenses.
Disclaimer: This calculator provides an estimation only. It does not constitute financial advice. Consult with a qualified mortgage lender or financial advisor for personalized guidance and accurate pre-approval. Factors like credit score, employment history, property taxes, insurance costs, and lender-specific underwriting guidelines will significantly impact your actual loan approval and terms.
function calculateAffordability() {
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 resultElement = document.getElementById("result");
var resultLabelElement = document.getElementById("result-label");
// Clear previous results
resultElement.textContent = "$0";
resultElement.style.color = "var(–success-green)";
resultLabelElement.textContent = "Maximum Loan Amount";
// — Input Validation —
if (isNaN(annualIncome) || annualIncome <= 0) {
alert("Please enter a valid Annual Gross Income.");
return;
}
if (isNaN(monthlyDebt) || monthlyDebt < 0) {
alert("Please enter a valid Total Monthly Debt Payments.");
return;
}
if (isNaN(downPayment) || downPayment < 0) {
alert("Please enter a valid Down Payment.");
return;
}
if (isNaN(interestRate) || interestRate 20) { // Assuming max reasonable rate is 20%
alert("Please enter a valid Annual Interest Rate (between 0.1% and 20%).");
return;
}
if (isNaN(loanTerm) || loanTerm <= 0) {
alert("Please enter a valid Loan Term (in years).");
return;
}
// — Calculation Logic —
// 1. Calculate Gross Monthly Income (GMI)
var grossMonthlyIncome = annualIncome / 12;
// 2. Determine Maximum Allowable Monthly Housing Payment (P&I)
// We'll target a front-end DTI (often called 'housing ratio') around 28-30%
// And a back-end DTI (total debt) around 36-43%.
// Let's use a common guideline for total debt ratio: 36% of GMI.
var targetTotalDTI = 0.36;
var maxTotalMonthlyPayments = grossMonthlyIncome * targetTotalDTI;
// Max P&I payment is what's left after existing debts
var maxPniPayment = maxTotalMonthlyPayments – monthlyDebt;
// Check if existing debts already exceed the target total DTI
if (maxPniPayment 0) {
// P = M * [ (1 + i)^n – 1] / [ i(1 + i)^n ]
var component1 = Math.pow(1 + monthlyInterestRate, numberOfPayments);
maximumLoanAmount = maxPniPayment * (component1 – 1) / (monthlyInterestRate * component1);
} else {
// If interest rate is 0, loan amount is simply max P&I * number of payments
// This is a theoretical edge case for affordability calculators
maximumLoanAmount = maxPniPayment * numberOfPayments;
}
// — Formatting and Display —
if (maximumLoanAmount > 0) {
resultElement.textContent = "$" + maximumLoanAmount.toLocaleString(undefined, {
minimumFractionDigits: 0,
maximumFractionDigits: 0
});
resultElement.style.color = "var(–success-green)";
resultLabelElement.textContent = "Maximum Loan Amount";
} else {
resultElement.textContent = "$0";
resultElement.style.color = "var(–success-green)";
resultLabelElement.textContent = "Maximum Loan Amount";
}
}
// Optional: Add initial calculation on load if inputs have default values
// calculateAffordability();