Use this calculator to estimate how much home you can realistically afford based on your income, debts, and down payment. Understanding your mortgage affordability is a crucial first step in the home-buying process.
How Mortgage Affordability is Calculated
Mortgage affordability is determined by several key factors. Lenders typically use debt-to-income ratios (DTI) to assess your ability to manage monthly mortgage payments. A common guideline is that your total housing costs (principal, interest, taxes, insurance, and HOA fees – often called PITI) should not exceed 28% of your gross monthly income, and your total debt payments (including PITI) should not exceed 36% of your gross monthly income. However, these are just guidelines, and actual affordability can vary.
This calculator provides an *estimate*. It considers your income, existing debts, and down payment to determine a potential maximum loan amount. It then uses this loan amount, your specified interest rate, and loan term to estimate your maximum affordable home price. Remember to factor in closing costs, moving expenses, and potential home maintenance when budgeting.
Key Factors:
Annual Gross Income: Your total income before taxes.
Monthly Debt Payments: Your existing financial obligations like car loans, student loans, and credit card minimums.
Down Payment: The amount you pay upfront. A larger down payment reduces the loan amount needed.
Interest Rate: The cost of borrowing money. Higher rates mean higher monthly payments.
Loan Term: The duration over which you'll repay the loan (e.g., 15 or 30 years).
This tool simplifies these complex calculations for a quick estimate. For a precise figure, consult with a mortgage lender.
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
if (isNaN(annualIncome) || isNaN(monthlyDebt) || isNaN(downPayment) || isNaN(interestRate) || isNaN(loanTerm)) {
resultDiv.innerHTML = "Please enter valid numbers for all fields.";
return;
}
if (annualIncome <= 0 || monthlyDebt < 0 || downPayment < 0 || interestRate <= 0 || loanTerm <= 0) {
resultDiv.innerHTML = "Please enter positive values for income, interest rate, and loan term. Debt and down payment can be zero but not negative.";
return;
}
// Lender Guidelines (common DTI ratios)
var maxHousingRatio = 0.28; // 28% of gross monthly income for housing (PITI)
var maxTotalDebtRatio = 0.36; // 36% of gross monthly income for all debts (including PITI)
var grossMonthlyIncome = annualIncome / 12;
// Calculate maximum allowed monthly payment for PITI based on total debt ratio
var maxTotalMonthlyPaymentAllowed = grossMonthlyIncome * maxTotalDebtRatio;
// Calculate maximum allowed PITI
var maxPITI = maxTotalMonthlyPaymentAllowed – monthlyDebt;
if (maxPITI 0 && numberOfPayments > 0) {
maxLoanAmount = maxPITI * (Math.pow(1 + monthlyInterestRate, numberOfPayments) – 1) / (monthlyInterestRate * Math.pow(1 + monthlyInterestRate, numberOfPayments));
} else if (monthlyInterestRate === 0 && numberOfPayments > 0) { // Handle 0% interest rate case (rare but possible)
maxLoanAmount = maxPITI * numberOfPayments;
}
var maxHomePrice = maxLoanAmount + downPayment;
// Display results
var formattedMaxLoanAmount = maxLoanAmount.toLocaleString(undefined, { style: 'currency', currency: 'USD' });
var formattedMaxHomePrice = maxHomePrice.toLocaleString(undefined, { style: 'currency', currency: 'USD' });
var formattedMaxPITI = maxPITI.toLocaleString(undefined, { style: 'currency', currency: 'USD' });
var formattedGrossMonthlyIncome = grossMonthlyIncome.toLocaleString(undefined, { style: 'currency', currency: 'USD' });
var formattedMonthlyDebt = monthlyDebt.toLocaleString(undefined, { style: 'currency', currency: 'USD' });
resultDiv.innerHTML = `
Estimated Affordability:
Based on your inputs, your estimated maximum affordable home price is: ${formattedMaxHomePrice}
This includes your down payment of ${downPayment.toLocaleString(undefined, { style: 'currency', currency: 'USD' })} and an estimated maximum loan amount of ${formattedMaxLoanAmount}.
Your estimated maximum monthly housing payment (PITI) is: ${formattedMaxPITI}
Note: This is an estimate. Actual loan approval depends on lender underwriting, credit score, property type, and market conditions.
`;
}
.calculator-wrapper {
font-family: sans-serif;
max-width: 700px;
margin: 20px auto;
padding: 20px;
border: 1px solid #ddd;
border-radius: 8px;
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.calculator-wrapper h2 {
text-align: center;
color: #333;
margin-bottom: 15px;
}
.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"],
.input-group input[type="text"] {
padding: 10px;
border: 1px solid #ccc;
border-radius: 4px;
font-size: 1rem;
}
.calculator-wrapper 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;
margin-bottom: 20px;
}
.calculator-wrapper button:hover {
background-color: #0056b3;
}
.calculator-result {
background-color: #e9f7fe;
padding: 15px;
border: 1px solid #b3d7f7;
border-radius: 4px;
margin-top: 20px;
}
.calculator-result h4 {
margin-top: 0;
color: #0056b3;
}
.calculator-result p {
margin-bottom: 10px;
line-height: 1.6;
}
.calculator-result strong {
color: #007bff;
}
.calculator-explanation {
margin-top: 30px;
padding-top: 20px;
border-top: 1px solid #eee;
font-size: 0.95rem;
color: #444;
}
.calculator-explanation h3 {
color: #333;
margin-bottom: 10px;
}
.calculator-explanation ul {
margin-left: 20px;
padding-left: 0;
list-style: disc;
}
.calculator-explanation li {
margin-bottom: 8px;
}
.calculator-explanation strong {
color: #333;
}