Determine the maximum home price you can afford based on your income and current debts.
(Car loans, student loans, credit cards minimums)
30 Years
20 Years
15 Years
(Standard conservative limit is 36%)
Estimated Affordability Results
Maximum Home Price
$0
Max Loan Amount
$0
Estimated Total Monthly Payment
(Incl. estimated Taxes/Ins.)
$0
function calculateAffordability() {
// 1. Get Inputs
var grossIncome = parseFloat(document.getElementById("mac_grossIncome").value);
var monthlyDebt = parseFloat(document.getElementById("mac_monthlyDebt").value);
var downPayment = parseFloat(document.getElementById("mac_downPayment").value);
var interestRate = parseFloat(document.getElementById("mac_interestRate").value);
var loanTermYears = parseInt(document.getElementById("mac_loanTerm").value);
var maxDTI = parseFloat(document.getElementById("mac_maxDTI").value);
// 2. Validation
if (isNaN(grossIncome) || isNaN(monthlyDebt) || isNaN(downPayment) || isNaN(interestRate) || isNaN(loanTermYears) || isNaN(maxDTI) || grossIncome <= 0) {
alert("Please enter valid numeric values for all fields. Income must be greater than zero.");
return;
}
// 3. Calculation Logic
var monthlyGrossIncome = grossIncome / 12;
// Calculate maximum total allowed monthly debt payments based on DTI
var maxAllowedTotalMonthlyDebt = monthlyGrossIncome * (maxDTI / 100);
// Calculate maximum amount available for a housing payment (Total allowed – existing debts)
var maxAvailableHousingPayment = maxAllowedTotalMonthlyDebt – monthlyDebt;
if (maxAvailableHousingPayment <= 0) {
document.getElementById("mac_result").style.display = "block";
document.getElementById("mac_out_homePrice").innerHTML = "$0";
document.getElementById("mac_out_loanAmount").innerHTML = "Current debts too high";
document.getElementById("mac_out_monthlyPayment").innerHTML = "$0 available";
return;
}
// Estimate P&I portion. We assume P&I is roughly 80% of the total housing payment (leaving 20% for taxes/insurance).
// Therefore, we divide the total available housing payment by 1.25 to find the available P&I.
var availableForPI = maxAvailableHousingPayment / 1.25;
var monthlyInterestRate = (interestRate / 100) / 12;
var totalPaymentsN = loanTermYears * 12;
// Calculate Max Loan Amount using the present value formula for an annuity (solving for Principal)
// Principal = Payment * [ (1 – (1+r)^-n) / r ]
var maxLoanAmount = 0;
if (monthlyInterestRate === 0) {
maxLoanAmount = availableForPI * totalPaymentsN;
} else {
var discountFactor = (1 – Math.pow(1 + monthlyInterestRate, -totalPaymentsN)) / monthlyInterestRate;
maxLoanAmount = availableForPI * discountFactor;
}
var maxHomePrice = maxLoanAmount + downPayment;
// Re-calculate estimated total monthly payment based on the derived loan amount to ensure consistency in display
var calculatedPI = 0;
if (monthlyInterestRate === 0) {
calculatedPI = maxLoanAmount / totalPaymentsN;
} else {
var calculationFactor = (monthlyInterestRate * Math.pow(1 + monthlyInterestRate, totalPaymentsN)) / (Math.pow(1 + monthlyInterestRate, totalPaymentsN) – 1);
calculatedPI = maxLoanAmount * calculationFactor;
}
// Add back the estimated 25% for tax/insurance placeholder
var totalEstimatedMonthlyPayment = calculatedPI * 1.25;
// 4. Output Formatting
var currencyFormatter = new Intl.NumberFormat('en-US', {
style: 'currency',
currency: 'USD',
maximumFractionDigits: 0
});
document.getElementById("mac_result").style.display = "block";
document.getElementById("mac_out_homePrice").innerHTML = currencyFormatter.format(maxHomePrice);
document.getElementById("mac_out_loanAmount").innerHTML = currencyFormatter.format(maxLoanAmount);
document.getElementById("mac_out_monthlyPayment").innerHTML = currencyFormatter.format(totalEstimatedMonthlyPayment) + "/mo";
}
Understanding Mortgage Affordability: How Much House Can You Buy?
Determining "how much house can I afford" is the crucial first step in the homebuying process. It prevents you from falling in love with a property that is outside your financial reach and helps you set realistic expectations for your search. Mortgage affordability is not just about your income; it is a calculation based on your income relative to your existing debts and the terms of the mortgage itself.
The Critical Metric: Debt-to-Income (DTI) Ratio
Lenders primarily use your Debt-to-Income (DTI) ratio to evaluate your ability to manage monthly payments and repay the money you plan to borrow. DTI is the percentage of your gross monthly income that goes toward paying debts.
There are two types of DTI ratios lenders look at:
Front-End Ratio: The percentage of your income that goes toward housing costs (mortgage principal, interest, property taxes, homeowners insurance, and HOA fees). Lenders often prefer this to be under 28%.
Back-End Ratio: The percentage of your income that goes toward all housing costs plus all other monthly debt payments like car loans, student loans, and credit card minimums. Most conventional lenders prefer this total ratio to be under 36%, though some loan programs allow for higher ratios (up to 43% or sometimes 50% for FHA loans).
This calculator uses a configurable back-end DTI (defaulting to the conservative 36%) to estimate your maximum purchase price. If you have high existing monthly debts, your borrowing power for a house is significantly reduced, even if you have a high income.
How Interest Rates Impact Affordability
The mortgage interest rate plays a massive role in your buying power. Even a small increase in rates can drastically reduce the loan amount you qualify for, because more of your monthly payment goes toward interest rather than principal. For example, on a $2,000 monthly P&I budget, a 1% increase in interest rates could reduce your buying power by tens of thousands of dollars.
Using This Calculator
This tool works backward from your finances to find the house price. It takes your gross annual income and calculates your maximum allowable total monthly debt based on the DTI percentage you select. It then subtracts your current non-housing debts to find how much income is "left over" for a new mortgage payment (including estimates for taxes and insurance). Finally, it uses the loan term and interest rate to determine the maximum mortgage loan that fits that budget, adding your down payment to identify your potential maximum home price.