Our Methodology

Accuracy is UnitSwap's most important feature. This page documents how we source conversion factors, handle precision, manage rounding, and deal with non-linear scales like temperature.

Conversion Factor Sources

Every conversion factor in UnitSwap is derived from or cross-referenced against authoritative international standards bodies. We prioritize exact values where they exist (e.g., 1 inch = 2.54 cm exactly by international agreement) and use best-available precision for empirical constants.

NIST SP 811

NIST Guide to the SI and US customary units — primary reference for all SI conversions.

BIPM SI Brochure

The official SI system documentation from the Bureau International des Poids et Mesures.

ISO 80000

International standard series for quantities, units, and their mathematical signs.

CODATA 2018

The 2018 CODATA recommended values of fundamental physical constants.

FAA Aeronautical Information Manual

Aviation-specific measurement standards including altitude, speed, and pressure units.

Calculation Architecture

UnitSwap uses a base-factor conversion engine. Every unit in a category is expressed as a multiplier relative to a designated base unit. For example:

// Length base unit: meter

kilometer: 1000 (× meters)

mile: 1609.344 (× meters)

inch: 0.0254 (× meters)

foot: 0.3048 (× meters)

To convert from Unit A to Unit B: result = value × (A_factor / B_factor)

This two-step approach (to base, then to target) ensures consistency and allows any-to-any conversions within a category without maintaining an exponentially growing lookup table.

Special Cases: Non-Linear Scales

Temperature is handled separately because Celsius, Fahrenheit, and Kelvin are offset scales — not simple multipliers. We use exact formulas:

°C to °F: (°C × 9/5) + 32

°F to °C: (°F − 32) × 5/9

°C to K: °C + 273.15

K to °C: K − 273.15

Fuel Economy (L/100km) is an inverse relationship — higher values mean less efficiency, opposite to MPG. We apply: L/100km = 235.214 / MPG

Logarithmic scales (e.g., decibels) are handled with appropriate log-based formulas when applicable.

Precision & Rounding Rules

We use JavaScript's 64-bit floating-point arithmetic (IEEE 754 double precision), which provides approximately 15–17 significant decimal digits of precision.

Display rounding follows these rules:

  • Results ≥ 1,000: displayed with locale-aware number formatting (e.g., 1,234.56)
  • Results between 0.001 and 999: displayed to 4–6 significant figures
  • Results < 0.001: displayed in scientific notation (e.g., 1.234 × 10⁻⁵)
  • Exact integer results: displayed without unnecessary decimal places

Conversion tables use consistent significant figures across the displayed range for easy comparison.

Reporting Inaccuracies

If you believe a conversion factor or formula on UnitSwap is incorrect, please report it via our Contact page. Include the specific conversion, the value you expect, and your source. All reports are reviewed by our team within 5 business days.