Skip to content
TrueScalers

Methodology

Every formula on TrueScalers is implemented from a named authority rather than from memory, held in a pure function with no dependency on the interface, and covered by unit tests asserting known-correct values and boundary conditions. This page lists the derivation and the source for each of the 40 tools, and the 95 references they collectively rely on.

How a calculation reaches the site

  1. 01

    Locate the authoritative definition

    The formula is taken from a standards body, a regulator, or the original peer-reviewed publication — never from another calculator site. Where a method is named after its authors, such as Mifflin-St Jeor or the Hodgdon-Beckett circumference equations, the original paper is the reference.

  2. 02

    Implement it as a pure function

    The calculation is written in TypeScript in lib/calc/, taking plain numbers and returning plain numbers, with no React and no interface concerns. Special cases that the closed form cannot express — a zero interest rate, a month shorter than the start date — are handled explicitly rather than left to produce a NaN.

  3. 03

    Test against known values and edge cases

    Each function is tested against figures that can be verified independently, plus boundary conditions and inverse round-trips. A savings-goal deposit, for example, is fed back through the forward compounding formula and must land on the original target.

  4. 04

    Write the content from the working code

    The worked example on each tool page uses figures produced by the same function the tool runs, so the number in the prose and the number in the widget cannot disagree. Automated checks enforce that every FAQ is self-contained, every source uses HTTPS, and every internal link resolves.

  5. 05

    Date it and review it quarterly

    The visible review date is the date the formula and its sources were last verified. Where a source is itself revised — a tax rate, a clinical threshold, an RFC superseded by a newer one — the page is updated and the date moves with it.

Rounding, precision and units

Rounding happens once, at display time
All intermediate arithmetic is carried at full double precision, and rounding is applied only to the value shown. Rounding at each step compounds error — an amortization schedule rounded to cents every month drifts by several dollars across a 30-year term.
Conversion factors are exact where a definition exists
One inch is exactly 25.4 millimetres and one pound is exactly 0.45359237 kilograms by the 1959 international yard and pound agreement. Those conversions carry no approximation. Every unit is stored as a factor to a single base unit, so a conversion is one multiply and one divide with no chained error.
Dates are computed in UTC
Calendar arithmetic runs entirely in Coordinated Universal Time. Local-time arithmetic makes two days a year 23 and 25 hours long, and a naive division by 24 hours then produces off-by-one errors across any span containing a daylight-saving transition.
Randomness comes from the Web Crypto CSPRNG
Generators draw from crypto.getRandomValues, seeded by operating-system entropy, rather than Math.random — whose internal state can be recovered from a modest number of observed outputs. The first server-rendered paint uses a fixed deterministic seed so that hydration matches; the browser re-draws from the secure source immediately after mount.

The formula behind every tool

Each entry gives the expression the tool evaluates. Follow the link for the variable definitions, the worked example and the specific citations.

Calculators

Percentage calculator
result = (X ÷ 100) × Y change = ((Y − X) ÷ |X|) × 100
Reviewed · Encyclopædia Britannica
Mortgage calculator
M = P × [r(1 + r)ⁿ] ÷ [(1 + r)ⁿ − 1]
Reviewed · US Consumer Financial Protection Bureau
Loan calculator
M = P × [r(1 + r)ⁿ] ÷ [(1 + r)ⁿ − 1]
Reviewed · US Consumer Financial Protection Bureau
Car payment calculator
P = price + sales tax − down payment − trade-in; M = P × [r(1 + r)ⁿ] ÷ [(1 + r)ⁿ − 1]
Reviewed · US Consumer Financial Protection Bureau
Compound interest calculator
A = P(1 + r/n)^(nt) + PMT × [((1 + r/n)^(nt) − 1) ÷ (r/n)]
Reviewed · US Securities and Exchange Commission
Savings goal calculator
PMT = (FV − P(1 + r)ⁿ) × r ÷ ((1 + r)ⁿ − 1)
Reviewed · US Federal Deposit Insurance Corporation
Tip calculator
tip = bill × (p ÷ 100); total = bill + tip; share = total ÷ people
Reviewed · US Department of Labor
Discount calculator
sale = price × (1 − d₁ ÷ 100) × (1 − d₂ ÷ 100); saved = price − sale
Reviewed · US Federal Trade Commission
Sales tax calculator
gross = net × (1 + rate ÷ 100); net = gross ÷ (1 + rate ÷ 100)
Reviewed · Supreme Court of the United States
BMI calculator
BMI = weight(kg) ÷ height(m)² BMI = 703 × weight(lb) ÷ height(in)²
Reviewed · World Health Organization
Calorie calculator
BMR = 10w + 6.25h − 5a + k TDEE = BMR × activity factor
Reviewed · Mifflin et al., American Journal of Clinical Nutrition, 1990
Body fat calculator
men: 495 ÷ (1.0324 − 0.19077·log₁₀(waist − neck) + 0.15456·log₁₀(height)) − 450 women: 495 ÷ (1.29579 − 0.35004·log₁₀(waist + hip − neck) + 0.22100·log₁₀(height)) − 450
Reviewed · Hodgdon and Beckett, Naval Health Research Center, 1984
Age calculator
age = whole years elapsed, then whole months, then remaining days
Reviewed · US National Institute of Standards and Technology
Date duration calculator
days = (end − start) ÷ 86,400,000 ms, computed in UTC
Reviewed · International Organization for Standardization
Grade calculator
G = Σ(scoreᵢ × weightᵢ) ÷ Σweightᵢ needed = (target − G × (1 − w)) ÷ w
Reviewed · US National Center for Education Statistics
GPA calculator
GPA = Σ(grade pointsᵢ × creditsᵢ) ÷ Σcreditsᵢ
Reviewed · US National Center for Education Statistics

