Units on the Web

You can try out the string conversions through the units Webserver

This page allows you to enter a measurement string and a unit string for conversion.

The measurement string can be of any form with a number and units

  • 10 m

  • hundred pounds

  • 45.673 GB

  • dozen feet

the unit string should be some unit that is convertible from the measurement units:

  • inches

  • troy oz

  • kiB

  • british fathoms

The conversion also supports mathematical operations see Units From Strings for additional details on string conversions. The units can also be set to *`or `<base> to convert the measurement to base units.

Rest API

The units web server does not serve files, it generates all responses on the fly. There are 3 URI indicators it responds to beyond the root page.

  • /convert : responds with an html page

  • /convert_trivial : responds with the results as a simple text

  • /convert_json : responds with a json string containing the requested conversions and the results.

For example in Linux or anything with curl

$ curl -s ""

$ curl -s ""

 $ curl -s ""
"request_measurement":"ten meterspersecond",
"measurement":"10 m/s",

This works with POST or GET methods. The caction field can be set to “to_string” this will “simplify” the units in the result or at least use the internal to_string operations to convert to an interpretable string in more accessible units.