ForHosting KIT · Finance & money

Mortgage total cost calculator

A 300,000 mortgage at 6.5% over 30 years costs 682,633.47 in total: 382,633.47 of it is interest, 56.05% of everything you pay. Add an extra monthly amount to see the interest and months it saves. Free in your browser.

  • Free
  • Runs in your browser
  • No sign-up
  • Your data stays on your device
Use it from WebAPIEmailTelegramApp soon
If you enter
Principal amount
300,000
Annual rate
6.5
Term years
30
You get
Term months
360
Extra monthly
0
Monthly rate
0.00541667
Monthly payment
1,896.2

A mortgage total cost calculator answers the question a monthly payment figure hides: if I borrow this principal at this rate for this many years, how much money will actually leave my account before the loan is gone? The advertised installment is only the pace of repayment. The complete cost of borrowing is the sum of every principal dollar returned to the lender plus every interest dollar charged along the way. This tool takes the loan amount, the nominal annual rate as a percent, the term in whole years, and an optional extra monthly principal, then walks the amortizing schedule to maturity or earlier payoff. It returns the scheduled payment, the actual number of payments, total principal repaid, total interest, and the lifetime total cost, plus the interest and months saved when extra principal is applied. Zero-rate loans are treated as a clean principal split.

How the lifetime mortgage cost is calculated

A fixed-rate fully amortizing mortgage charges interest on the remaining principal each month and applies one level installment so the balance is designed to reach zero on the last contractual payment. When r is positive, the scheduled payment M equals principal times r times (1 plus r) to the n, all divided by ((1 plus r) to the n minus one). That identity is the ordinary annuity formula used by first-mortgage servicers.

When the annual rate is exactly zero, the formula would divide by zero, so the engine falls back to principal divided by n and total interest is zero. The scheduled lifetime cost is M times n, and scheduled interest is that product minus principal. Those two figures are what you would pay if every installment is exactly M and you never send extra principal.

The calculator does not stop there. Total cost is the sum of those two running totals — the complete cost of borrowing over the mortgage's full life, or over the shorter life created by extra principal.

When the lifetime cost of a mortgage matters

Homebuyers comparing a fifteen-year note to a thirty-year note need the lifetime cash leaving the household, not only the lower thirty-year installment that makes the longer loan look cheaper month to month. Loan officers and marketplace sites embed the same lifetime-cost walk so a shopper can see how much extra principal would have to be sent each month to match a shorter term without refinancing. Failed validation does not consume balance.

Keep requests small, pin the rounded currency fields in tests, and you get stable lifetime-cost math for widgets, quote checkers, and edge workers without standing up a full loan-origination system of your own.

Why is total cost so much higher than the amount I borrowed?

You repay the full principal and you also pay interest on the declining balance every month.

Does the total cost include taxes, insurance or fees?

No. It covers principal and interest only. Origination fees, discount points, mortgage insurance, property tax and insurance escrow are left out, so add them separately when you budget for the home.

How does extra monthly principal change the total cost?

The extra amount is paid every month on top of the scheduled installment, so the balance falls faster. The loan ends sooner, total interest drops, and the result shows the interest and the months saved against the original schedule.

What happens with a zero interest rate?

Each payment is the amount borrowed divided by the number of months, total interest is zero and the total cost equals the principal. The calculator handles this case directly instead of failing.

How should I enter the rate and the term?

Enter the annual rate as a percent, 6.5 for six and a half percent rather than 0.065, and the term in whole years from 1 to 50. The years are turned into months for the schedule.

Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.

POSThttps://api.kit.forhosting.com/finance/mortgage-total-cost

Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.

curl -X POST https://api.kit.forhosting.com/finance/mortgage-total-cost \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"principal":300000,"annual_rate":6.5,"term_years":30}'
{
  "principal": 300000,
  "annual_rate": 6.5,
  "term_years": 30
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "finance.mortgage_total_cost",
  "status": "queued",
  "_links": {
    "result": "/tasks/tsk_…/result"
  }
}

