Health & Life Runs locally Ready to use Built-in examples No tracking

Mortgage Calculator

Calculate monthly payments, total interest and total repayment for annuity and linear mortgage methods. Runs locally in your browser.

Borrowing from a bank comes down to two numbers worth comparing: what is paid each month, and what is paid in total. With the same principal and rate, choosing a fixed monthly payment over one that declines month by month can differ by tens of thousands over ten years. Enter the amount, the rate and the term, and the monthly payment and the totals for both methods appear; change the rate and recalculate.

The essential difference between the two: an annuity keeps the payment fixed, with interest dominating the early instalments, costing more in total interest but with a steady monthly burden; a linear repayment declines every month, costing less interest overall but loading the early years. A steady income suits the annuity, a strong early repayment capacity suits linear; after a rate change, recalculate the remaining term at the new rate.

%

%

How to use

  1. Enter the loan amount, annual rate and term.
  2. Compare the monthly payment under both methods.
  3. Check the total interest and the total repayment.
  4. Recalculate the remaining term after any rate change.

How it works

Equal installment

Equal installment: the monthly payment is fixed. Payment = loan x monthly rate x (1 + monthly rate)^periods / ((1 + monthly rate)^periods - 1). For example 1,000,000 at 3.1% over 30 years: a payment of about 4,270.16, with total interest about 537,000.

Equal principal

Equal principal: each month repays a fixed principal plus interest on the remaining principal, so the payment declines monthly. Monthly principal = loan / periods; the first payment is highest and the last lowest, with less total interest than equal installment.

Comparing the two methods

Comparing the two: the same 1,000,000 over 30 years at 3.1% gives about 466,000 total interest under equal principal, about 70,000 less than equal installment (about 537,000), but with higher early payments (first month about 5,361 vs. 4,270).

Code example

JavaScript Equal instalments and equal principal

function loan(principal, annualRate, years) {
  const n = years * 12, r = annualRate / 12;
  // Equal instalments: the monthly payment is fixed
  const m = principal * r * Math.pow(1 + r, n) /
            (Math.pow(1 + r, n) - 1);
  // Equal principal: first month = principal/n + outstanding*r, then falls by principal/n * r each month
  const first = principal / n + principal * r;
  const last = principal / n + (principal / n) * r;
  return { monthly: m, totalInterestAC: m * n - principal,
           firstBP: first, lastBP: last,
           totalInterestBP: principal * r * (n + 1) / 2 };
}

Python The same formulas in Python

def loan(principal, annual_rate, years):
    n, r = years * 12, annual_rate / 12
    m = principal * r * (1 + r) ** n / ((1 + r) ** n - 1)
    first = principal / n + principal * r
    return {"monthly_ac": m,
            "interest_ac": m * n - principal,
            "first_bp": first,
            "interest_bp": principal * r * (n + 1) / 2}

loan(1_000_000, 0.031, 30)   # monthly ≈ 4270, total interest ≈ 537,000

FAQ

Which is better, equal installment or equal principal?

Equal principal pays less total interest but with more early-payment pressure. If your current income is high or you plan to prepay, equal principal saves more; if early cash flow is tight and the funds have higher-yield uses, equal installment fits better. Comparing "total interest" alone isn't the whole story — consider the time value of money.

What share of income should the payment be?

Banks usually require the payment to be no more than 50% of monthly income, but a steadier rule of thumb is under 30%, leaving room for unemployment, illness and other contingencies.

How is prepayment computed?

Prepayment repays the remaining principal, and later interest is recomputed on it. Equal installment repays mostly interest early, so if you plan to prepay, the earlier the more interest saved. Some banks set conditions on timing or amount — follow the loan contract.

How is the monthly payment computed?

Equal installment: payment = loan x monthly rate x (1 + monthly rate)^periods / [(1 + monthly rate)^periods - 1], fixed each month with a high early interest share. Equal principal: monthly principal = loan / periods, interest on the remaining principal, declining payment.

Does the payment change after a rate cut?

Yes. Mortgages using a floating LPR rate are usually adjusted at the annual repricing date by the latest LPR, then recomputed on the remaining principal and periods; fixed-rate loans are unaffected. Housing-fund rate changes usually take effect January 1 of the next year, per the bank and local housing-fund center.

Can commercial and housing-fund loans use the same formula?

Yes. Both use the same equal-installment / equal-principal formulas, differing only in rate and limit: housing-fund rates are clearly lower but capped. A combination loan needs the two parts computed separately and the payments and interest added.

Is a longer term better?

A longer term lowers the payment and eases early cash flow but raises total interest; a shorter term reduces total interest but pressures the payment. The test is keeping the payment under 30-50% of household income with enough emergency funds, not comparing total interest alone.

Is data like loan amount and rate safe?

Yes. The mortgage projection runs entirely locally; the loan amount, rate and term aren't uploaded, and the server only sends page code. History stays in your browser and is clearable in one click; for no trace, use incognito mode and close when done.