Snipget.ai

Convert between units

Exact
units_convert

Deterministic and authoritative — the canonical answer for this input.

Convert a value between units of the same dimension: length, mass, volume, area, speed, time, or temperature. dimension is auto-detected from the units when omitted. One tool keyed by dimension. Processing multiple inputs? Use `units_convert_batch` to do up to 1000 in one call.

Parameters

valuestringrequired

The numeric value to convert.

from_unitstringrequired

Source unit, e.g. 'mi', 'kg', 'c'.

to_unitstringrequired

Target unit, e.g. 'km', 'lb', 'f'.

dimensionstringoptional

length/mass/volume/area/speed/time/temperature (auto-detected if omitted).

Call it

curl -X POST https://api.snipget.ai/v1/units/convert \
  -H "Authorization: Bearer sk_live_..." \
  -H "Content-Type: application/json" \
  -d '{"value":"1","from_unit":"mi","to_unit":"km"}'

The Batch tab sends up to 1000 inputs in one call via /v1/units/convert/batch.

Example response

{
  "dimension": "length",
  "from_unit": "mi",
  "to_unit": "km",
  "value": 1,
  "result": 1.609344
}

FAQ

Which units are supported?

Length, mass, volume, area, speed, time, and temperature. Pass common unit names (mi, km, kg, lb, c, f, and so on); the dimension is detected automatically, or set it explicitly with the dimension field.

Does temperature convert correctly?

Yes. Temperature uses the proper offset formulas, so 100 c converts to 212 f, not a naive ratio.

Can I convert between mismatched units?

No. Converting kg to meters returns confidence 0 with a reason, because they are different dimensions.