Tools/units/convert

units/convert

Convert a numeric value from one unit of measurement to another.

Free / no pricing configured

What it does

Converts a value from a source unit to a target unit and returns the result, the physical dimension, and a formatted string. Conversions are exact and dimension-checked: converting between incompatible dimensions (e.g. mass to length) is rejected rather than guessed.

Primary use cases

  • Length, mass, temperature, area, volume, speed, data-size, energy, pressure, power, and angle conversions.
  • Normalizing measurements between metric and imperial.
  • Any "X in unit A is how many of unit B" question.

Good to know

Units are written by name (e.g. mile, kilogram, degree_Celsius, kilometer/hour). Compound and SI-prefixed units are supported (e.g. meter**2, MB). Use list_units to discover valid names. Distinct from currency, which handles money. Computed locally.

Parameters

valuenumberrequired

The numeric value to convert.

to_unitstringrequired

Target unit name (e.g. kilometer, pound, degree_Fahrenheit).

from_unitstringrequired

Source unit name (e.g. mile, kilogram, degree_Celsius, kilometer/hour).

units/convert — Faro