House Affordability Calculator
A house affordability calculator determines the maximum home price you can afford based on income, debts, down payment, and current mortgage rates. Lenders use two key ratios to evaluate affordability.
The 28/36 Rule
| Ratio | Rule | Calculation |
|---|---|---|
| Front-End (28%) | Housing costs ≤ 28% of gross income | PITI / Gross Monthly Income |
| Back-End (36%) | Total debt ≤ 36% of gross income | All Debt Payments / Gross Monthly Income |
Home Affordability by Income
At 7% interest, 30-year mortgage, 20% down:
| Annual Income | Max Housing (28%) | Max Home Price | Max Payment |
|---|---|---|---|
| $60,000 | $1,400/mo | $210,000 | $1,120/mo |
| $80,000 | $1,867/mo | $280,000 | $1,493/mo |
| $100,000 | $2,333/mo | $350,000 | $1,867/mo |
| $120,000 | $2,800/mo | $420,000 | $2,240/mo |
| $150,000 | $3,500/mo | $525,000 | $2,800/mo |
House Affordability Calculator Implementation
``javascript
function calculateHomeAffordability(annualIncome, monthlyDebts, downPayment, rate, termYears, taxRate = 1.2, insuranceRate = 0.35) {
const monthlyIncome = annualIncome / 12;
const maxHousingPayment = monthlyIncome * 0.28;
const maxTotalDebt = monthlyIncome * 0.36;
const availableForHousing = Math.min(maxHousingPayment, maxTotalDebt - monthlyDebts);
// Estimate taxes and insurance as % of home value (annual)
// Iteratively solve for max home price
const monthlyRate = rate / 100 / 12;
const payments = termYears * 12;
// Start with estimate
let maxHome = 0;
for (let price = 50000; price <= 2000000; price += 5000) {
const loan = price - downPayment;
const pi = loan * monthlyRate / (1 - Math.pow(1 + monthlyRate, -payments));
const taxes = (price * taxRate / 100) / 12;
const insurance = (price * insuranceRate / 100) / 12;
const piti = pi + taxes + insurance;
if (piti <= availableForHousing) maxHome = price;
else break;
}
return { maxHomePrice: maxHome, maxPayment: availableForHousing.toFixed(2) };
}
console.log(calculateHomeAffordability(100000, 500, 70000, 7, 30));
``
Beyond the Numbers
Lenders may approve more than you should borrow. Consider your lifestyle, job stability, and other financial goals. Many experts recommend spending less than the maximum to maintain financial flexibility.