Use this calculator to estimate the maximum mortgage you can afford. This calculation is a simplified estimate and does not account for all lender-specific criteria or closing costs.
#mortgage-calculator {
font-family: sans-serif;
max-width: 600px;
margin: 20px auto;
padding: 20px;
border: 1px solid #ddd;
border-radius: 8px;
background-color: #f9f9f9;
}
#mortgage-calculator h2 {
text-align: center;
margin-bottom: 20px;
color: #333;
}
.form-group {
margin-bottom: 15px;
}
.form-group label {
display: block;
margin-bottom: 5px;
font-weight: bold;
color: #555;
}
.form-group input[type="number"] {
width: calc(100% – 12px);
padding: 8px;
border: 1px solid #ccc;
border-radius: 4px;
box-sizing: border-box;
}
#mortgage-calculator button {
display: block;
width: 100%;
padding: 10px 15px;
background-color: #007bff;
color: white;
border: none;
border-radius: 4px;
cursor: pointer;
font-size: 16px;
margin-top: 20px;
}
#mortgage-calculator button:hover {
background-color: #0056b3;
}
#result {
margin-top: 20px;
padding: 15px;
background-color: #e9ecef;
border: 1px solid #ced4da;
border-radius: 4px;
text-align: center;
font-size: 1.1em;
color: #333;
}
function calculateMortgageAffordability() {
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
if (isNaN(annualIncome) || isNaN(monthlyDebt) || isNaN(downPayment) || isNaN(interestRate) || isNaN(loanTerm)) {
resultDiv.innerHTML = "Please enter valid numbers for all fields.";
return;
}
// Simplified affordability rules (e.g., front-end and back-end ratios)
// Front-end ratio (PITI / Gross Monthly Income) typically around 28%
// Back-end ratio (PITI + Other Debts / Gross Monthly Income) typically around 36%
// We'll use a combined approach to estimate maximum monthly payment.
var grossMonthlyIncome = annualIncome / 12;
// A common rule of thumb is that your total housing cost (Principal, Interest, Taxes, Insurance – PITI)
// should not exceed 28% of your gross monthly income.
// And your total debt (PITI + other debts) should not exceed 36% of your gross monthly income.
// We'll use the more restrictive 36% back-end ratio for this calculation to estimate max total monthly debt payments.
var maxTotalMonthlyPayments = grossMonthlyIncome * 0.36;
var maxMonthlyMortgagePayment = maxTotalMonthlyPayments – monthlyDebt;
if (maxMonthlyMortgagePayment 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);
principalLoanAmount = maxMonthlyMortgagePayment * (numerator / denominator);
} else if (maxMonthlyMortgagePayment > 0) { // Handle 0% interest rate case
principalLoanAmount = maxMonthlyMortgagePayment * numberOfPayments;
}
var maxPurchasePrice = principalLoanAmount + downPayment;
// Format the output
var formattedMaxPurchasePrice = maxPurchasePrice.toLocaleString(undefined, { style: 'currency', currency: 'USD' });
var formattedMaxMonthlyMortgagePayment = maxMonthlyMortgagePayment.toLocaleString(undefined, { style: 'currency', currency: 'USD' });
var formattedPrincipalLoanAmount = principalLoanAmount.toLocaleString(undefined, { style: 'currency', currency: 'USD' });
resultDiv.innerHTML = "Estimated Maximum Purchase Price: " + formattedMaxPurchasePrice + "" +
"Estimated Maximum Monthly Mortgage Payment (Principal & Interest): " + formattedMaxMonthlyMortgagePayment + "" +
"Estimated Maximum Loan Amount: " + formattedPrincipalLoanAmount + "";
}
Understanding Mortgage Affordability
Determining how much house you can afford is a crucial step in the home-buying process. It's not just about the sticker price of the home; it's about understanding your borrowing capacity and ensuring that your monthly mortgage payments are sustainable within your budget.
Key Factors in Mortgage Affordability
Several factors influence how much a lender is willing to lend you and, consequently, how much house you can afford. This calculator simplifies these into a few key inputs:
Annual Household Income: This is the primary indicator of your ability to repay a loan. Lenders look at your gross income (before taxes) to gauge your capacity.
Total Monthly Debt Payments: Lenders consider your existing financial obligations, such as car loans, student loans, and credit card minimum payments. These are often referred to as "debt-to-income" (DTI) ratios.
Down Payment: The amount of money you pay upfront towards the purchase price. A larger down payment reduces the loan amount needed, which can increase affordability and may help you avoid private mortgage insurance (PMI).
Interest Rate: The annual percentage rate charged on the loan. Even small changes in interest rates can significantly impact your monthly payments and the total interest paid over the life of the loan.
Loan Term: The duration of the mortgage, typically 15 or 30 years. Longer terms mean lower monthly payments but more interest paid overall. Shorter terms result in higher monthly payments but less interest paid.
How Affordability is Calculated (Simplified)
Mortgage affordability is often assessed using debt-to-income (DTI) ratios. A common guideline is the "back-end" DTI, which suggests that your total monthly debt payments (including your potential mortgage payment) should not exceed 36% of your gross monthly income. This calculator uses a similar principle to estimate your maximum affordable monthly mortgage payment and then determines the corresponding loan amount and purchase price.
Example Scenario:
Let's say Sarah and John have a combined annual household income of $90,000. They have existing monthly debt payments (car loan and student loans) totaling $600. They plan to make a down payment of $40,000 on a home. They are pre-approved for a mortgage with an estimated annual interest rate of 6.5% over a 30-year term.
Gross Monthly Income: $90,000 / 12 = $7,500
Maximum Total Monthly Debt (36% of income): $7,500 * 0.36 = $2,700
Maximum Monthly Mortgage Payment (PITI): $2,700 (Max Total Debt) – $600 (Existing Debt) = $2,100
Using these figures, the calculator can estimate the maximum loan amount they can qualify for and the resulting maximum purchase price, considering their down payment.
Important Considerations
This calculator provides an estimate. Your actual mortgage affordability may differ due to:
Taxes and Insurance (PITI): The calculation above focuses on Principal and Interest (P&I). Lenders will also factor in property taxes and homeowner's insurance (PITI) when assessing your total housing cost.
Closing Costs: These are fees associated with finalizing your mortgage and can range from 2% to 5% of the loan amount.
Lender Specifics: Different lenders have varying DTI limits and underwriting criteria.
Credit Score: A higher credit score generally leads to better interest rates, improving affordability.
It's always recommended to speak with a mortgage professional to get a precise understanding of your borrowing power and to discuss all the costs involved in purchasing a home.