Sub topic 6
Calculating the Monthly Mortgage Payment
Assume you know the loan principal, the annual interest rate, and the loan term. This chapter calculates the scheduled principal-and-interest payment for a fixed-rate mortgage. It does not include property taxes, homeowners insurance, mortgage insurance, or other escrow charges.
The amortization formula
A fixed-rate mortgage uses a payment that stays constant for the scheduled term. Each payment includes:
- Interest, the charge for using the lender’s money.
- Principal, the amount that reduces the loan balance.
The standard formula is:
\[ M = \frac{P \times r}{1 - (1+r)^{-n}} \]
Where:
- \(M\) is the monthly principal-and-interest payment.
- \(P\) is the original principal.
- \(r\) is the monthly interest rate.
- \(n\) is the total number of monthly payments.
Convert the annual rate to a decimal before calculating. Then divide it by 12. Convert years to months by multiplying by 12.
For a $300,000 loan at 6% for 30 years:
- \(P = 300{,}000\)
- \(r = 0.06 / 12 = 0.005\)
- \(n = 30 \times 12 = 360\)
The resulting payment is about $1,798.65 per month.
| Input | Value |
|---|---|
| Principal | $300,000 |
| Annual rate | 6% |
| Term | 30 years |
| Monthly payment | $1,798.65 |
def monthly_payment(principal, annual_rate, years):
n = years * 12 # number of monthly payments
r = annual_rate / 12 # monthly interest rate
if r == 0:
return principal / n
return principal * r / (1 - (1 + r) ** -n)
payment = monthly_payment(300_000, 0.06, 30)
print(f"${payment:,.2f}")The zero-rate condition prevents division by zero and returns a simple division of principal by the number of payments.
How the inputs change the payment
A larger principal increases the payment because more money must be repaid. A higher interest rate increases the payment because each month’s balance produces more interest. A longer term usually lowers the required monthly payment because the principal is spread across more months.
The lower payment from a longer term has a cost. The loan remains outstanding longer, so it usually produces more total interest.
Common calculation errors
- Using 6 instead of 0.06 for a 6% annual rate.
- Dividing the annual rate by 12 but forgetting to convert years to months.
- Treating the monthly payment as the full housing cost.
- Comparing payments without also comparing total interest.
- Rounding the monthly rate or intermediate values too early.
Exercise
What is the scheduled monthly principal-and-interest payment for a $200,000 loan at 5% for 15 years? Use the formula or run the Python function.
Show answer
Approximately $1,581.59 per month.