Use this calculator to estimate how much house you can afford based on your income, debts, and desired mortgage payment. Understanding your borrowing power is a crucial first step in your home-buying journey.
Understanding Mortgage Affordability
The amount you can afford to borrow for a mortgage depends on several factors. Lenders typically look at your debt-to-income ratio (DTI) and your ability to cover the principal, interest, taxes, and insurance (PITI) for a property.
Key Factors Explained:
Annual Household Income: This is your total gross income from all sources before taxes. Lenders use this to assess your ability to repay the loan.
Total Monthly Debt Payments: This includes minimum payments on credit cards, car loans, student loans, and any other recurring debts, *excluding* your potential new mortgage payment.
Down Payment: The upfront cash you pay towards the purchase of the home. A larger down payment reduces the loan amount needed and can lead to better loan terms.
Estimated Annual Interest Rate: The percentage charged by the lender on the loan amount. Higher interest rates mean higher monthly payments.
Loan Term (Years): The length of time you have to repay the loan, typically 15 or 30 years. Shorter terms have higher monthly payments but less total interest paid.
Estimated Annual Property Taxes: Taxes levied by local governments on the value of your property. These are paid to the lender, who then pays them to the government, usually escrowed with your mortgage payment.
Estimated Annual Homeowners Insurance: Insurance to protect against damage to your home and liability. This is also typically escrowed with your mortgage payment.
How the Calculator Works:
This calculator provides an estimate based on common lending guidelines. It calculates your maximum potential monthly mortgage payment (P&I only) by considering your income and existing debts. It then uses this monthly payment, along with your down payment, interest rate, and loan term, to estimate the maximum loan amount you could qualify for. Finally, it adds your down payment to this loan amount to estimate the maximum home price you might be able to afford.
Disclaimer: This calculator is for estimation purposes only and does not constitute financial advice. Actual loan approval and affordability may vary based on lender-specific criteria, credit score, market conditions, and other factors.
.calculator-container {
font-family: sans-serif;
max-width: 700px;
margin: 20px auto;
padding: 20px;
border: 1px solid #ccc;
border-radius: 8px;
background-color: #f9f9f9;
}
.calculator-container h2 {
text-align: center;
color: #333;
margin-bottom: 20px;
}
.calculator-inputs {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
gap: 15px;
margin-bottom: 20px;
}
.form-group {
display: flex;
flex-direction: column;
}
.form-group label {
margin-bottom: 5px;
font-weight: bold;
color: #555;
}
.form-group input {
padding: 10px;
border: 1px solid #ccc;
border-radius: 4px;
font-size: 1em;
}
.calculator-container button {
display: block;
width: 100%;
padding: 12px 20px;
background-color: #007bff;
color: white;
border: none;
border-radius: 5px;
font-size: 1.1em;
cursor: pointer;
transition: background-color 0.3s ease;
margin-top: 10px;
margin-bottom: 20px;
}
.calculator-container button:hover {
background-color: #0056b3;
}
.calculator-result {
margin-top: 20px;
padding: 15px;
background-color: #e9ecef;
border: 1px solid #ced4da;
border-radius: 5px;
font-size: 1.1em;
text-align: center;
min-height: 50px;
display: flex;
align-items: center;
justify-content: center;
flex-wrap: wrap;
}
.calculator-result span {
font-weight: bold;
color: #28a745;
margin-left: 10px;
}
.calculator-explanation {
margin-top: 30px;
padding: 20px;
border-top: 1px solid #eee;
font-size: 0.95em;
line-height: 1.6;
color: #444;
}
.calculator-explanation h3,
.calculator-explanation h4 {
color: #333;
margin-bottom: 10px;
}
.calculator-explanation ul {
padding-left: 20px;
}
.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 propertyTaxes = parseFloat(document.getElementById("propertyTaxes").value);
var homeInsurance = parseFloat(document.getElementById("homeInsurance").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(propertyTaxes) || propertyTaxes < 0 ||
isNaN(homeInsurance) || homeInsurance < 0) {
resultDiv.innerHTML = "Please enter valid positive numbers for all fields.";
return;
}
// — Affordability Calculations —
// Assume max PITI (Principal, Interest, Taxes, Insurance) is 36% of gross monthly income
// This is a common guideline, but can vary.
var maxPitiPercentage = 0.36;
var monthlyIncome = annualIncome / 12;
var maxPiti = monthlyIncome * maxPitiPercentage;
// Calculate total allowed monthly debt (including PITI)
var maxTotalMonthlyPayments = maxPiti;
// Calculate maximum monthly mortgage payment (P&I)
var maxMonthlyMortgagePayment = maxTotalMonthlyPayments – monthlyDebt;
if (maxMonthlyMortgagePayment < 0) {
resultDiv.innerHTML = "Based on your income and debts, you may not qualify for a mortgage at this time.";
return;
}
// Calculate the maximum loan amount based on the max monthly payment
var monthlyInterestRate = (interestRate / 100) / 12;
var numberOfMonths = loanTerm * 12;
var maxLoanAmount = 0;
if (monthlyInterestRate === 0) {
// Handle zero interest rate case to avoid division by zero
maxLoanAmount = maxMonthlyMortgagePayment * numberOfMonths;
} else {
// Mortgage payment formula: M = P [ i(1 + i)^n ] / [ (1 + i)^n – 1]
// Rearrange to solve for P (Principal/Loan Amount): P = M [ (1 + i)^n – 1] / i(1 + i)^n
maxLoanAmount = maxMonthlyMortgagePayment * (Math.pow(1 + monthlyInterestRate, numberOfMonths) – 1) / (monthlyInterestRate * Math.pow(1 + monthlyInterestRate, numberOfMonths));
}
// Calculate estimated maximum home price
var estimatedMaxHomePrice = maxLoanAmount + downPayment;
// Calculate estimated monthly PITI
var annualTaxesAndInsurance = propertyTaxes + homeInsurance;
var monthlyTaxesAndInsurance = annualTaxesAndInsurance / 12;
var estimatedMonthlyPITI = maxMonthlyMortgagePayment + monthlyTaxesAndInsurance;
// — Display Results —
var affordabilityEstimate = estimatedMaxHomePrice.toFixed(2);
var estimatedLoan = maxLoanAmount.toFixed(2);
var estimatedMonthlyPayment = estimatedMonthlyPITI.toFixed(2);
resultDiv.innerHTML = "Estimated Maximum Home Price: $" + affordabilityEstimate + "" +
"Estimated Maximum Loan Amount: $" + estimatedLoan + "" +
"Estimated Monthly PITI (Principal, Interest, Taxes, Insurance): $" + estimatedMonthlyPayment + "";
}