The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.

Per request$0.002

Published price — no tokens, no invented credits. A failed task is never charged.

HTTPCodeMeaning
401unauthorizedMissing or invalid API key.
402insufficient_balanceYour balance doesn't cover the task price.
404unknown_typeThat task type doesn't exist.
429rate_limitedToo many requests. Use the webhook instead of polling.

How the lifetime mortgage cost is calculated

Convert the quoted annual rate into a monthly rate r equal to annual_rate divided by one hundred divided by twelve, and let n be term_years times twelve. It then walks the month-by-month schedule: each period it charges interest on the current balance, applies M plus any extra_monthly you supplied, treats the last payment as the residual payoff, and accumulates the principal portion and the interest portion separately.

Input contract, extra principal, and validation

A three-hundred-thousand principal at six and a half percent for thirty years is the classic illustration that lifetime interest can rival the amount borrowed; adding a few hundred of extra principal each month cuts years and a large slice of interest without changing the note rate. The calculator does not model origination fees, discount points, mortgage insurance, property tax, insurance escrow, or a recast of the contractual payment; those belong in dedicated tools. POST a JSON body with three required fields and one optional field. principal is the amount borrowed in currency units and must be a finite number greater than zero. annual_rate is the nominal APR as a percent — use 6.5 for six and a half percent, not 0.065 — and must be a finite number between zero and one hundred inclusive. term_years is the contractual term as a positive whole number between 1 and 50; typical first mortgages are 15, 20, or 30 years, and the engine converts years to months as term_years times twelve. extra_monthly is optional extra principal on top of the scheduled installment; omit it or send 0 to pay exactly as written, or send a positive amount to model a biweekly-style or recast-free extra principal habit. Missing fields, non-finite values, non-positive principal, a non-integer or out-of-range term, a negative rate, and an extra payment that still fails to cover the first month's interest fail with invalid_input naming the problem and are not billed. On success the body echoes the inputs; returns monthly_payment and payment_with_extra; payments_made as the actual count until payoff; total_principal, total_interest, and total_cost as the lifetime sums; scheduled_total_cost and scheduled_interest as the no-extra baseline; interest_saved and months_saved as the benefit of extra principal; and interest_share as the percent of total_cost that is interest.

Where a mortgage total cost API earns its keep

Underwriting scripts, counseling desks, and classroom finance lessons batch many principals, rates, terms, and extra amounts through the JSON API when they need a deterministic oracle rather than a spreadsheet cell that silently uses a different compounding convention.

See the true cash cost of a 15- versus 30-year note

Enter the same principal and rate with term_years of 15 and of 30 and compare total_cost and interest_share before the lower thirty-year installment hides how much extra interest the longer life actually charges.

Measure what extra principal is worth

Add a planned extra_monthly amount to a thirty-year quote and read interest_saved and months_saved to decide whether a few hundred a month is cheaper than refinancing into a shorter term.

Batch counseling and quote audits

Call the JSON API with many principal, rate, term, and extra triples when counseling desks or origination scripts need a deterministic lifetime-cost oracle instead of a private amortization sheet.

How do I calculate the total cost of a mortgage?

Send principal (amount borrowed), annual_rate as a percent (e.g. 6.5), and term_years as a whole number (e.g. 30). The API walks the amortizing schedule and returns total_principal, total_interest, and total_cost — the complete cash paid over the loan's life.

Does an extra monthly payment change the total cost?

Yes. extra_monthly is applied as additional principal each period, so the balance falls faster, fewer payments are made, and both total_interest and total_cost drop. interest_saved and months_saved quantify that benefit against the contractual schedule.

Is annual_rate a percent or a decimal fraction?

A percent. Use 6.5 for 6.5% APR, not 0.065. The engine divides by 100 and then by 12 to obtain the monthly rate used in the amortization walk.

What does the mortgage total cost calculator cost?

The browser tool is free. API requests use prepaid KIT balance at $0.002 per successful call; invalid input is not billed.

Read the full KIT documentation →