Determine how much house you can realistically afford based on your income, debts, and current mortgage rates. Lenders typically use debt-to-income (DTI) ratios to determine your maximum loan amount.
(Cars, student loans, credit cards, etc.)
30 Years
20 Years
15 Years
10 Years
Affordability Estimate
Maximum Home Price:
Max Monthly Mortgage Payment:
(Includes Principal, Interest, Taxes, Insurance)
function calculateAffordability() {
// 1. Get Inputs based on exact IDs
var annualIncomeStr = document.getElementById("mac-annual-income").value;
var monthlyDebtStr = document.getElementById("mac-monthly-debt").value;
var downPaymentStr = document.getElementById("mac-down-payment").value;
var interestRateStr = document.getElementById("mac-interest-rate").value;
var loanTermStr = document.getElementById("mac-loan-term").value;
var taxesInsuranceStr = document.getElementById("mac-est-taxes-insurance").value;
// 2. Parse inputs to numbers
var annualIncome = parseFloat(annualIncomeStr);
var monthlyDebt = parseFloat(monthlyDebtStr) || 0; // Default to 0 if empty
var downPayment = parseFloat(downPaymentStr) || 0;
var interestRate = parseFloat(interestRateStr);
var loanTermYears = parseInt(loanTermStr);
var monthlyTaxesInsurance = parseFloat(taxesInsuranceStr) || 0;
// 3. Validation: Check for NaN or invalid negative numbers
if (isNaN(annualIncome) || annualIncome <= 0 || isNaN(interestRate) || interestRate <= 0 || isNaN(loanTermYears)) {
alert("Please enter valid values for Income, Interest Rate, and Loan Term.");
return;
}
// 4. Define DTI Ratios (Standard 28/36 rule used by many conservative lenders)
var frontEndRatio = 0.28; // Max housing cost percentage of gross income
var backEndRatio = 0.36; // Max total debt percentage of gross income
// 5. Calculate Monthly Gross Income
var monthlyGrossIncome = annualIncome / 12;
// 6. Calculate Max Allowed Payment based on Back-End Ratio (Total allowed debt – existing debt)
var maxTotalDebtPayment = monthlyGrossIncome * backEndRatio;
var maxHousingPaymentBackEnd = maxTotalDebtPayment – monthlyDebt;
// 7. Calculate Max Allowed Payment based on Front-End Ratio (Housing only)
var maxHousingPaymentFrontEnd = monthlyGrossIncome * frontEndRatio;
// 8. The actual max housing payment is the lesser of the two approaches
// This is the total PITI (Principal, Interest, Taxes, Insurance)
var maxPITI = Math.min(maxHousingPaymentBackEnd, maxHousingPaymentFrontEnd);
// Ensure maxPITI isn't negative (if debts are very high)
if (maxPITI 0
if (maxPI > 0) {
var monthlyInterestRate = (interestRate / 100) / 12;
var totalPayments = loanTermYears * 12;
// Formula: Present Value = Payment * ([1 – (1 + r)^-n] / r)
// Alternative form: P = A * ( ((1+r)^n)-1 ) / ( r*(1+r)^n )
var compoundFactor = Math.pow(1 + monthlyInterestRate, totalPayments);
maxLoanAmount = maxPI * ( (compoundFactor – 1) / (monthlyInterestRate * compoundFactor) );
}
// 11. Calculate Max Home Price
var maxHomePrice = maxLoanAmount + downPayment;
// 12. Format Results to Currency
var formatter = new Intl.NumberFormat('en-US', {
style: 'currency',
currency: 'USD',
minimumFractionDigits: 0,
maximumFractionDigits: 0,
});
// 13. Display Results
document.getElementById("mac-result").style.display = "block";
document.getElementById("mac-max-home-price").innerHTML = formatter.format(maxHomePrice);
document.getElementById("mac-max-monthly-payment").innerHTML = formatter.format(maxPITI) + "/mo";
}
Understanding How Much House You Can Afford
Determine your purchasing power before starting your home search is crucial. This mortgage affordability calculator estimates the maximum home price you can handle based on lender criteria, specifically focusing on your Debt-to-Income (DTI) ratio.
The 28/36 DTI Rule
Most standard mortgage lenders utilize the "28/36 rule" to assess affordability. This two-part rule helps ensure you aren't overextending yourself financially.
The Front-End Ratio (28%): Lenders generally prefer that your total monthly housing costs—including loan principal, interest, property taxes, and homeowner's insurance (PITI)—do not exceed 28% of your gross monthly income.
The Back-End Ratio (36%): Your total monthly debt obligations—your new housing costs plus existing debts like car payments, student loans, and credit card minimums—should typically not exceed 36% of your gross monthly income.
This calculator determines the maximum monthly payment allowed under both scenarios and uses the lower, more conservative figure to estimate your budget.
Real-World Example
Let's assume a household has a gross annual income of $96,000 (which is $8,000 per month). They have existing monthly debts (a car loan and student debt) totaling $600. They have saved a $50,000 down payment. Assuming a 30-year fixed mortgage at a 6.5% interest rate, and estimating taxes and insurance at $500/month:
Based on the 28% front-end rule, their max housing payment is $2,240 ($8,000 x 0.28).
Based on the 36% back-end rule, their total allowed debt is $2,880 ($8,000 x 0.36). Subtracting their $600 existing debt leaves $2,280 for housing.
The lender uses the lower figure: $2,240 for total PITI.
Subtracting the $500 for taxes/insurance leaves $1,740 for principal and interest.
At 6.5% over 30 years, $1,740/month supports a loan of approximately $275,000.
Adding their down payment, their maximum affordable home price is roughly $325,000.
Factors That Change Your Affordability
Your affordability isn't fixed. Several levers can change how much you can borrow:
Interest Rates: A lower interest rate significantly increases your purchasing power because more of your monthly payment goes toward the loan principal rather than interest charges.
Down Payment: A larger down payment reduces the loan amount needed, lowering your monthly payments and increasing the maximum price point you can reach.
Existing Debt: Paying off a car loan or student loan reduces your back-end DTI ratio, immediately freeing up monthly income that lenders can apply toward a larger mortgage payment.