Converters

Length converter
result = value × (factor_from ÷ factor_to)
Reviewed · Bureau International des Poids et Mesures
Weight converter
result = value × (factor_from ÷ factor_to)
Reviewed · Bureau International des Poids et Mesures
Temperature converter
°F = °C × 9/5 + 32 °C = (°F − 32) × 5/9 K = °C + 273.15
Reviewed · Bureau International des Poids et Mesures
Speed converter
result = value × (factor_from ÷ factor_to)
Reviewed · Bureau International des Poids et Mesures
Data storage converter
decimal: 1 kB = 1000 B binary: 1 KiB = 1024 B result = value × (factor_from ÷ factor_to)
Reviewed · International Electrotechnical Commission
Volume converter
result = value × (factor_from ÷ factor_to)
Reviewed · US National Institute of Standards and Technology

PDF tools

Merge PDF
output pages = Σ pages(fileᵢ) output size = Σ size(fileᵢ) − shared resources
Reviewed · International Organization for Standardization
Split PDF
selection = union of ranges, clamped to 1…n and deduplicated; parts = ⌈n ÷ k⌉
Reviewed · International Organization for Standardization
Compress PDF
pixels per page = (width_pt ÷ 72 × DPI) × (height_pt ÷ 72 × DPI); size = pixels × bytes-per-pixel(quality)
Reviewed · International Organization for Standardization
Images to PDF
scale = min((W − 2m) ÷ w, (H − 2m) ÷ h); x = (W − w·scale) ÷ 2, y = (H − h·scale) ÷ 2
Reviewed · International Organization for Standardization

Image tools

Image resizer
scale = min(maxW ÷ w, maxH ÷ h); w′ = round(w × scale), h′ = round(h × scale)
Reviewed · WHATWG HTML Standard
Image compressor
find the largest quality q between 0.30 and 0.95 for which size(q) fits within target
Reviewed · Joint Photographic Experts Group
Image converter
decode(source) → pixel buffer → encode(target, quality)
Reviewed · Google

Generators

QR code generator
modules = 4 × version + 17, version from 1 to 40
Reviewed · International Organization for Standardization
Password generator
E = L × log₂(R)
Reviewed · US National Institute of Standards and Technology
Random number generator
X = min + ⌊U × (max − min + 1)⌋, U uniform on [0, 1)
Reviewed · World Wide Web Consortium
UUID generator
xxxxxxxx-xxxx-4xxx-Nxxx-xxxxxxxxxxxx where N is one of 8, 9, a or b
Reviewed · IETF

Developer tools

JSON formatter
JSON.parse(text) → value → JSON.stringify(value, null, indent)
Reviewed · IETF
Base64 encoder
encoded length = 4 × ⌈n ÷ 3⌉, overhead is 33.3%
Reviewed · IETF
URL encoder
unreserved = A–Z a–z 0–9 - _ . ~ everything else → %XX per UTF-8 byte
Reviewed · IETF
Hash generator
digest = SHA-n(message); |digest| = n bits = n ÷ 4 hex characters
Reviewed · US National Institute of Standards and Technology
Regex tester
new RegExp(pattern, flags).exec(subject) repeatedly until null
Reviewed · Ecma International, TC39

Text tools

Word counter
words = whitespace-separated tokens reading minutes = words ÷ 238
Reviewed · Brysbaert, Journal of Memory and Language, 2019
Case converter
tokenise on word boundaries → apply the target case rule → rejoin with the target separator
Reviewed · Unicode Consortium

All references

The 95 sources every calculation on this site is derived from, grouped by publisher.

Last reviewed: