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.
- 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
Frequently Asked Questions
What is the 28/36 rule?
The 28/36 rule states that you should spend no more than 28% of gross monthly income on housing costs and no more than 36% on total debt (housing plus other debts like car loans and credit cards).
How much house can I afford on my salary?
As a quick estimate, you can generally afford a home priced at 3-5 times your annual income, depending on your debts, down payment, and interest rate.
Does this include property taxes and insurance?
This calculator estimates the maximum based on principal and interest only. Property taxes, insurance, and PMI will reduce the actual amount you can borrow.
What credit score do I need to buy a house?
Conventional loans typically require a minimum credit score of 620. FHA loans allow scores as low as 580 with 3.5% down, or 500 with 10% down. The best mortgage rates generally go to borrowers with scores above 740.
Learn More
Guide
How to Calculate Mortgage Payments
Learn how to calculate mortgage payments step by step. Understand the mortgage payment formula, principal vs. interest breakdown, escrow, PMI, and how to use amortization schedules.
Ready to run the numbers?
Open Mortgage Affordability Calculator