Use this calculator to estimate how much house you can afford based on your income, debts, and down payment.
Understanding Your Mortgage Affordability
Determining how much house you can afford is a crucial step in the home-buying process. This calculator helps you estimate your maximum home purchase price by considering several key financial factors.
Key Factors Explained:
Annual Gross Income: This is your total income before taxes and other deductions. Lenders use this as a primary measure of your ability to repay a loan.
Monthly Debt Payments: This includes all your existing monthly financial obligations, such as car loans, student loans, and credit card minimum payments. These are factored in to understand your overall debt-to-income ratio (DTI). A common guideline is to keep your total DTI (including the new mortgage) below 43%, though this can vary by lender.
Down Payment: The upfront cash you pay towards the purchase price. A larger down payment reduces the loan amount needed and can help you avoid Private Mortgage Insurance (PMI) if it's 20% or more of the purchase price.
Interest Rate: The percentage charged by the lender on the loan amount. A lower interest rate means lower monthly payments and less paid over the life of the loan. This calculator uses an estimated annual rate.
Loan Term: The duration of the mortgage, typically 15 or 30 years. Shorter terms have higher monthly payments but less interest paid overall.
Property Tax Rate: Annual taxes assessed by local government on your property. These are often included in your monthly mortgage payment (as part of PITI: Principal, Interest, Taxes, Insurance).
Homeowners Insurance: The cost of insuring your home against damage or loss. This is also typically included in your PITI payment.
PMI Rate: Private Mortgage Insurance is often required by lenders if your down payment is less than 20% of the home's purchase price. It protects the lender in case you default on the loan.
How the Calculation Works (Simplified):
This calculator estimates your maximum affordable home price by working backward from what lenders typically allow for housing expenses based on your income and debts. It uses a common guideline where your total housing costs (Principal & Interest, Taxes, Insurance, and PMI) should not exceed a certain percentage of your gross income (often around 28%), and your total debt (housing + other debts) should not exceed another percentage (often around 36-43%). The calculator iteratively finds a loan amount that fits within these constraints, considering your down payment, interest rate, loan term, taxes, insurance, and PMI.
Disclaimer: This is an estimation tool. Your actual borrowing capacity may differ based on lender-specific criteria, credit score, lender fees, and market conditions. It is highly recommended to consult with a mortgage professional for a pre-approval.
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) / 100;
var loanTerm = parseFloat(document.getElementById("loanTerm").value);
var propertyTaxRate = parseFloat(document.getElementById("propertyTaxRate").value) / 100;
var homeInsurance = parseFloat(document.getElementById("homeInsurance").value);
var pmiRate = parseFloat(document.getElementById("pmiRate").value) / 100;
var resultElement = document.getElementById("result");
resultElement.innerHTML = ""; // Clear previous results
// Input validation
if (isNaN(annualIncome) || isNaN(monthlyDebt) || isNaN(downPayment) || isNaN(interestRate) || isNaN(loanTerm) || isNaN(propertyTaxRate) || isNaN(homeInsurance) || isNaN(pmiRate)) {
resultElement.innerHTML = "Please enter valid numbers for all fields.";
return;
}
if (annualIncome <= 0 || monthlyDebt < 0 || downPayment < 0 || interestRate < 0 || loanTerm <= 0 || propertyTaxRate < 0 || homeInsurance < 0 || pmiRate < 0) {
resultElement.innerHTML = "Please enter valid positive numbers (or zero for debts/rates).";
return;
}
var monthlyIncome = annualIncome / 12;
// Lender typically allows max 28% of gross monthly income for PITI (Principal, Interest, Taxes, Insurance)
var maxPITI = monthlyIncome * 0.28;
// Lender typically allows max 36% of gross monthly income for total debt (PITI + other debts)
var maxTotalDebt = monthlyIncome * 0.36;
// The actual affordable housing payment is the lesser of the two limits
var affordableHousingPayment = Math.min(maxPITI, maxTotalDebt – monthlyDebt);
if (affordableHousingPayment <= 0) {
resultElement.innerHTML = "Based on your income and existing debts, you may not qualify for a mortgage at this time. Consult with a mortgage professional.";
return;
}
var monthlyTaxes = (annualIncome * propertyTaxRate) / 12;
var monthlyInsurance = homeInsurance / 12;
var estimatedMaxLoan = 0;
var maxPurchasePrice = 0;
var loanAmount = 0;
// We need to iterate to find the maximum loan amount that results in an affordable P&I payment
// given the total affordable housing payment, taxes, insurance, and PMI.
// We will use an iterative approach to find the loan amount that makes the calculated P&I fit.
var maxPossibleLoanAmount = affordableHousingPayment * loanTerm * 12; // A rough upper bound for loan amount
var bestLoanAmount = 0;
var increment = maxPossibleLoanAmount / 1000; // Step for iteration
for (var currentLoanAmountAttempt = 0; currentLoanAmountAttempt 0) { // Only calculate PMI if there's a loan
// PMI is typically calculated on the loan amount
monthlyPMI = currentLoanAmountAttempt * pmiRate / 12;
}
var pAndIPayment = affordableHousingPayment – monthlyTaxes – monthlyInsurance – monthlyPMI;
if (pAndIPayment > 0) {
var monthlyInterestRate = interestRate / 12;
var numberOfPayments = loanTerm * 12;
var calculatedLoanFromPI = 0;
if (monthlyInterestRate > 0) {
calculatedLoanFromPI = pAndIPayment * (1 – Math.pow(1 + monthlyInterestRate, -numberOfPayments)) / monthlyInterestRate;
} else { // Handle 0 interest rate case
calculatedLoanFromPI = pAndIPayment * numberOfPayments;
}
if (calculatedLoanFromPI >= currentLoanAmountAttempt) {
// This loan amount attempt is affordable, so we can potentially afford more.
// Store this as the best possible loan amount so far.
bestLoanAmount = currentLoanAmountAttempt;
} else {
// The P&I payment for this loan amount is too low to support it.
// This means we've likely exceeded the maximum affordable loan amount.
break; // Exit the loop as we've found our limit
}
} else {
// If P&I becomes zero or negative after taxes, insurance, and PMI,
// then the loan amount is too high for the affordable housing payment.
break;
}
}
loanAmount = bestLoanAmount;
maxPurchasePrice = loanAmount + downPayment;
var formattedMaxPurchasePrice = maxPurchasePrice.toLocaleString('en-US', { style: 'currency', currency: 'USD' });
var formattedLoanAmount = loanAmount.toLocaleString('en-US', { style: 'currency', currency: 'USD' });
var formattedMonthlyPayment = (affordableHousingPayment).toLocaleString('en-US', { style: 'currency', currency: 'USD' });
resultElement.innerHTML =
"