How Your Mortgage Payment Is Calculated: The Formula
The exact amortization formula behind your mortgage payment, why a $400,000 loan at 6.75% costs about $2,594 a month, and how to run the numbers yourself.
When a lender hands you a monthly payment figure, it can feel like it came out of a black box. It didn't. That number falls out of one well-defined formula that's been used, unchanged, for decades. Once you can run it yourself, you can sanity-check any lender's quote, see exactly how much you're handing over in interest, and understand why throwing extra money at the loan early saves so much.
So let's actually do the math, step by step, with real numbers.
The amortization formula
Your monthly principal-and-interest payment comes from a single amortization formula — the same one every lender, spreadsheet, and calculator uses. The CFPB explains the payment components; the math that produces the P&I figure looks like this:
M = P × [ r(1 + r)^n ] / [ (1 + r)^n − 1 ]
Where:
- M = monthly payment
- P = principal (the loan amount)
- r = monthly interest rate (annual rate ÷ 12)
- n = total number of payments (years × 12)
It looks intimidating. Each piece, taken on its own, is simple — so let's plug in real numbers and watch it come apart.
A worked example
Say you borrow $400,000 at 6.75% annual interest over 30 years.
First, the monthly rate. That's just the annual rate split twelve ways:
r = 6.75% / 12 = 0.5625% = 0.005625
Next, the number of payments — one per month for 30 years:
n = 30 years × 12 months = 360
Now drop both into the formula:
(1 + r)^n = (1.005625)^360 ≈ 7.5556
M = 400,000 × [0.005625 × 7.5556] / [7.5556 − 1]
M = 400,000 × [0.042500] / [6.5556]
M = 400,000 × 0.006483
M ≈ $2,594
So running the formula gives a monthly payment of about $2,594. Multiply that across 360 payments and you've paid roughly $934,000 — which means about $534,000 in interest on a $400,000 loan. Sit with that for a second: the interest costs more than the house. That's the real price of borrowing over 30 years.
The 6.75% rate here is just an illustration. Real rates move weekly, and Freddie Mac's Primary Mortgage Market Survey is the standard benchmark — its 30-year fixed average was 6.48% in early June 2026. Plug your own quoted rate into the formula and the rest follows.
You can check any scenario instantly with the Mortgage Calculator — it runs this math and adds tax, insurance, and PMI on top.
Why early payments are mostly interest
Early payments are mostly interest because interest is charged on the balance you still owe, and early on you owe almost the whole loan. The payment ($2,594) never changes, but how it's split between interest and principal shifts dramatically as the years go by.
In month one, the full $400,000 is outstanding:
Interest = $400,000 × 0.005625 = $2,250
Principal = $2,594 − $2,250 = $344
Just $344 of that first $2,594 payment actually shrinks the loan. The other $2,250 is pure interest, gone.
By the halfway mark, month 180, the balance is far lower:
Remaining balance ≈ $293,000 (running the formula forward)
Interest = $293,000 × 0.005625 = $1,649
Principal = $2,594 − $1,649 = $945
Now $945 goes to principal, nearly triple the $344 from month one. The split has tilted — and it keeps tilting faster every month after this.
And by the final payment, month 360, there's almost nothing left to charge interest on:
Remaining balance ≈ $2,580
Interest ≈ $14
Principal ≈ $2,580
Nearly the whole payment now reduces principal.
This is why equity builds at a crawl early on and then races toward the end. It's also why extra payments early in the loan are so powerful — every extra dollar of principal in month one erases interest that would otherwise compound for the next 29 years.
The power of extra payments
Extra principal early in the loan is the single highest-return move you can make. Run the formula with an extra $200 a month on that $400,000 loan, starting from day one:
| Scenario | Payoff time | Total interest |
|---|---|---|
| Standard $2,594/month | 30 years | ~$534,000 |
| + $200/month extra | ~24 years | ~$415,000 |
That extra $200 a month saves roughly $119,000 in interest and clears the loan about six years early — these figures come from running the amortization formula forward, not from any quoted rate sheet. The earlier you start, the bigger the effect, because each extra dollar of principal kills interest that would otherwise compound for decades. It's the same mechanism that makes compound interest work for savers, just running in reverse for borrowers. Try your own numbers in the Loan Calculator — adjust the term and watch the total interest move.
What the formula doesn't include
The amortization formula gives you principal and interest only — P&I. Your actual monthly payment almost always carries more. The CFPB lays out the full breakdown: principal + interest + mortgage insurance (if any) + escrow for taxes and insurance equals your total monthly payment. The extra pieces:
- Property tax — varies sharply by location. The 2025 national average effective rate was about 0.9% of home value per year, ranging from roughly 0.3% in the lowest states to nearly 2% in the highest, with some counties above that.
- Homeowners insurance — roughly 0.25% to 1% of home value annually; the U.S. average runs around $2,500 a year on a $400,000 home.
- PMI — if your down payment is under 20%, private mortgage insurance typically adds about 0.3% to 1.5% of the loan per year, per common lender pricing.
- HOA fees — if applicable, and usually paid separately rather than through the lender.
Your lender collects the tax and insurance pieces through an escrow account and pays those bills on your behalf. Bundle them with P&I and you get PITI (Principal, Interest, Tax, Insurance). For the full picture, read our mortgage PITI breakdown or use the Mortgage Calculator, which separates every component.
How to calculate it yourself
You don't have to crank the exponents by hand. Every spreadsheet ships with a built-in PMT function that runs the amortization formula for you:
=PMT(rate/12, years*12, -principal)
=PMT(0.0675/12, 30*12, -400000)
→ 2593.99
Note the negative principal. Spreadsheet PMT functions treat the loan as money you receive (negative) and payments as money you pay out (positive), so flipping the sign gives you a positive payment back.
Prefer code? Here it is in JavaScript:
function monthlyPayment(principal, annualRate, years) {
const r = annualRate / 100 / 12;
const n = years * 12;
if (r === 0) return principal / n;
return (principal * r * Math.pow(1 + r, n)) / (Math.pow(1 + r, n) - 1);
}
monthlyPayment(400000, 6.75, 30); // → 2593.99
The bottom line
Your monthly payment comes straight out of the amortization formula, M = P × r(1+r)ⁿ / ((1+r)ⁿ − 1). The payment stays constant, but the early ones are almost all interest and the later ones almost all principal — which is exactly why extra payments early on save such enormous amounts. Just remember the formula only gives you P&I; add tax, insurance, and PMI for your true monthly cost, and use the Mortgage Calculator to model your exact scenario with every piece included.
Frequently asked questions
Why does a 0.25% rate change matter so much?
Because it compounds across 360 payments. On a $400,000 30-year loan, 6.50% runs to about $2,528/month and ~$510k total interest, while 6.75% runs to ~$2,594 and ~$534k. That quarter point costs roughly $24,000 over the life of the loan, which is why shopping multiple lenders pays off.
Does a longer term mean a cheaper loan?
No, and this trips people up. A longer term lowers the monthly payment but raises the total interest. A 15-year loan has steeper monthly payments yet can save well over $200,000 in interest versus a 30-year loan on the same principal, because you pay interest for half as long.
What is an amortization schedule?
It is a month-by-month table showing the interest and principal split plus the remaining balance for every payment. It is just the amortization formula applied 360 times. The CFPB explains how each payment is structured, and a loan calculator can generate the full schedule for extra-payment planning.
What does the mortgage payment formula leave out?
It gives you principal and interest only. Per the CFPB, your full payment also bundles property tax, homeowners insurance, and PMI if your down payment is under 20%, usually collected through an escrow account. Together with P&I these form PITI, your true monthly housing cost.