The basic formula for a monthly mortgage payment

A mortgage payment is calculated using a formula that accounts for three things: the loan amount, the interest rate, and how many months you have to pay it back. The formula is:

M = P × [r(1 + r)^n] / [(1 + r)^n − 1]

In this formula, M is your monthly payment, P is the principal (the amount you borrowed), r is your monthly interest rate (your annual rate divided by 12), and n is the total number of payments (years × 12). This formula assumes a fixed-rate mortgage where your rate never changes and you make equal payments every month.

The reason the formula looks complicated is that it accounts for how interest compounds over time. Early payments go mostly toward interest; later payments go mostly toward principal. The formula balances all of that into one number you pay each month.

Key Takeaways

  • The mortgage payment formula requires your loan amount, monthly interest rate, and total number of payments—all three numbers must be exact or your result will be wrong.
  • Your monthly interest rate is your annual rate divided by 12; a 6% annual rate becomes 0.06 ÷ 12 = 0.005 as a monthly rate.
  • The total number of payments for a 30-year mortgage is 360 (30 years × 12 months), and for a 15-year mortgage is 180.
  • A mortgage calculator will give you the same answer as the formula, but working through it by hand shows you exactly where your payment comes from.
  • Your actual monthly payment also includes property taxes, homeowners insurance, and possibly mortgage insurance—the formula only calculates the principal and interest portion.

Breaking down each part of the formula

Start with the principal (P). This is the amount you actually borrowed—not the home price, but the loan amount after your down payment. If you bought a $300,000 home and put down $60,000, your principal is $240,000.

Next is the monthly interest rate (r). Take your annual interest rate and divide it by 12. If your rate is 6% per year, that is 0.06 as a decimal. Divide by 12: 0.06 ÷ 12 = 0.005. This 0.005 is your monthly rate. Do not skip the decimal conversion—6% is not the same as 0.06 in the formula.

The number of payments (n) depends on your loan term. A 30-year mortgage has 360 payments (30 × 12). A 15-year mortgage has 180 payments (15 × 12). A 20-year mortgage has 240 payments. Use the exact term from your loan documents.

The exponent (1 + r)^n means you multiply (1 + r) by itself n times. With a 30-year loan at 6%, you are calculating (1.005)^360. This is where a calculator becomes essential—doing this by hand is impractical.

Working through a real example

Suppose you borrow $240,000 at 6% annual interest for 30 years. Here is how the formula works:

P = $240,000 r = 0.06 ÷ 12 = 0.005 n = 30 × 12 = 360

Now calculate (1 + r)^n = (1.005)^360. Using a calculator, this equals approximately 6.023.

Plug into the formula: M = 240,000 × [0.005 × 6.023] / [6.023 − 1] M = 240,000 × [0.03012] / [5.023] M = 240,000 × 0.005996 M = $1,439.28

Your monthly principal and interest payment would be $1,439.28. This does not include property taxes, insurance, or mortgage insurance if you put down less than 20%.

Why the formula matters even if you use a calculator

Most people use a mortgage calculator online or on their phone rather than working through the formula by hand. That is practical and fast. But understanding the formula helps you see why small changes in interest rate or loan term make such a big difference in your payment.

If you lower your interest rate from 6% to 5.5%, your monthly rate drops from 0.005 to 0.00458. That tiny change ripples through the exponent and the division, and your payment drops by roughly $30 per month. Over 30 years, that is $10,800 in savings. The formula shows you exactly where that savings comes from.

The same applies to loan term. A 15-year mortgage at the same rate costs more per month than a 30-year mortgage, but you pay far less total interest because you are paying down the principal faster. The formula is the tool that proves it.

What the formula does not include

The mortgage payment formula calculates only principal and interest. Your actual monthly payment to your lender usually includes more. Property taxes, homeowners insurance, and possibly private mortgage insurance (PMI) are added on top.

These extras vary by location and your down payment size. A lender will give you an estimate called a Loan Estimate within three days of your application. That document shows the principal and interest payment calculated by this formula, plus all the other costs rolled into your monthly payment.

If you are comparing loans or trying to understand your payment, use the formula for the principal and interest portion, then add the other costs separately. That way you can see which part of your payment goes to the bank and which part goes to taxes and insurance.

Using a spreadsheet or calculator instead of doing it by hand

Most spreadsheet programs (Excel, Google Sheets) have a built-in PMT function that does this calculation for you. In Excel, the syntax is =PMT(rate, nper, pv). You enter your monthly interest rate, number of payments, and loan amount, and it returns your payment instantly.

Online mortgage calculators work the same way—they plug your numbers into this formula behind the scenes and show you the result. The advantage of using a tool is speed and accuracy. The advantage of understanding the formula is knowing what the tool is actually doing and why your payment changes when you adjust the rate or term.

If you are shopping for a mortgage, run the same numbers through multiple calculators to confirm they all give the same answer. They should, because they are all using the same formula. If one calculator gives a different result, check whether it is including taxes and insurance while the others are not.

Frequently Asked Questions

What is the difference between the formula result and my actual monthly payment?

The formula gives you only principal and interest. Your actual payment also includes property taxes, homeowners insurance, and possibly PMI. Your lender combines all of these into one monthly payment, but the formula only covers the first two.

Do I need to know this formula to get a mortgage?

No. Lenders calculate this for you and show it on your Loan Estimate. But understanding the formula helps you compare loans, see why rates matter, and verify that your lender's numbers are correct.

What happens to the formula if my interest rate is adjustable?

The formula assumes a fixed rate that never changes. With an adjustable-rate mortgage (ARM), your rate changes after an initial period, so your payment changes too. You would use the formula to calculate the payment for each rate period separately.

Can I use this formula for a loan other than a mortgage?

Yes. The formula works for any loan with a fixed rate and equal monthly payments—car loans, personal loans, student loans. The inputs are the same: loan amount, monthly interest rate, and number of payments.

Why does the formula use an exponent instead of just multiplying the rate by the number of months?

Because interest compounds. Each month, you owe interest not just on the original loan but on the interest that has accumulated. The exponent accounts for that compounding effect over the entire loan term.