# Ulid parse canonical

`ulid-parse-canonical` · version 1.0.0 · Identifiers & check digits · free, no key needed

Parse a canonical uppercase ULID into its exact timestamp, randomness, and 16 bytes.

**Use when you need to: parse canonical ULID · decode strict ULID bytes · inspect ULID timestamp and randomness.**

## Decide before calling

Read the [versioned contract](/v1/tools/ulid-parse-canonical/versions/1.0.0) and the supported scope below. Reuse `ulid-parse-canonical@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 `ulid-parse-canonical@1.0.0` for parse canonical ULID. 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

- parse canonical ULID
- decode strict ULID bytes
- inspect ULID timestamp and randomness
- convert ULID to bytes
- split canonical ULID fields
- read ULID binary value

## Not supported

- generic ULID validation
- lowercase or alias normalization

## Behavior

- Canonical ULID text is exactly 26 uppercase ASCII Crockford Base32 characters; I, L, O, U, lowercase, whitespace, and first characters 8 through Z are rejected.
- The 48-bit timestamp is represented as a canonical unsigned decimal string, avoiding JSON number precision loss.
- Inputs are never trimmed or normalized; operations are synchronous, pure, offline, bounded, and deterministic.

## Input

- `ulid` (string, required): min length 26; max length 26; pattern `^[0-7][0-9A-HJKMNP-TV-Z]{25}$`

## Output

- `ulid` (string, required): min length 26; max length 26; pattern `^[0-7][0-9A-HJKMNP-TV-Z]{25}$`
- `timestamp_ms` (string, required): max length 15; pattern `^(0|[1-9][0-9]*)$`
- `random_bytes` (array of integer, required): min items 10; max items 10; each min 0; each max 255
- `bytes` (array of integer, required): min items 16; max items 16; each min 0; each max 255

## Limits

- max ulid bytes: 26

## Example

Request input:

```json
{
  "ulid": "00000000000000000000000000"
}
```

Response:

```json
{
  "result": {
    "ulid": "00000000000000000000000000",
    "timestamp_ms": "0",
    "random_bytes": [
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0
    ],
    "bytes": [
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0
    ]
  }
}
```

## How to call it

### MCP

Connect `https://computefirst.net/mcp` ([setup](/docs#connect)), then call `execute` with:

```json
{
  "id": "ulid-parse-canonical",
  "version": "1.0.0",
  "input": {
    "ulid": "00000000000000000000000000"
  }
}
```

### HTTP (no key)

```sh
curl -X POST https://computefirst.net/v1/tools/ulid-parse-canonical/versions/1.0.0/execute \
  -H "Content-Type: application/json" \
  -d '{"ulid":"00000000000000000000000000"}'
```

The machine-readable contract is at [/v1/tools/ulid-parse-canonical/versions/1.0.0](/v1/tools/ulid-parse-canonical/versions/1.0.0).

### CLI

```sh
node cli.mjs run ulid-parse-canonical 1.0.0 --input input.json --base-url https://computefirst.net
```

Get the client at [/clients/cli/](/clients/cli/).

## Related tools

- [Ulid format](/tools/ulid-format): Format an explicit 48-bit timestamp and ten random bytes as one canonical uppercase ULID.
- [Ulid timestamp extract](/tools/ulid-timestamp-extract): Extract the exact unsigned 48-bit millisecond timestamp from a canonical uppercase ULID.
- [Gs1 element string parse](/tools/gs1-element-string-parse): Parse a bracketed or FNC1-separated GS1 element string into typed AI fields: implied decimals, dates and check digits.
- [Doi parse](/tools/doi-parse): Parse a DOI (bare, doi: or doi.org URL) into prefix, suffix, directory indicator, registrant code and canonical forms.
- [Uuid inspect](/tools/uuid-inspect): Validate a canonical UUID and report its lowercase value, variant, version, and nil status.
- [Cn resident id parse](/tools/cn-resident-id-parse): Parse an 18-digit (or legacy 15-digit) Chinese resident ID: region code, birth date, sex and GB 11643-1999 check digit.
