Go back to home page of Unsolicited Advice from Tiffany B. Brown

How mortgages work

Four small red wooden blocks shaped like houses rest on a oak-colored wooden table surface.

Photo by Tierra Mallorca on Unsplash

Most Americans, when they purchase a home, finance the purchase using a mortgage. But how many of us fully understand how they work? Here what I wish I knew when I closed on my first mortage.

This is a long post, but it's a thorough one. Apologies in advance.

How banks determine your mortgage payment

Your mortgage payment is determined by three things:

  1. How much you've borrowed.
  2. Your annual interest rate.
  3. The number of months in your mortgage term.

A 15-year mortgage, for example, has 180 payments. For a 30-year mortgage, it's 360.

Most residential mortages use what's known as a 30/360 day-count basis. Interest is calculated as though every month has thirty days, and every year only has 360 days. I don't know why they pretend that Februrary is a regular-length month, and that five days do not exist in the calendar. My guess is that it makes the math work in such a way that payments do not flucutuate month-to-month.

As with most things money-and-numbers-related, there’s a formula for calculating a monthly mortgage payment.

Monthly Mortgage Payment Formula Monthly payment equals the principal amount times the quotient of the monthly interest rate times one minus the monthly interest rate to the nth power and one plus the monthly rate to the nth power minus one.

In this equation:

  • M is the monthly payment;
  • P is the principal amount (how much you borrowed);
  • r is the monthly interest rate, calculated by dividing your annual rate by the number of months in one year (12); and
  • n is the number of months in your loan term.

Perhaps you'd like some JavaScript to make this easy (this works on node and deno).

import { EOL } from "node:os";

const MONTHS_IN_YEAR = 12;
const MONTHS_IN_LOAN = 360;


const formatted_number = (number) => {
  return new Intl.NumberFormat('en-US', { style: 'currency', currency: 'USD' }).format(number);
}

const monthly_payment = (principal, annualrate, years) => {
  var months = years * MONTHS_IN_YEAR;
  var monthly_rate = annualrate / MONTHS_IN_YEAR;
  var one_plus_rate = Math.pow((1 + monthly_rate), months);
  var payment = principal * (monthly_rate * one_plus_rate) / (one_plus_rate - 1)

  return payment;
}

const monthlypay = monthly_payment(570000, 0.03375, 30);

console.log( `${EOL}Your monthly principal and interest payment should be about: ${formatted_number(monthlypay)}` );
console.log( `Over your loan's term, you should pay about ${formatted_number(monthlypay * MONTHS_IN_LOAN)} total in principal and interest.`);

It's ugly code, but it does the job 🤷🏽‍♀️.

Why your monthly payment is probably higher than this estimate

In most cases, your property taxes, homeowner's insurance, and private mortgage insurance (if applicable) are also included in your monthly payment. You'll sometimes hear this payment called a PITI payment for Principal, Interest, Taxes, and Insurance.

The difference between what your monthly payment should be based on this formula, and what it is goes into an escrow account. Your loan servicer uses that account to pay your property taxes and insurance.

If your mortgage payment changed recently, it's probably because your homeowner's insurance premium or property taxes increased. Your servicer typically notifies you of such changes ahead of time so that you can adjust your budget.

Calculate how much you'll pay in total (principal + interest)

So you know how much principal and interest portion of your mortgage payment will be. Now you can calculate how much you'll actually end up paying in total for your loan.

This calculation is the easiest.

Principal and Interest

Yup. Multiply the monthly payment times the number of months in the loan. Deduct the principal amount from the that total to estimate how much interest you'll pay by the end of your loan term.

How your principal and interest payment gets applied

If you've ever talked to someone about mortgages, you may have heard that your first few years of mortgage payments are mostly interest. That's true, and here's why. First the formula.

Monthly Interest = Principal × ((Annual rate ÷ 360 days in year) × 30 days in month)

Now the mechanics: thirty days of interest accrues on your outstanding balance each period. Each payment covers the interest accrued. Whatever's left over gets applied to the principal balance.

Let's say you've borrowed $500,000 at a 5% annual rate on a 30-year mortgage. Your first mortgage payment will be $2,684.11. Interest for that period will be $2,083.33. The remaining $600.78 gets applied to your principal balance. For the next payment period, you'll accrue interest on a principal balance of $499,399.22.

For your second payment, you'll only pay $2,080.83 of interest. Since $2,684.11 - $2,080.83 leaves $603.28, your principal balance heading into month three will be $499,399.22 - $603.28, or $498,795.94.

Principal and interest payments are calculated this way every month for the lifetime of your loan. It's a process known as amortization. As your principal balance shrinks, you pay less in interest and larger proportion of your payment gets applied to the balance.

How extra payments help

Many lenders will let you make additional principal payments each month. Doing so can shave months or years from your mortgage. You'll also save tens or thousands in interest payments.

Additional payments, of course, requires having room in your montly budget for them. An alternative is to pay one-half of your monthly payment every 15 days (or two every weeks). Your outstanding balance will decrease faster, without changing your monthly outlay.

I know that sounds weird, so let's walk through the numbers using our $500,000, 5%, 30-year mortgage example.

First, calculate how much interest gets accrued in fifteen days.

$500,000 * ((.05 / 360) * 15) = $1,041.67

Again, our monthly payment is $2,684.11. If you pay half of that amount, after 15 days, you'll send your servicer $1,342.06.

Half-payments are usually applied the same way full payments are. You pay the interest first, and whatever is left over gets credited to your principal balance.

$1,342.06 - $1,041.67 = $300.39

Now your principal balance is $499,699.61. For the next fifteen days, you'll accrue interest on this balance.

$499,699.61 * ((.05 / 360) * 15) = $1,041.04

That works out to $1,041.04 of interest. When you submit your second half-payment of $1342.06, the remaining $301.02 will be credited to your loan balance. You've now paid $1.88 less in interest for the month. You've also paid down $601.41 in principal, versus $600.78. That doesn't seem like much, but you can pay a 30-year mortgage off in about 25 years with this strategy. (See: Bankrate's Biweekly Mortgage Payment Calculator.)

Knowing how mortgage interest works can help you make decisions about what kind of loan to take out, and how to pay it down. Choosing to pay down your loan balance helps you build equity faster1. Should you want or need to sell, you'll walk away with more cash.


  1. Equity is the value of your home less the loan balance on your mortgage.