Methodology

How the numbers on this site are calculated, rounded, tested, and corrected.

This page describes how a conversion on this site is actually computed, so you can judge the results rather than trust them. It is written to be checkable: every claim here corresponds to something in the codebase or the test suite.

Base units and factors

Each measurement category has exactly one base unit — the metre for length, the kilogram for mass, the kelvin for temperature, the pascal for pressure, and so on. Every other unit in the category stores its ratio to that base and nothing else.

A conversion is therefore always two steps: the input value is converted to the base unit, then from the base unit to the target. This costs one extra multiplication and buys a single source of truth. The alternative — storing a factor for every pair — would mean thousands of numbers that could drift out of agreement with each other, and no way to notice when they had.

Where a unit has an exact definition, the exact value is stored. The inch is 0.0254 m exactly, the pound is 0.45359237 kg exactly, the US gallon is 231 cubic inches exactly, one standard atmosphere is 101,325 Pa exactly. These are definitions rather than measurements, so they carry no uncertainty and are never rounded in storage.

Linear and non-linear conversions

Most units are linear: a single multiplication converts them, because they share a zero point with the base unit. Two families do not.

Temperature

Temperature scales have different zero points, so they need an offset as well as a ratio. Each temperature unit stores an explicit pair of functions to and from the base scale rather than a factor, and the formulas are the standard ones — °F = (°C × 9/5) + 32, K = °C + 273.15, and so on.

Temperature differences behave differently: the offset cancels when you subtract two readings, so a 10 °C rise is an 18 °F rise, not 50 °F. The site keeps a separate temperature-interval category for exactly this reason rather than letting one converter silently serve both meanings.

Fuel economy

Fuel economy mixes distance-per-fuel measures (MPG, km/L) with fuel-per-distance measures (L/100km). These are reciprocals: as one rises the other falls. Converting between the two families inverts the value rather than scaling it, and the calculation guards against a zero input, which has no finite reciprocal.

Distinctions kept separate

A number of unit names are ambiguous in ordinary use. The dataset treats each meaning as a distinct unit rather than picking one:

  • US and Imperial gallons, quarts, pints and fluid ounces are different sizes — and the fluid ounce is the one case where the Imperial measure is the smaller.
  • Metric tons, US short tons and UK long tons are three different units.
  • Avoirdupois and troy ounces differ by about 10%.
  • Decimal storage units (kB, MB, GB) use powers of 1,000; binary units (KiB, MiB, GiB) use powers of 1,024.
  • Bits and bytes differ by a factor of eight, and network units are quoted in bits.
  • Mass (kilograms) and force (newtons, pounds-force) are different physical quantities in different categories.
  • Mechanical horsepower (745.6999 W), metric horsepower (735.49875 W) and electrical horsepower (746 W) are three separate units.
  • Temperature values are treated as absolute readings; intervals have their own category.

Floating point and display precision

Calculations run in IEEE 754 double precision, which is what JavaScript numbers are. That gives about 15–17 significant decimal digits — far more than any physical measurement — but it cannot represent most decimal fractions exactly, so a conversion and its inverse do not always return identical bits. The residual error is on the order of 10⁻¹⁶ relative.

The practical consequence is cosmetic: printing full precision would show trailing artefacts like 2.9999999999999996. The site therefore computes at full precision and rounds only the displayed value. Very large and very small results switch to scientific notation, and trailing zeros are trimmed. You can choose the number of decimal places shown; changing it re-formats the same underlying value rather than recomputing a rounded one.

Chained conversions round once, at the end. Rounding at each intermediate step is the most common way to accumulate avoidable error, and it is the subject of a separate guide.

Rounding

Display rounding uses round-half-away-from-zero, which is what a reader expects from a calculator. Statistical work often prefers round-half-to-even to avoid an upward bias across a large series; that distinction does not arise for a single displayed conversion, but it is worth knowing about if you are summing many rounded values.

Where a result is conventionally read as a fraction rather than a decimal — inches on a tape measure — the site also shows the nearest sixteenth and sixty-fourth, because 0.3937 in is not a number you can find on a rule.

Testing and verification

Nothing is published until the automated suite passes. It covers:

  • Known reference values. Fixed assertions against published figures — 1 inch = 2.54 cm, 0 °C = 32 °F, 1 US gallon = 3.785411784 L, and many more.
  • Round-trip stability. Converting a value out and back returns the original within a tight tolerance, for every unit in every category.
  • Edge cases. Zero, negative values, very large and very small magnitudes, and the non-linear temperature and fuel-economy paths.
  • Data integrity. Every category has a base unit that exists, no duplicate unit ids or symbols within a category, and no unit that declares both a factor and a conversion function.
  • Content and SEO integrity. Every conversion page listed as core has hand-written content; no page marked non-indexable appears in a sitemap; canonicals carry no query strings; structured data parses as valid JSON; and no internal link points at a page that does not exist.

These run as npm run verify before any deployment, alongside a production build, an SEO audit of the generated HTML, and an internal link check across every built page.

How errors are corrected

  1. A report arrives through the contact page, ideally with the conversion, the expected value, and a source.
  2. The factor is checked against the published definition — the standards body's own document, not another converter.
  3. If the stored value is wrong, it is corrected in the unit dataset, which fixes every page and every direction at once because there is only one copy of it.
  4. A regression test is added asserting the correct value, so the error cannot silently return.
  5. The review date on affected pages is updated, and the change is recorded in the project changelog.

What this site does not do

It does not give professional advice. A converted pressure is not a substitute for a manufacturer's specification and a calibrated gauge; a converted body weight is not a substitute for a clinician's dosing calculation; a converted material strength is not a substitute for an engineering standard. Pages that touch those areas say so explicitly, and the disclaimer sets out the general position.