Skip to content
HALOWERK

Text Tools

convert mass units

Convert a nonnegative mass between micrograms, milligrams, grams, kilograms, tonnes, pounds, ounces and stones. Returns the converted number and both units; pounds use the exact international definition.

POST https://text.halowerk.com/v1/convert-mass-units

Inputs

Fields of the published input schema
FieldTypeRequiredDescription
valuenumberYes
fromstringYes
tostringYes
Show full input schema
{
  "type": "object",
  "properties": {
    "value": {
      "type": "number",
      "minimum": 0,
      "maximum": 1e+25
    },
    "from": {
      "type": "string",
      "enum": [
        "ug",
        "mg",
        "g",
        "kg",
        "t",
        "lb",
        "oz",
        "st"
      ]
    },
    "to": {
      "type": "string",
      "enum": [
        "ug",
        "mg",
        "g",
        "kg",
        "t",
        "lb",
        "oz",
        "st"
      ]
    }
  },
  "required": [
    "value",
    "from",
    "to"
  ],
  "additionalProperties": false
}

Open original schema

Published input example

{
  "value": 1,
  "from": "lb",
  "to": "kg"
}

Result & documentation

Show published result schema
{
  "type": "object",
  "properties": {
    "value": {
      "type": "number",
      "minimum": 0
    },
    "from": {
      "type": "string",
      "enum": [
        "ug",
        "mg",
        "g",
        "kg",
        "t",
        "lb",
        "oz",
        "st"
      ]
    },
    "to": {
      "type": "string",
      "enum": [
        "ug",
        "mg",
        "g",
        "kg",
        "t",
        "lb",
        "oz",
        "st"
      ]
    }
  },
  "required": [
    "value",
    "from",
    "to"
  ],
  "additionalProperties": false
}

Machine-readable documentation of this hub

Source of this page: the published HALOWERK catalog. Updated: 2026-12-05 UTC.

More endpoints in this hub

All endpoints in this hub →