DevToolsmith

KSUID Generator / Decoder

Generate K-Sortable Unique Identifiers or decode an existing KSUID. Inspect its timestamp, 128-bit random payload and full 160-bit representation.

Runs 100% in your browser — nothing is uploaded

Uses the current Unix second and a fresh 128-bit random payload per ID. IDs created within the same second are not monotonic.

Generated KSUIDs
0 chars · 0 bytes · 0 lines
UTC time
2017-10-10T04:00:47.000Z
Unix seconds
1507608047
KSUID timestamp offset
107608047
128-bit payload (hex)
b5a1cd34b5f99d1154fb6853345c9735
Full 160-bit value (hex)
0669f7efb5a1cd34b5f99d1154fb6853345c9735

Inspect a KSUID

The default example comes from the upstream KSUID project. Its timestamp is 2017-10-10T04:00:47Z and its payload is b5a1cd34b5f99d1154fb6853345c9735.

Preserve the encoded value

KSUID is case sensitive. The decoder uses integer arithmetic and rejects encoded values outside the 160-bit range. The timestamp is supplied by the generator’s clock and is not proof of when an event occurred.

Frequently asked questions

How does KSUID differ from ULID?

KSUID is 20 bytes: a 32-bit seconds offset from Unix time 1400000000 and a 128-bit payload, encoded as 27 Base62 characters. ULID is 16 bytes, with a millisecond timestamp and an 80-bit payload, encoded as 26 Base32 characters.

Are IDs generated in one second ordered?

Not by creation order. The timestamp portion is the same within one second and the payload is random. Lexicographic sorting groups IDs by timestamp, while IDs within that second sort by payload. Keep Base62 case intact and use a case-sensitive binary collation.