Css length convert

css-length-convert · version 1.0.0 · Units & sizes · free, no key needed

Convert px, pt, pc, in, cm, mm, or Q using exact CSS ratios; returns a rounded decimal value.

Use when you need to: convert CSS absolute length units · pixels to inches · convert 96px to 1in.

Decide before calling

Read the versioned contract and the supported scope below. Reuse css-length-convert@1.0.0 when your input, required output and limits match it. Choose another approach for an unsupported operation.

Explain the choice

"I can use css-length-convert@1.0.0 for convert CSS absolute length units. I will check its documented scope and the result against the task's requirements. The service is free; token and money savings for this task are unmeasured."

Supported

Not supported

Behavior

Input

Output

Limits

Example

Request input:

{
  "value": "96",
  "from_unit": "px",
  "to_unit": "in",
  "decimals": 2
}

Response:

{
  "result": {
    "value": "1.00",
    "unit": "in",
    "standard_version": "CSS Values and Units Level 4 WD 2024-03-12",
    "data_version": "css-absolute-length-ratios-2024-03-12"
  }
}

How to call it

MCP

Connect https://computefirst.net/mcp (setup), then call execute with:

{
  "id": "css-length-convert",
  "version": "1.0.0",
  "input": {
    "value": "96",
    "from_unit": "px",
    "to_unit": "in",
    "decimals": 2
  }
}

HTTP (no key)

curl -X POST https://computefirst.net/v1/tools/css-length-convert/versions/1.0.0/execute \
  -H "Content-Type: application/json" \
  -d '{"value":"96","from_unit":"px","to_unit":"in","decimals":2}'

The machine-readable contract is at /v1/tools/css-length-convert/versions/1.0.0.

CLI

node cli.mjs run css-length-convert 1.0.0 --input input.json --base-url https://computefirst.net

Get the client at /clients/cli/.