Calculate your estimated maximum mortgage loan amount based on your income and debts.
Your Estimated Maximum Mortgage Amount: $0
Enter your details above to see your estimated affordability.
Understanding Your Mortgage Affordability
Determining how much mortgage you can afford is a crucial step in the home-buying process. This calculator helps estimate the maximum loan amount you might qualify for, considering your income, existing financial obligations, and the potential terms of the mortgage.
Key Factors Considered:
Gross Monthly Income: This is your income before taxes and other deductions. Lenders use this as a primary indicator of your ability to repay a loan.
Existing Monthly Debt Payments: This includes payments for credit cards, auto loans, student loans, personal loans, and any other recurring debts. Lenders look at your total debt-to-income ratio (DTI).
Down Payment: The upfront cash you pay towards the home purchase. A larger down payment reduces the loan amount needed and can improve your chances of approval and potentially secure better terms.
Interest Rate: The annual rate charged by the lender for borrowing money. Higher interest rates mean higher monthly payments for the same loan amount.
Loan Term: The number of years you have to repay the mortgage. Shorter terms typically have higher monthly payments but result in less interest paid over time.
How the Calculation Works:
This calculator provides an estimate based on common lending guidelines and a standard mortgage payment formula. A typical guideline is that your total housing payment (including principal, interest, property taxes, and homeowner's insurance – often called PITI) should not exceed 28-36% of your gross monthly income. Also, your total debt payments (including PITI) should not exceed 43-50% of your gross monthly income.
For simplicity, this calculator focuses on the loan amount you can afford if your monthly principal and interest (P&I) payment, plus your existing debts, fits within lender DTI guidelines. It then uses the mortgage payment formula to work backward from an assumed maximum monthly P&I payment to find the loan principal:
The standard mortgage payment formula is:
$M = P \frac{r(1+r)^n}{(1+r)^n – 1}$
Where:
$M$ = Monthly P&I Payment
$P$ = Principal Loan Amount (what we're solving for)
$n$ = Total number of payments (Loan Term in Years * 12)
To estimate the maximum loan principal ($P$), we rearrange the formula and estimate a maximum P&I payment based on your income and existing debts. This calculator uses a simplified approach to estimate this maximum P&I based on your disposable income after existing debts and a portion of your income allocated for housing.
Please Note: This calculator provides an estimate only. Actual loan approval amounts depend on many factors, including your credit score, lender-specific policies, property taxes, homeowner's insurance, PMI (Private Mortgage Insurance) if applicable, and local market conditions.
function calculateAffordability() {
var monthlyIncome = parseFloat(document.getElementById("monthlyIncome").value);
var existingDebts = parseFloat(document.getElementById("existingDebts").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");
// — Input Validation —
if (isNaN(monthlyIncome) || monthlyIncome <= 0) {
resultDiv.innerHTML = "Invalid Input: Please enter a valid monthly income.";
return;
}
if (isNaN(existingDebts) || existingDebts < 0) {
resultDiv.innerHTML = "Invalid Input: Please enter a valid monthly debt payment.";
return;
}
if (isNaN(downPayment) || downPayment < 0) {
resultDiv.innerHTML = "Invalid Input: Please enter a valid down payment.";
return;
}
if (isNaN(interestRate) || interestRate 20) {
resultDiv.innerHTML = "Invalid Input: Please enter a valid interest rate between 1% and 20%.";
return;
}
if (isNaN(loanTerm) || loanTerm 50) {
resultDiv.innerHTML = "Invalid Input: Please enter a valid loan term between 1 and 50 years.";
return;
}
// — Calculation Logic —
// A common guideline is that total housing costs (PITI) should be ~28-36% of gross monthly income.
// And total debt obligations (PITI + existing debts) should be ~43-50% of gross monthly income.
// Let's use a conservative DTI for total obligations: 43% of gross monthly income.
var maxTotalDebtPayment = monthlyIncome * 0.43;
// The maximum P&I payment is the maximum total debt payment minus existing debts.
var maxPIPayment = maxTotalDebtPayment – existingDebts;
// Ensure maxPIPayment is not negative (meaning existing debts are too high for this income level).
if (maxPIPayment 0 && monthlyInterestRate > 0 && numberOfMonths > 0) {
// Formula to calculate Principal Loan Amount (P) from Monthly Payment (M):
// P = M * [ (1+r)^n – 1 ] / [ r(1+r)^n ]
var numerator = Math.pow(1 + monthlyInterestRate, numberOfMonths) – 1;
var denominator = monthlyInterestRate * Math.pow(1 + monthlyInterestRate, numberOfMonths);
loanAmount = maxPIPayment * (numerator / denominator);
}
// The total estimated affordable home price is the loan amount plus the down payment.
// However, the calculator is asking "what can i afford MORTGAGE", which implies the LOAN AMOUNT.
// We will display the estimated maximum mortgage amount.
// Format the loan amount to two decimal places
var formattedLoanAmount = loanAmount.toFixed(2);
// Update the result display
resultDiv.innerHTML = "Your Estimated Maximum Mortgage Amount: $" + formattedLoanAmount.replace(/\B(?=(\d{3})+(?!\d))/g, ",") +
"This is an estimate. Your actual affordability may vary.";
}