How the Density Converter Works
AnyTool Density Converter performs every calculation in the browser. Each unit declares a single linear factor relative to a shared kilogram-per-cubic-metre base — the exact number of kg/m³ in one of that unit — so any unit converts to any other through kg/m³ without an N-by-N table. The metric factors are exact by definition (1 g/cm³ = g/mL = kg/L = t/m³ = 1000 kg/m³, 1 g/L = 1 kg/m³, 1 mg/L = 0.001 kg/m³), and the US/Imperial factors come from the exact dimensional constants: a pound is 0.45359237 kg, a foot 0.3048 m, an inch 0.0254 m, a US gallon 0.003785411784 m³ and a slug 14.59390294 kg. A value is multiplied to kg/m³ and then divided into the target unit.
- Twelve units spanning SI metric, metric non-SI and US/Imperial
- kg/m³ is the shared base; every unit is one exact linear factor
- Conversion is value to base to value, so any unit maps to any other
- Editing either field converts both directions live
- All arithmetic is client-side JavaScript — no server round-trip
