Mortgage Affordability Calculator Formula
Understand the math behind the mortgage affordability calculator. Each variable explained with a worked example.
Formulas Used
Affordable Home Price
affordable_home_price = monthly_rate > 0 ? max_monthly_payment * (pow(1 + monthly_rate, num_payments) - 1) / (monthly_rate * pow(1 + monthly_rate, num_payments)) + down_payment : max_monthly_payment * num_payments + down_paymentMaximum Loan Amount
max_loan_amount = monthly_rate > 0 ? max_monthly_payment * (pow(1 + monthly_rate, num_payments) - 1) / (monthly_rate * pow(1 + monthly_rate, num_payments)) : max_monthly_payment * num_paymentsEstimated Monthly Payment
estimated_monthly_payment = max_monthly_paymentVariables
| Variable | Description | Default |
|---|---|---|
annual_income | Annual Gross Income(USD) | 85000 |
monthly_debts | Monthly Debt Payments(USD) | 500 |
down_payment | Down Payment(USD) | 50000 |
annual_rate | Interest Rate(%) | 6.5 |
loan_term_years | Loan Term(years) | 30 |
monthly_income | Derived value= annual_income / 12 | calculated |
max_housing_payment | Derived value= monthly_income * 0.28 | calculated |
max_total_payment | Derived value= monthly_income * 0.36 - monthly_debts | calculated |
max_monthly_payment | Derived value= min(max_housing_payment, max_total_payment) | calculated |
monthly_rate | Derived value= annual_rate / 12 / 100 | calculated |
num_payments | Derived value= loan_term_years * 12 | calculated |
How It Works
How Mortgage Affordability Is Calculated
Lenders use the 28/36 rule to determine how much you can afford:
The calculator takes the lower of these two limits and works backward to find the maximum loan amount you qualify for.
Worked Example
You earn $85,000/year with $500/month in existing debts, $50,000 down payment, at 6.5% for 30 years.
annual_income = 85000monthly_debts = 500down_payment = 50000annual_rate = 6.5loan_term_years = 30
- 01Monthly income: $85,000 / 12 = $7,083.33
- 0228% rule max housing payment: $7,083.33 * 0.28 = $1,983.33
- 0336% rule max total debts: $7,083.33 * 0.36 - $500 = $2,050.00
- 04Use lower value: $1,983.33
- 05Max loan amount at 6.5% for 30 years: $313,770
- 06Affordable home price: $313,770 + $50,000 = $363,770
Ready to run the numbers?
Open Mortgage Affordability Calculator