This calculator helps you estimate how much you can borrow for a mortgage based on your income, debts, and desired loan term.
Understanding Mortgage Affordability
Determining how much you can afford to borrow for a mortgage is a crucial step in the home-buying process. Several factors influence this, and lenders use various metrics to assess your borrowing capacity. This calculator provides an estimate based on common affordability guidelines.
Key Factors in Mortgage Affordability:
Gross Monthly Income: This is your total income before taxes and other deductions. Lenders will look at this figure to gauge your ability to repay a loan.
Current Monthly Debt Payments: This includes all recurring debts like car loans, student loans, credit card minimum payments, and personal loans. These commitments reduce the amount of income available for a mortgage payment.
Down Payment: The larger your down payment, the less you need to borrow, which can increase your affordability and potentially secure better loan terms.
Interest Rate: A higher interest rate means higher monthly payments for the same loan amount, thus reducing how much you can borrow.
Loan Term: A longer loan term (e.g., 30 years vs. 15 years) results in lower monthly payments, which can make a larger loan amount seem affordable, although you'll pay more interest over time.
How the Calculator Works:
This calculator uses a common guideline where your total debt-to-income ratio (DTI) should ideally not exceed 43%. It first calculates your maximum allowable monthly mortgage payment by subtracting your current monthly debts and a buffer for other expenses from your gross monthly income. Then, it uses this maximum payment, along with the interest rate and loan term, to estimate the maximum loan amount you could qualify for. This is a simplified model, and actual lender approvals may vary.
Example:
Let's consider Sarah, who has a gross monthly income of $7,000. Her current monthly debt payments for her car and student loans total $800. She has saved a $50,000 down payment. She's looking at a mortgage with an estimated interest rate of 6% over 30 years.
Gross Monthly Income: $7,000
Current Monthly Debts: $800
Down Payment: $50,000
Interest Rate: 6%
Loan Term: 30 years
Based on these figures, Sarah can use the calculator to estimate her potential mortgage borrowing capacity.
function calculateMortgageAffordability() {
var grossMonthlyIncome = parseFloat(document.getElementById("grossMonthlyIncome").value);
var currentMonthlyDebts = parseFloat(document.getElementById("currentMonthlyDebts").value);
var downPayment = parseFloat(document.getElementById("downPayment").value);
var interestRate = parseFloat(document.getElementById("interestRate").value);
var loanTermYears = parseFloat(document.getElementById("loanTermYears").value);
var resultDiv = document.getElementById("mortgageResult");
resultDiv.innerHTML = ""; // Clear previous results
// Input validation
if (isNaN(grossMonthlyIncome) || grossMonthlyIncome <= 0 ||
isNaN(currentMonthlyDebts) || currentMonthlyDebts < 0 ||
isNaN(downPayment) || downPayment < 0 ||
isNaN(interestRate) || interestRate <= 0 ||
isNaN(loanTermYears) || loanTermYears <= 0) {
resultDiv.innerHTML = "Please enter valid positive numbers for all fields.";
return;
}
// Assuming a maximum DTI of 43% for total debt (including estimated mortgage payment)
// And assuming other expenses (taxes, insurance, PITI – Principal, Interest, Taxes, Insurance) take up a portion.
// A common guideline is that total housing costs (PITI) should not exceed 28% of gross income,
// and total debt (PITI + other debts) should not exceed 36-43%.
// We'll use a simplified approach focusing on total debt, allowing for a reasonable amount for non-housing expenses.
// Let's aim for total debt (current debts + estimated PITI) to be around 36% of gross income.
var maxTotalMonthlyObligations = grossMonthlyIncome * 0.36; // 36% of gross income for all debt
var maxMonthlyMortgagePayment = maxTotalMonthlyObligations – currentMonthlyDebts;
// Ensure maxMonthlyMortgagePayment is not negative
if (maxMonthlyMortgagePayment 0) {
principalLoanAmount = maxMonthlyMortgagePayment * (Math.pow(1 + monthlyInterestRate, numberOfMonths) – 1) / (monthlyInterestRate * Math.pow(1 + monthlyInterestRate, numberOfMonths));
} else { // Handle case for 0% interest rate, though unlikely for mortgages
principalLoanAmount = maxMonthlyMortgagePayment * numberOfMonths;
}
var estimatedMaxHomePrice = principalLoanAmount + downPayment;
// Format currency for display
var formatter = new Intl.NumberFormat('en-US', {
style: 'currency',
currency: 'USD',
minimumFractionDigits: 0,
maximumFractionDigits: 0,
});
var formattedPrincipalLoanAmount = formatter.format(principalLoanAmount);
var formattedMaxHomePrice = formatter.format(estimatedMaxHomePrice);
var formattedMaxMonthlyMortgagePayment = formatter.format(maxMonthlyMortgagePayment);
resultDiv.innerHTML =
"Estimated Maximum Loan Amount: " + formattedPrincipalLoanAmount + "" +
"Estimated Maximum Home Price You Can Afford: " + formattedMaxHomePrice + "" +
"(This estimate assumes your total monthly debt payments, including PITI, do not exceed approximately 36% of your gross monthly income. Actual loan approval depends on lender policies, credit score, and other factors.)";
}
#mortgage-calculator-wp {
font-family: sans-serif;
max-width: 600px;
margin: 20px auto;
padding: 20px;
border: 1px solid #ddd;
border-radius: 8px;
background-color: #f9f9f9;
}
#mortgage-calculator-wp h2 {
text-align: center;
margin-bottom: 20px;
color: #333;
}
.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;
color: #555;
}
.input-group input[type="number"] {
padding: 10px;
border: 1px solid #ccc;
border-radius: 4px;
font-size: 1rem;
}
#mortgage-calculator-wp button {
display: block;
width: 100%;
padding: 12px 20px;
background-color: #007bff;
color: white;
border: none;
border-radius: 4px;
font-size: 1.1rem;
cursor: pointer;
transition: background-color 0.3s ease;
}
#mortgage-calculator-wp button:hover {
background-color: #0056b3;
}
.calculator-result {
margin-top: 20px;
padding: 15px;
background-color: #e9ecef;
border: 1px solid #ced4da;
border-radius: 4px;
text-align: center;
font-size: 1.1rem;
}
.calculator-result p {
margin: 8px 0;
}
article {
margin-top: 30px;
padding-top: 20px;
border-top: 1px solid #eee;
line-height: 1.6;
color: #444;
}
article h3, article h4 {
color: #333;
margin-bottom: 10px;
}
article ul {
margin-left: 20px;
margin-bottom: 15px;
}