Inspectable Arithmetic for the Mortgage Calculator
Version 1.0
Last updated: February 2026
Transparent arithmetic is the operating system of this calculator.
This document publishes the formulae, computational structure, and assumptions used to generate the outputs displayed on the calculator page.
No opinions. No hidden assumptions. Just arithmetic.
Purpose
This calculator models fixed-rate mortgage amortization under constant interest assumptions. It computes payment amounts by frequency, an amortization schedule, total interest paid, total paid, and payoff time.
Definitions
Let:
- H = home price
- D = down payment
- L = H − D = loan amount (principal)
- r = nominal annual interest rate (APR, as entered)
- n = payments per year (12, 26, or 52 depending on frequency)
- T = amortization period in years
- N = nT = number of payment periods implied by the amortization period and payment frequency
- rp = r/(100n) = periodic interest rate
- Pm = standard monthly payment (monthly schedule basis)
- P = payment amount for the selected frequency
- Bt = outstanding balance after payment t
Formulae
1. Loan Amount
L = max(0, H − D)
Down payment may be entered as a dollar amount or a percentage of home price.
2. Standard Monthly Payment (Base Payment)
If r = 0:
Pm = L / (12T)
Otherwise:
Pm = L · rm / (1 − (1 + rm)−12T)
where rm = r / (100 · 12)
Rationale: This is the standard fixed-rate fully amortizing payment formula for a monthly schedule.
Limitation: Assumes constant APR and constant amortization horizon.
3. Payment Amount by Frequency
Payment frequency options and payment amount conventions:
Monthly (12/yr):
P = Pm
Bi-weekly (26/yr), “standard”:
P = Pm · 12/26
Weekly (52/yr), “standard”:
P = Pm · 12/52
Accelerated bi-weekly (26/yr):
P = Pm / 2
Accelerated weekly (52/yr):
P = Pm / 4
Rationale: Standard weekly/bi-weekly payments scale the monthly payment to preserve the same annual payment total. Accelerated schedules increase the annual payment total by using the “monthly fraction” convention (monthly/2 or monthly/4).
Limitation: This models payment amount conventions, not lender-specific billing rules.
4. Periodic Interest and Principal
Periodic rate uses the selected payment frequency:
rp = r / (100n)
For each payment period t ≥ 1:
Interestt = Bt−1 · rp
Principalt = P − Interestt
Limitation: Uses simple APR division by payment frequency. It does not apply jurisdiction-specific compounding conventions (for example, Canadian mortgage rates are typically quoted as nominal rates compounded semi-annually and then converted to payment-period rates). This simplified calculator treats the entered APR as directly divisible by the payment frequency unless a jurisdiction-specific conversion is implemented elsewhere.
5. Balance Update
Bt = Bt−1 − Principalt
with B0 = L
If Principalt > Bt−1, the principal portion is capped at Bt−1 so the balance does not go negative (final-payment clamp).
6. Total Interest Paid and Total Paid
TotalInterest = Σ Interestt
TotalPaid = L + TotalInterest
7. Payoff Time
If the loan amortizes successfully, payoff time in years is:
PayoffYears = (number of payments made) / n
Assumptions
- The entered interest rate is treated as a nominal annual APR and converted to a periodic rate by dividing by payments per year.
- Interest rate remains constant over the modeled horizon.
- Payments occur at the selected frequency and remain constant under the payment convention listed above.
- No prepayments, lump sums, refinancing, mortgage insurance, taxes, or penalties are modeled.
- The amortization schedule is simulated period-by-period until the balance reaches zero (subject to rounding).
- Rounding occurs at the display layer; internal calculations use floating-point arithmetic.
Implementation Notes
- Payment amount is derived from a monthly base payment and then converted to the selected frequency using the formulas above.
- The amortization schedule uses the selected frequency’s periodic rate rp = r/(100n).
- The calculator detects non-amortizing inputs (when P ≤ B0 · rp) and returns an error state rather than producing a schedule.
- Tiny negative balances caused by floating-point error are clamped to zero.
If any discrepancy is identified between this documentation and the calculator output, the arithmetic here governs.