JSON canonical serialize

json-canonical-serialize · version 1.0.0 · JSON & JSONL · free, no key needed

Serialize a JSON value to deterministic compact text with sorted object keys and safe integers only.

Use when you need to: json canonical serialize · canonicalize json · serialize json deterministically.

Supported

Not supported

Behavior

Input

Output

Limits

Example

Request input:

{
  "value": {
    "z": 1,
    "note": "hello \"Ada\"",
    "a": [
      true,
      false,
      null,
      0
    ],
    "m": {
      "b": "x",
      "a": "y"
    }
  }
}

Response:

{
  "result": {
    "json": "{\"a\":[true,false,null,0],\"m\":{\"a\":\"y\",\"b\":\"x\"},\"note\":\"hello \\\"Ada\\\"\",\"z\":1}"
  }
}

How to call it

MCP

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

{
  "id": "json-canonical-serialize",
  "version": "1.0.0",
  "input": {
    "value": {
      "z": 1,
      "note": "hello \"Ada\"",
      "a": [
        true,
        false,
        null,
        0
      ],
      "m": {
        "b": "x",
        "a": "y"
      }
    }
  }
}

HTTP (no key)

curl -X POST https://computefirst.net/v1/tools/json-canonical-serialize/versions/1.0.0/execute \
  -H "Content-Type: application/json" \
  -d '{"value":{"z":1,"note":"hello \"Ada\"","a":[true,false,null,0],"m":{"b":"x","a":"y"}}}'

The machine-readable contract is at /v1/tools/json-canonical-serialize/versions/1.0.0.

CLI

node cli.mjs run json-canonical-serialize 1.0.0 --input input.json --base-url https://computefirst.net

Get the client at /clients/cli/.