Mortgage Affordability Calculator
Use this calculator to estimate how much house you can afford based on your income, debts, and down payment.
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 mortgage principal; it also involves a variety of other costs that contribute to your total monthly housing expense.
Key Factors in Mortgage Affordability:
- Annual Income: Lenders assess your income to determine your ability to repay the loan. A higher income generally allows for a larger loan.
- Monthly Debt Payments: Existing debts like car loans, student loans, and credit card payments are factored into your debt-to-income ratio (DTI). Lenders typically prefer a DTI below 43%.
- Down Payment: A larger down payment reduces the loan amount needed, lowers your loan-to-value (LTV) ratio, and can help you avoid private mortgage insurance (PMI).
- Interest Rate: This is the cost of borrowing money. Even a small difference in interest rates can significantly impact your monthly payment and the total interest paid over the life of the loan.
- Loan Term: The length of the mortgage (e.g., 15, 30 years). Shorter terms have higher monthly payments but less total interest paid. Longer terms have lower monthly payments but more total interest paid.
- Property Taxes: These are annual taxes assessed by local governments based on the value of your property. They are typically paid monthly as part of your mortgage payment (escrow).
- Homeowners Insurance: This covers damage to your home and liability. It's also usually paid monthly through escrow.
- Private Mortgage Insurance (PMI): If your down payment is less than 20% of the home's purchase price, lenders usually require PMI to protect them against default. This is an additional monthly cost.
How the Calculator Works:
This calculator estimates your maximum affordable monthly housing payment by considering lender guidelines, typically that your total housing costs (including PITI – Principal, Interest, Taxes, Insurance, and PMI) should not exceed 28% of your gross monthly income. It then calculates the maximum loan amount you can afford based on that monthly payment, the estimated interest rate, loan term, and additional costs like property taxes, insurance, and PMI.
Example Calculation:
Let's say you have an Annual Income of $90,000. Your Monthly Debt Payments (car loan, credit cards) are $400. You have a Down Payment of $30,000. The estimated Interest Rate is 6%, the Loan Term is 30 years, the Annual Property Tax Rate is 1.5%, Annual Homeowners Insurance is $1,500, and Annual PMI Rate is 0.6% (because your down payment is less than 20%).
- Gross Monthly Income: $90,000 / 12 = $7,500
- Maximum Housing Payment (28% of income): $7,500 * 0.28 = $2,100
- Total Monthly Debt: $400
- Maximum PITI + PMI: $2,100 (This is an estimate, lenders use DTI too)
- Estimated Monthly Property Tax: ($7500 * 1.5%) / 12 = $93.75 (Approx. on initial income based value)
- Estimated Monthly Home Insurance: $1500 / 12 = $125
- Estimated Monthly PMI: (Loan Amount * 0.6%) / 12 — this is iterative. Let's assume initial loan around $300k for estimate: ($300000 * 0.006) / 12 = $150
- Available for Principal & Interest (P&I): $2,100 – $93.75 – $125 – $150 = $1,731.25
- Using a mortgage formula, a monthly P&I payment of $1,731.25 at 6% interest for 30 years supports a loan amount of approximately $290,000.
- Estimated Maximum Home Purchase Price: $290,000 (Loan) + $30,000 (Down Payment) = $320,000
This calculator provides an estimate. Your actual affordability may vary based on lender requirements, credit score, and other financial factors.
.calculator-container {
font-family: sans-serif;
max-width: 800px;
margin: 20px auto;
padding: 20px;
border: 1px solid #ddd;
border-radius: 8px;
background-color: #f9f9f9;
}
.calculator-container h2 {
text-align: center;
color: #333;
margin-bottom: 20px;
}
.calculator-container p {
text-align: center;
color: #555;
margin-bottom: 30px;
}
.calculator-form {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
gap: 15px;
margin-bottom: 30px;
}
.form-group {
display: flex;
flex-direction: column;
}
.form-group label {
margin-bottom: 5px;
font-weight: bold;
color: #444;
}
.form-group input {
padding: 10px;
border: 1px solid #ccc;
border-radius: 4px;
box-sizing: border-box; /* Ensures padding doesn't affect width */
}
.calculator-container button {
grid-column: 1 / -1; /* Span across all columns */
padding: 12px 20px;
background-color: #007bff;
color: white;
border: none;
border-radius: 4px;
cursor: pointer;
font-size: 16px;
transition: background-color 0.3s ease;
}
.calculator-container button:hover {
background-color: #0056b3;
}
.calculator-result {
grid-column: 1 / -1; /* Span across all columns */
margin-top: 20px;
padding: 15px;
border: 1px solid #d4edda;
background-color: #d4edda;
color: #155724;
border-radius: 4px;
text-align: center;
font-size: 1.1em;
font-weight: bold;
}
.calculator-explanation {
margin-top: 30px;
padding-top: 20px;
border-top: 1px solid #eee;
}
.calculator-explanation h3, .calculator-explanation h4 {
color: #333;
margin-bottom: 10px;
}
.calculator-explanation ul {
list-style-type: disc;
margin-left: 20px;
color: #555;
}
.calculator-explanation li {
margin-bottom: 8px;
}
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 propertyTaxRate = parseFloat(document.getElementById("propertyTaxRate").value);
var homeInsurance = parseFloat(document.getElementById("homeInsurance").value);
var pmiRate = parseFloat(document.getElementById("pmiRate").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 ||
isNaN(propertyTaxRate) || propertyTaxRate < 0 ||
isNaN(homeInsurance) || homeInsurance < 0 ||
isNaN(pmiRate) || pmiRate < 0) {
resultDiv.innerHTML = "Please enter valid positive numbers for all fields.";
return;
}
var grossMonthlyIncome = annualIncome / 12;
// Rule of thumb: Housing costs (PITI + PMI) should not exceed 28% of gross monthly income
var maxHousingPayment = grossMonthlyIncome * 0.28;
// Rule of thumb: Total debt (housing + other debts) should not exceed 36% of gross monthly income
// This is a simplified affordability, lenders use DTI more rigorously.
// We will prioritize the 28% rule for housing affordability estimation.
var monthlyInterestRate = (interestRate / 100) / 12;
var numberOfPayments = loanTerm * 12;
// Estimate monthly property tax and insurance
// Property tax estimation can be tricky as it's based on assessed value.
// A common simplification is to use a percentage of income or a hypothetical home value.
// For affordability, it's often based on the *potential* home value.
// Let's use income-based for this example, acknowledging it's a simplification.
// A more accurate calculation would involve estimating home value first.
var estimatedHomeValue = downPayment + (grossMonthlyIncome * 28 * 12 / propertyTaxRate); // Rough inverse based on tax rate, very simplified.
var monthlyPropertyTax = (estimatedHomeValue * (propertyTaxRate / 100)) / 12;
var monthlyHomeInsurance = homeInsurance / 12;
// — Iterative approach for PMI —
// PMI depends on the loan amount, which depends on PMI itself.
// We need to estimate PMI, calculate loan, then refine.
var estimatedLoanAmount = maxHousingPayment * 12; // Start with a rough estimate of total annual housing cost
var estimatedPmiMonthly = 0;
var previousPmiMonthly = -1; // To check for convergence
// Check if PMI is applicable (down payment < 20% of estimated home value)
var isPmiApplicable = (downPayment / (downPayment + estimatedLoanAmount)) 0) {
var maxIterations = 100;
var tolerance = 0.1; // Small difference to consider converged
for (var i = 0; i < maxIterations; i++) {
// Calculate available for P&I
var availableForPI = maxHousingPayment – monthlyPropertyTax – monthlyHomeInsurance – estimatedPmiMonthly;
if (availableForPI 0) {
currentLoanAmount = availableForPI * (1 – Math.pow(1 + monthlyInterestRate, -numberOfPayments)) / monthlyInterestRate;
} else {
// Handle 0 interest rate case
currentLoanAmount = availableForPI * numberOfPayments;
}
// Calculate new PMI based on this loan amount
var newPmiMonthly = (currentLoanAmount * (pmiRate / 100)) / 12;
// Check for convergence or if PMI has become negligible
if (Math.abs(newPmiMonthly – estimatedPmiMonthly) < tolerance || newPmiMonthly < 0.01) {
estimatedPmiMonthly = newPmiMonthly;
maxPmiLoanAmount = currentLoanAmount;
break; // Converged
}
estimatedPmiMonthly = newPmiMonthly;
maxPmiLoanAmount = currentLoanAmount; // Keep track of the latest loan amount
}
} else {
// PMI is not applicable
estimatedPmiMonthly = 0;
var availableForPI = maxHousingPayment – monthlyPropertyTax – monthlyHomeInsurance;
if (availableForPI 0) {
maxPmiLoanAmount = availableForPI * (1 – Math.pow(1 + monthlyInterestRate, -numberOfPayments)) / monthlyInterestRate;
} else {
maxPmiLoanAmount = availableForPI * numberOfPayments;
}
}
}
var affordableHomePrice = downPayment + maxPmiLoanAmount;
// Display results
var formattedAffordableHomePrice = affordableHomePrice.toLocaleString(undefined, { style: 'currency', currency: 'USD' });
var formattedMaxHousingPayment = maxHousingPayment.toLocaleString(undefined, { style: 'currency', currency: 'USD' });
var formattedMonthlyPITI = (maxHousingPayment – estimatedPmiMonthly).toLocaleString(undefined, { style: 'currency', currency: 'USD' });
var formattedMonthlyPMI = estimatedPmiMonthly.toLocaleString(undefined, { style: 'currency', currency: 'USD' });
var formattedMonthlyTax = monthlyPropertyTax.toLocaleString(undefined, { style: 'currency', currency: 'USD' });
var formattedMonthlyInsurance = monthlyHomeInsurance.toLocaleString(undefined, { style: 'currency', currency: 'USD' });
resultDiv.innerHTML =
"
Estimated Affordability
" +
"Based on your inputs, your estimated maximum affordable home purchase price is:
" + formattedAffordableHomePrice + "" +
"This is based on a maximum estimated monthly housing payment (PITI + PMI) of:
" + formattedMaxHousingPayment + "" +
"Estimated Monthly Breakdown:" +
"
" +
"- Principal & Interest (P&I): " + formattedMonthlyPITI + "
" +
"- Property Taxes: " + formattedMonthlyTax + "
" +
"- Homeowners Insurance: " + formattedMonthlyInsurance + "
" +
"- PMI (if applicable): " + formattedMonthlyPMI + "
" +
"
" +
"
Disclaimer: This is an estimate. Actual affordability depends on lender's underwriting, credit score, DTI, and other factors.";
}