Skip to content
NNumvella

Methodology

A calculator is only worth using if you can check its answers. This page explains how Numvella's 43 calculators are built, how formulas are chosen, what the automated tests do and do not prove, and how rounding, units, and edge cases are handled.

How formulas are selected

Most of these tools implement standard definitions — what a percentage is, how a mean is computed, how pace relates distance to time. For those, the formula is the definition, and the table below states it directly.

Some calculators depend on a formula that was published by specific people, or on a threshold set by an organisation, or on a convention that varies between countries. Those are different: they can be revised, they can be contested, and they can be wrong for a particular person. Where a calculation rests on an external standard rather than on arithmetic, the calculator's own page names what it is using, and the editorial policy explains how those sources are chosen.

How the calculation logic is implemented

Every calculation runs in a single, framework-free calculation engine — plain functions with no interface code, no network calls, and no shared mutable state. The live tool and the automated tests call the same functions, so the tests exercise the behaviour you actually get in the browser. Each tool also shows the formula it used and a worked example, so any result can be checked by hand.

What the automated tests do — and do not — prove

The suite currently contains 509 automated tests across 39 files, all passing. Of those, 290 exercise calculation or number-formatting logic across 34 files; the remaining 219 check structural things like the calculator registry, internal links, and search behaviour rather than arithmetic.

A subset of calculations is additionally pinned by golden-value regression tests — fixed inputs with known-correct outputs that fail the build if a refactor ever changes a formula silently. These run on every change and weekly in CI.

Coverage is not uniform. The engine exports 85 functions, of which 80 are referenced by at least one test. The 5 that are not are: amountOfPercent, cryptoRandomInt, formatMoney, inToM, toDateInputValue. They are used in supporting roles rather than as a calculator's primary formula, but we would rather list them than round the claim up.

Two caveats on that number, both of which make it less impressive than it looks. First, “referenced by a test” only means the function is named somewhere in the test suite — it is a weaker statement than every branch of that function being exercised, and we do not currently publish a line-coverage figure. Second, the engine also exports 14 shared constants (unit-conversion factors, grade tables, activity multipliers); only 1 is named directly in a test. The rest are exercised indirectly whenever a function that uses them runs, but they have no test of their own, so an error in one of those values would not be caught by name.

What the tests establish is that the code computes the formula it is meant to compute, including at awkward inputs. What they cannot establish is that the formula is the right one for your situation, or that a published standard is still current. Those are questions about suitability, not arithmetic, and no test suite answers them.

Correctness and suitability are different things

A calculator can be arithmetically perfect and still give you a number you should not act on, because every formula carries assumptions about who or what it applies to. A body-composition estimate built from population averages says little about an individual athlete; a payment schedule assumes a fixed rate and no fees. Throughout this site we try to keep the two apart: whether the math is right, and whether it is the right math for you.

Rounding and precision

Computers represent decimals in binary (IEEE-754), so naïve arithmetic produces artifacts like 0.1 + 0.2 = 0.30000000000000004. Full precision is kept throughout the calculation and rounding is applied only for display, so totals add up and money shows to the cent. Rounding behaviour is itself covered by tests.

Units

Where a calculator accepts more than one unit system, conversion happens once, on input, into a single internal unit; the math then runs in that unit and results are converted back for display. This avoids mixed-unit errors part-way through a calculation. Tools that depend on a unit choice — pace, BMI, square footage — label the unit on both the input and the result rather than leaving it implied.

Edge cases and invalid input

Inputs are validated before any math runs. Where a calculation is undefined — division by zero, a percentage change measured from zero, a negative distance — the engine returns no result and the page explains why, rather than displaying NaN, Infinity, or a misleading zero. Zero, negative values, very large and very small magnitudes, and calendar quirks such as leap years are covered by tests for the calculators where they apply.

Formulas & sources

We use standard, widely accepted definitions from mathematics, accounting, finance, and public health. Each tool's page documents its own formula; here is a reference to the core formulas:

