Use this calculator to estimate how much you can afford to borrow for a mortgage. Understanding your borrowing capacity is a crucial first step in your home-buying journey. This calculator considers your income, existing debts, and desired down payment to provide an estimated maximum mortgage amount.
$
$
$
%
Years
Your Estimated Maximum Mortgage Amount:
Understanding Mortgage Affordability
When you're ready to buy a home, one of the most important questions is, "How much house can I afford?" While lenders will give you a pre-approval amount, understanding the factors that influence your borrowing power can help you plan more effectively. This mortgage affordability calculator is designed to give you a preliminary estimate based on common lending guidelines.
Key Factors:
Gross Monthly Income: This is your income before taxes and other deductions. Lenders typically look at this to gauge your ability to make monthly payments.
Existing Debt Payments: This includes payments for credit cards, car loans, student loans, and any other recurring debts. Lenders want to see that you can handle your current obligations alongside a new mortgage payment.
Down Payment: The amount of cash you pay upfront towards the purchase price. A larger down payment reduces the amount you need to borrow, which can increase your affordability and potentially secure better loan terms.
Interest Rate: The annual rate at which interest is charged on your loan. A lower interest rate means lower monthly payments, allowing you to borrow more for the same monthly payment amount.
Loan Term: The length of time you have to repay the mortgage (e.g., 15, 30 years). Longer loan terms result in lower monthly payments but more interest paid over the life of the loan.
How it Works:
This calculator uses a common lending guideline where your total monthly debt payments (including the estimated new mortgage payment) should not exceed a certain percentage of your gross monthly income, often referred to as the "back-end debt-to-income ratio" (DTI). We'll use an estimated DTI of 36% for this calculation, a commonly cited threshold. The calculator first determines your maximum allowable total monthly debt payment, subtracts your existing debts, and then calculates the maximum mortgage loan amount you could support with the remaining amount at the specified interest rate and loan term.
Example: Let's say your gross monthly income is $6,000. You have $400 in monthly debt payments (car loan, credit cards). You plan to make a $25,000 down payment. The estimated interest rate is 4%, and you're considering a 30-year loan term. Based on a 36% DTI, your maximum total monthly debt payment would be $6,000 * 0.36 = $2,160. Subtracting your existing debts ($400), you have $1,760 available for a mortgage payment. With these inputs, the calculator would estimate your maximum mortgage amount.
function calculateMortgageAffordability() {
var monthlyIncome = parseFloat(document.getElementById("monthlyIncome").value);
var existingDebt = parseFloat(document.getElementById("existingDebt").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("maxMortgage");
var explanationElement = document.getElementById("explanation");
// Clear previous results
resultElement.innerHTML = "";
explanationElement.innerHTML = "";
// Validate inputs
if (isNaN(monthlyIncome) || monthlyIncome <= 0 ||
isNaN(existingDebt) || existingDebt < 0 ||
isNaN(downPayment) || downPayment < 0 ||
isNaN(interestRate) || interestRate <= 0 ||
isNaN(loanTerm) || loanTerm <= 0) {
explanationElement.innerHTML = "Please enter valid positive numbers for all fields.";
return;
}
// Lender guidelines: Max DTI is often around 36% for housing + other debts
// Let's assume total debt payments (PITI + other debts) should not exceed 36% of gross monthly income.
// PITI = Principal, Interest, Taxes, Insurance.
// For simplicity, this calculator estimates the loan amount based on P&I, assuming taxes/insurance are part of the total housing payment.
// A more complex calculator would ask for property tax and homeowner's insurance estimates.
// Here, we'll use a simplified approach focusing on the debt-to-income ratio for principal and interest.
var maxTotalDebtPayment = monthlyIncome * 0.36; // Using 36% DTI as a common benchmark
var maxMortgagePayment = maxTotalDebtPayment – existingDebt;
if (maxMortgagePayment 0 && numberOfPayments > 0) {
// Rearranging the formula to solve for P:
// P = M [ (1 + i)^n – 1] / [ i(1 + i)^n ]
var numerator = Math.pow(1 + monthlyInterestRate, numberOfPayments) – 1;
var denominator = monthlyInterestRate * Math.pow(1 + monthlyInterestRate, numberOfPayments);
maxMortgageAmount = maxMortgagePayment * (numerator / denominator);
} else if (monthlyInterestRate === 0 && numberOfPayments > 0) {
// Special case for 0% interest (unlikely but for completeness)
maxMortgageAmount = maxMortgagePayment * numberOfPayments;
}
// The 'maxMortgageAmount' calculated is the maximum loan principal.
// The down payment is separate and not directly used in the DTI calculation of loan amount.
// However, it's crucial for total home purchase affordability.
resultElement.innerHTML = "$" + maxMortgageAmount.toFixed(2);
explanationElement.innerHTML = "This is an estimated maximum loan amount you could potentially borrow based on a 36% debt-to-income ratio, your income, existing debts, and the specified interest rate and loan term. Remember, this does not include property taxes, homeowner's insurance, or PMI, which will increase your total monthly housing payment.";
}
.calculator-container {
font-family: sans-serif;
max-width: 700px;
margin: 20px auto;
padding: 20px;
border: 1px solid #ccc;
border-radius: 8px;
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.calculator-container h2 {
text-align: center;
margin-bottom: 20px;
color: #333;
}
.input-section {
margin-bottom: 15px;
display: flex;
align-items: center;
}
.input-section label {
display: inline-block;
width: 200px;
margin-right: 10px;
font-weight: bold;
color: #555;
}
.input-section input[type="number"] {
padding: 8px;
border: 1px solid #ccc;
border-radius: 4px;
width: 150px;
box-sizing: border-box;
}
.input-section span {
margin-left: 5px;
font-weight: bold;
}
button {
display: block;
width: 100%;
padding: 10px 15px;
background-color: #007bff;
color: white;
border: none;
border-radius: 5px;
font-size: 16px;
cursor: pointer;
margin-top: 20px;
transition: background-color 0.3s ease;
}
button:hover {
background-color: #0056b3;
}
#result {
margin-top: 25px;
padding: 15px;
border: 1px dashed #007bff;
border-radius: 5px;
background-color: #e7f3ff;
}
#result h3 {
margin-top: 0;
color: #0056b3;
}
#maxMortgage {
font-size: 1.5em;
font-weight: bold;
color: #28a745;
}
.article-content {
margin-top: 30px;
border-top: 1px solid #eee;
padding-top: 20px;
}
.article-content h3, .article-content h4 {
color: #333;
}
.article-content ul {
padding-left: 20px;
}
.article-content li {
margin-bottom: 8px;
}