Unit conversion

Convert a value between units of length, mass, volume, area, speed, time, data, energy, power, pressure or temperature, using exact definitions.

CHF 0.001 / callCall itTry it
Thomas arithmometer, ca. 1820
Thomas arithmometerca. 1820

Details

Units: temperature (C, F, K); length (m, km, cm, mm, um, nm, in, ft, yd, mi, nmi); mass (kg, g, mg, ug, t, lb, oz, st, ct, ozt, gr); volume (m3, l, dl, cl, ml, gal, gal_uk, qt, pt, pt_uk, fl_oz, cup, tbsp, tsp, ft3, in3, bbl); area (m2, km2, ha, a, cm2, mm2, ft2, in2, acre, mi2); speed (m/s, km/h, mph, kn, ft/s); time (s, ms, min, h, d, wk, yr_julian); data (B, bit, kB, MB, GB, TB, KiB, MiB, GiB, TiB, kbit, Mbit, Gbit); energy (J, kJ, MJ, Wh, kWh, MWh, cal, kcal, BTU, eV); power (W, kW, MW, PS, hp); pressure (Pa, hPa, kPa, MPa, bar, mbar, atm, mmHg, psi).

Does not cover: currencies (use convert-currency) or calendar months and years.

Price: CHF 0.001 per call (first 100 calls per day free).

Example: {"value":"1","from":"mi","to":"km"} → {"value":"1.609344","exact":true}.

Call it

REST
curl -X POST https://api.tausendwerk.xyz/v1/convert-units \
  -H "Content-Type: application/json" \
  -d '{"value":"1","from":"mi","to":"km"}'
MCP tool name
convert_units

After the free 100 calls per day, add a key: Authorization: Bearer tw_live_…. Pricing

Try it

Runs against the live API with the free allowance.

Input schema JSON Schema
{
  "type": "object",
  "additionalProperties": false,
  "required": [
    "value",
    "from",
    "to"
  ],
  "properties": {
    "value": {
      "type": [
        "string",
        "number"
      ],
      "description": "A number. Send a string such as \"0.1\" to keep it exact."
    },
    "from": {
      "type": "string",
      "maxLength": 30
    },
    "to": {
      "type": "string",
      "maxLength": 30
    },
    "decimals": {
      "type": "integer",
      "minimum": 0,
      "maximum": 100,
      "description": "Round the result to this many decimal places."
    },
    "significant": {
      "type": "integer",
      "minimum": 1,
      "maximum": 60,
      "default": 30,
      "description": "Significant digits for non-terminating results. Default 30."
    },
    "round_to": {
      "type": "string",
      "pattern": "^\\d*\\.?\\d+$",
      "description": "Round to a multiple of this step, e.g. \"0.05\" for Swiss cash rounding."
    },
    "rounding": {
      "type": "string",
      "enum": [
        "half_up",
        "half_even",
        "half_down",
        "up",
        "down",
        "toward_zero",
        "away_from_zero"
      ],
      "description": "Rounding mode for decimals and round_to. Default half_up."
    }
  },
  "examples": [
    {
      "value": "1",
      "from": "mi",
      "to": "km"
    },
    {
      "value": 3.5,
      "from": "ct",
      "to": "g"
    }
  ]
}

More in Exact maths and money