Buying a home is a significant financial decision, and understanding how much mortgage you can realistically afford is crucial.
The Mortgage Affordability Calculator is designed to give you an estimate of your borrowing power based on key financial
factors. It helps you set realistic expectations and narrow down your home search to properties within your budget.
Key Factors Influencing Affordability:
Annual Household Income: This is the primary driver of your borrowing capacity. Lenders assess your ability
to repay the loan based on your consistent income. Higher income generally means a larger potential loan amount.
Total Monthly Debt Payments: This includes all your existing recurring debt obligations, such as credit
card payments, student loans, car loans, and personal loans. Lenders will consider these payments when calculating your
debt-to-income ratio (DTI), which is a critical metric for loan approval. Keeping these debts low can significantly
increase your affordability.
Down Payment Amount: The larger your down payment, the less you need to borrow, which reduces your
loan amount and potentially your monthly payments. A substantial down payment can also lead to better interest rates
and may help you avoid private mortgage insurance (PMI).
Interest Rate: The annual interest rate on your mortgage has a profound impact on your monthly payments
and the total interest paid over the life of the loan. Even small differences in interest rates can result in substantial
differences in affordability over time.
Loan Term: This is the duration over which you will repay your mortgage, typically 15 or 30 years. A
shorter loan term will result in higher monthly payments but less interest paid overall. A longer term means lower
monthly payments but more interest paid over time.
How the Calculator Works:
This calculator uses common lending guidelines to estimate affordability. A widely used guideline is the "front-end" or
"housing" ratio, which suggests that your total housing costs (principal, interest, taxes, and insurance – PITI) should
not exceed a certain percentage of your gross monthly income (often around 28%). The calculator also considers the
"back-end" ratio, where your total monthly debt payments (including estimated PITI) should not exceed a percentage of
your gross monthly income (often around 36% to 43%).
The calculator first determines the maximum monthly payment you can afford by subtracting your existing monthly debts from
a portion of your income allocated for housing. Then, using the provided interest rate and loan term, it calculates the
maximum loan amount that would correspond to that maximum monthly payment. Finally, it subtracts your down payment to
provide an estimate of the maximum home price you can afford.
Disclaimer: This calculator provides an estimate only. Actual mortgage approval and loan amounts depend
on a lender's specific underwriting criteria, your credit score, employment history, and other financial factors. It is
always recommended to consult with a mortgage professional for personalized advice.
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");
// Basic validation
if (isNaN(annualIncome) || isNaN(monthlyDebt) || isNaN(downPayment) || isNaN(interestRate) || isNaN(loanTerm) ||
annualIncome <= 0 || monthlyDebt < 0 || downPayment < 0 || interestRate <= 0 || loanTerm <= 0) {
resultDiv.innerHTML = "Please enter valid positive numbers for all fields.";
return;
}
var grossMonthlyIncome = annualIncome / 12;
// Common DTI ratios (can be adjusted based on lender guidelines)
var housingRatioLimit = 0.28; // Front-end ratio (PITI / Gross Monthly Income)
var totalDebtRatioLimit = 0.36; // Back-end ratio (Total Debts / Gross Monthly Income)
// Estimate maximum PITI (Principal, Interest, Taxes, Insurance)
// We'll use the more conservative total debt ratio for a safer estimate.
// Max total debt payments = grossMonthlyIncome * totalDebtRatioLimit
// Max PITI = (grossMonthlyIncome * totalDebtRatioLimit) – monthlyDebt
var maxTotalDebtPayments = grossMonthlyIncome * totalDebtRatioLimit;
var maxPITI = maxTotalDebtPayments – monthlyDebt;
// Ensure maxPITI is not negative
if (maxPITI 0) {
// M = P [ i(1 + i)^n ] / [ (1 + i)^n – 1]
// P = M [ (1 + i)^n – 1] / [ i(1 + i)^n ]
// Where:
// P = Principal loan amount
// M = Monthly payment (maxPITI in our case)
// i = monthly interest rate
// n = number of payments
var temp = Math.pow(1 + monthlyInterestRate, numberOfPayments);
maxLoanAmount = maxPITI * (temp – 1) / (monthlyInterestRate * temp);
} else if (maxPITI > 0) { // Handle 0% interest rate case
maxLoanAmount = maxPITI * numberOfPayments;
}
// Estimate maximum affordable home price
var maxHomePrice = maxLoanAmount + downPayment;
// Format results
var formattedMaxHomePrice = maxHomePrice.toLocaleString(undefined, {
style: 'currency',
currency: 'USD'
});
var formattedMaxLoanAmount = maxLoanAmount.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, you may be able to afford a home up to: ${formattedMaxHomePrice}
Estimated maximum loan amount: ${formattedMaxLoanAmount}
Estimated maximum monthly payment (PITI): ${formattedMaxPITI}Details: