Most unit conversions are linear. Pick a category base unit (meters for length, kilograms for mass, liters for volume), convert your value into that base, then convert out to the target unit.
The factor method
- Look up how many base units equal one of your starting units.
- Multiply your value by that factor to get the base amount.
- Divide by the target unit's factor to finish the conversion.
Example: 10 centimeters → meters → inches. 10 × 0.01 = 0.1 m, then 0.1 / 0.0254 ≈ 3.937 inches. UnitNest does this for you with factorToBase values in a shared registry.
Temperature is special
Celsius, Fahrenheit, and Kelvin are related by affine transforms (a scale and an offset), not a single multiply. Formulas:
°F = (°C × 9/5) + 32°C = (°F − 32) × 5/9K = °C + 273.15
Digital storage prefixes
UnitNest uses binary (1024-based) prefixes for KB/MB/GB/TB — common in operating systems and developer tooling. Marketing "decimal GB" (1000³) can differ slightly; check your context.