Use this calculator to estimate how much you can afford to borrow for a mortgage based on your income, debts, and down payment.
.calculator-container {
font-family: sans-serif;
max-width: 600px;
margin: 20px auto;
padding: 20px;
border: 1px solid #ccc;
border-radius: 8px;
background-color: #f9f9f9;
}
.calculator-inputs {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
gap: 15px;
margin-bottom: 20px;
}
.input-group {
display: flex;
flex-direction: column;
}
.input-group label {
margin-bottom: 5px;
font-weight: bold;
}
.input-group input {
padding: 10px;
border: 1px solid #ccc;
border-radius: 4px;
box-sizing: border-box;
}
button {
background-color: #4CAF50;
color: white;
padding: 12px 20px;
border: none;
border-radius: 4px;
cursor: pointer;
font-size: 16px;
margin-top: 10px;
}
button:hover {
background-color: #45a049;
}
.calculator-result {
margin-top: 20px;
padding: 15px;
border: 1px solid #d4edda;
background-color: #e2f0e4;
color: #155724;
border-radius: 4px;
}
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 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;
}
// Lender's Debt-to-Income (DTI) ratio guidelines are typically between 36% and 43%.
// We'll use a common guideline of 36% for housing and 43% for total debt.
// Let's assume a maximum housing payment of 28% of gross monthly income.
var maxHousingPaymentPercentage = 0.28;
var maxTotalDebtPercentage = 0.43;
var monthlyIncome = annualIncome / 12;
// Calculate maximum allowed monthly housing payment
var maxHousingPayment = monthlyIncome * maxHousingPaymentPercentage;
// Calculate maximum allowed total monthly debt payments
var maxTotalMonthlyDebt = monthlyIncome * maxTotalDebtPercentage;
// Calculate the maximum monthly mortgage payment we can afford,
// considering existing debts.
var affordableMonthlyMortgagePayment = maxTotalMonthlyDebt – monthlyDebt;
// If the affordable monthly mortgage payment is less than what's needed for housing based on income alone,
// it means existing debts are too high relative to income.
if (affordableMonthlyMortgagePayment < maxHousingPayment && affordableMonthlyMortgagePayment < 0) {
resultDiv.innerHTML = "Based on your income and existing debts, your current debt load may be too high to qualify for a mortgage. Consider reducing existing debts or increasing income.";
return;
}
// Use the lower of the two affordability measures for the mortgage payment
var finalAffordableMonthlyMortgagePayment = Math.min(maxHousingPayment, affordableMonthlyMortgagePayment);
if (finalAffordableMonthlyMortgagePayment 0) {
maxLoanAmount = finalAffordableMonthlyMortgagePayment * (Math.pow(1 + monthlyInterestRate, numberOfPayments) – 1) / (monthlyInterestRate * Math.pow(1 + monthlyInterestRate, numberOfPayments));
} else {
// Handle zero interest rate case (though unlikely for mortgages)
maxLoanAmount = finalAffordableMonthlyMortgagePayment * numberOfPayments;
}
// Calculate estimated maximum home price
var estimatedMaxHomePrice = maxLoanAmount + downPayment;
// Formatting the output
var formattedMaxLoanAmount = maxLoanAmount.toLocaleString('en-US', { style: 'currency', currency: 'USD', minimumFractionDigits: 0, maximumFractionDigits: 0 });
var formattedEstimatedMaxHomePrice = estimatedMaxHomePrice.toLocaleString('en-US', { style: 'currency', currency: 'USD', minimumFractionDigits: 0, maximumFractionDigits: 0 });
var formattedMonthlyMortgagePayment = finalAffordableMonthlyMortgagePayment.toLocaleString('en-US', { style: 'currency', currency: 'USD', minimumFractionDigits: 0, maximumFractionDigits: 0 });
resultDiv.innerHTML =
"Estimated Maximum Mortgage Loan Amount: " + formattedMaxLoanAmount + "" +
"Estimated Maximum Home Price You Can Afford: " + formattedEstimatedMaxHomePrice + "" +
"This estimate is based on a maximum housing payment of approximately " + maxHousingPayment.toLocaleString('en-US', { style: 'currency', currency: 'USD', minimumFractionDigits: 0, maximumFractionDigits: 0 }) + " per month and a total debt-to-income ratio of " + (maxTotalDebtPercentage * 100) + "%. Your estimated affordable monthly mortgage payment is " + formattedMonthlyMortgagePayment + "." +
"Disclaimer: This is an estimate only and does not guarantee loan approval. Actual loan amounts depend on lender-specific underwriting criteria, credit score, property type, and other factors. Consult with a mortgage professional for accurate figures.";
}
Understanding Mortgage Affordability
Deciding to buy a home is a significant financial undertaking, and understanding how much you can afford to borrow is crucial. A mortgage affordability calculator helps you estimate the maximum loan amount you might qualify for, which in turn helps you determine the price range of homes you should be looking at.
Key Factors Influencing Affordability:
Annual Gross Income: This is your total income before taxes. Lenders use this as a primary indicator of your ability to repay a loan.
Total Monthly Debt Payments: This includes all your recurring monthly financial obligations, such as car loans, student loans, credit card minimum payments, and any other installment loans. This is critical for calculating your Debt-to-Income (DTI) ratio.
Down Payment Amount: The sum of money you pay upfront towards the purchase price of the home. A larger down payment reduces the loan amount needed, which can increase your purchasing power and potentially help you avoid Private Mortgage Insurance (PMI) on conventional loans if it's 20% or more.
Estimated Mortgage Interest Rate: This rate significantly impacts your monthly payment. Even a small difference in interest rate can lead to a substantial difference in the total cost of the loan over its lifetime.
Mortgage Loan Term: The number of years you have to repay the loan (e.g., 15, 30 years). Shorter terms usually mean higher monthly payments but less interest paid overall.
How the Calculator Works:
This calculator uses common lending guidelines to estimate your affordability. Lenders typically assess affordability using two main ratios:
Front-End Ratio (Housing Ratio): This compares your potential monthly housing costs (principal, interest, taxes, and insurance – PITI) to your gross monthly income. A common guideline is that PITI should not exceed 28% of your gross monthly income.
Back-End Ratio (Debt-to-Income Ratio – DTI): This compares your total monthly debt payments (including the potential mortgage payment) to your gross monthly income. A common guideline is that total monthly debt should not exceed 36% to 43% of your gross monthly income.
Our calculator first determines the maximum housing payment you can afford based on your income (front-end ratio). It then calculates your maximum total monthly debt based on your income and subtracts your existing monthly debts to find the remaining amount available for a mortgage payment (back-end ratio). The calculator uses the more conservative of these two figures to estimate your affordable monthly mortgage payment. Finally, it uses a mortgage payment formula to work backward and determine the maximum loan amount you can take out based on that monthly payment, interest rate, and loan term. Your estimated maximum home price is then calculated by adding your down payment to this maximum loan amount.
Example Scenario:
Let's say you have an Annual Gross Income of $90,000. Your current Total Monthly Debt Payments (car loan, student loans) amount to $500. You have saved a Down Payment Amount of $50,000. You are looking at a mortgage with an Estimated Mortgage Interest Rate of 6.5% over a Loan Term of 30 years.
Monthly Income: $90,000 / 12 = $7,500
Estimated Max Housing Payment (28% of income): $7,500 * 0.28 = $2,100
Estimated Max Total Debt (43% of income): $7,500 * 0.43 = $3,225
The calculator will use the lower of the two affordable payment limits, which is $2,100 (the housing ratio limit).
Based on a $2,100 monthly payment, 6.5% interest rate, and 30-year term, the maximum loan amount is approximately $331,819.
Estimated Maximum Home Price: $331,819 (loan) + $50,000 (down payment) = $381,819.
This example suggests you might be able to afford a home priced around $381,819, with a mortgage loan of approximately $331,819.
Important Note: Mortgage affordability is complex. This calculator provides a helpful estimate, but it's essential to speak with a mortgage lender or broker. They can provide a pre-approval, which gives you a more precise understanding of what you can borrow and strengthens your position when making an offer on a home.