CalculatorFormulaBasis
Percentage of a number(percent ÷ 100) × valueDefinition of percent (per hundred).
What percent of(part ÷ whole) × 100Definition of percent.
Percentage change((new − old) ÷ old) × 100Relative change vs. the original value.
Discount / Sales Tax / VATamount × (rate ÷ 100); reverse: ÷ (1 + rate ÷ 100)Standard percentage arithmetic.
Tipbill × (tip% ÷ 100), split by peopleStandard percentage arithmetic.
Profit margin / markupmargin = profit ÷ revenue; markup = profit ÷ costStandard accounting definitions.
Average (mean / median)mean = sum ÷ count; median = middle of sorted valuesDescriptive statistics.
GPAΣ(grade points × credits) ÷ Σ(credits)US unweighted 4.0 scale (A = 4.0 … F = 0.0).
Fraction → decimalnumerator ÷ denominatorA fraction is a division; terminates when the reduced denominator's only prime factors are 2 and 5.
Ratiodivide both terms by their GCD; a : b = c : x → x = b·c ÷ aGreatest common divisor; cross-multiplication.
BMIweight (kg) ÷ height (m)² (×703 for lb/in)WHO body mass index; adult categories 18.5 / 25 / 30.
Compound interestA = P(1 + r/n)^(nt) + contributionsStandard compound-interest formula; Rule of 72 for doubling time.
Hours between times(end − start) in minutes ÷ 60Minute arithmetic; overnight shifts wrap past midnight.
Date difference / addwhole days between dates; start date ± daysCalendar-correct, leap-year aware, local time.
Commissionsale × (rate ÷ 100) + base payStandard percentage arithmetic.
Percent error(|measured − actual| ÷ |actual|) × 100Magnitude of deviation from an accepted true value.
Standard deviationσ = √(Σ(x − mean)² ÷ N); sample s uses N − 1Descriptive statistics; Bessel's correction for samples.
TDEE / BMRBMR = 10·kg + 6.25·cm − 5·age + s; TDEE = BMR × activityMifflin–St Jeor equation (s = +5 male, −161 female); activity factor 1.2–1.9.
Mortgage / Loan paymentM = P·r(1+r)^n / ((1+r)^n − 1)Standard fixed-rate amortization; r = annual rate ÷ 12, n = months. 0% → P ÷ n.
PMI drop-offloan balance ≤ 80% × home priceConventional-loan standard; PMI applies when the down payment is under 20%.
Home affordability (28/36)PITI ≤ 28% income; PITI + debts ≤ 36% incomeLender debt-to-income ratios; max home price back-solved from the binding limit.

Finance calculators

Our mortgage, loan, auto-loan, and amortization tools share one tested engine built on the standard fixed-rate amortization formula:

M = P · r(1 + r)^n / ((1 + r)^n − 1)

where M is the monthly payment, P is the loan principal, r is the monthly interest rate (annual rate ÷ 12), and n is the total number of monthly payments. At a 0% rate the payment is simply P ÷ n. Each month, interest is charged on the outstanding balance and the remainder reduces principal; the final payment is adjusted to the cent so the balance reaches exactly zero. Extra payments are applied entirely to principal, ending the schedule early.

PMI drop-off: Private Mortgage Insurance applies when the down payment is under 20% of the home price, and is removed once the loan balance reaches 80% of the original home value (the conventional-loan standard). Home affordability uses the lender 28/36 debt-to-income rule: housing costs (PITI) are capped at 28% of gross monthly income (front-end ratio) and total debt including housing at 36% (back-end ratio); the maximum home price is back-solved from whichever limit binds first.

All calculations use IEEE 754 double-precision arithmetic, with figures rounded to the cent for display. These tools are estimates for educational use and are not financial advice — see each tool's disclaimer.

Privacy by design

All computation happens in your browser. The numbers you enter are never uploaded, logged, or stored on a server. Some calculators remember your last inputs in your browser's local storage so you can pick up where you left off, and your inputs can be encoded into a shareable link — both stay on your device until you choose to share a link. See our Privacy Policy for details.

Important: estimates, not advice

Numvella is built for general and educational use, and its results are estimates. It is not financial, tax, accounting, medical, or legal advice. BMI in particular is a screening number, not a diagnosis. For decisions that matter, verify critical figures independently or consult a qualified professional. See our Terms of Use.

Found a mistake?

If a result looks wrong, send the inputs you used and the result you expected to hello@numvella.com. Because calculations run in your browser, we have no record of what you entered, so those details are what make a report reproducible. Our corrections policy sets out how reports are investigated and how confirmed errors are fixed. You can also browse everything on the calculators page.