KSUID Generator & Decoder
Generate cryptographically random KSUIDs, decode their timestamps and payloads, or compose a deterministic 20-byte ID in Base62 or hex.
Timestamp and random payload
A KSUID contains a 4-byte big-endian timestamp and 16 random bytes. Its epoch is Unix second 1400000000, or 2014-05-13T16:53:20Z. The fixed 27-character text uses the Base62 alphabet 0–9, A–Z, a–z. Letter case is significant; values exceeding the 160-bit format are rejected.
Generate or reproduce fixtures
Generate creates 1–1,000 fresh payloads with crypto.getRandomValues and the selected UTC second. Compose accepts exactly 16 bytes of hexadecimal payload for deterministic fixtures. Decode accepts Base62 or 40 hexadecimal digits and reports both forms without losing leading zero bytes.
Sorting and limits
KSUIDs sort approximately by timestamp when compared with the stated case-sensitive alphabet. IDs created within one second sort by their random payload, not creation order. Timestamp generation is restricted to the unsigned 32-bit offset range. IDs are not authentication secrets, proof of identity or a replacement for database uniqueness constraints.
Reference
Questions & answers
Does a decoded time prove when a record was created?
No. IDs can be composed or assigned elsewhere. A decoded timestamp is only the time stored in this particular format.
Are inputs uploaded or saved?
No. The tool runs locally in a Web Worker and does not send IDs to an API or save them in local storage. Copy and Download use the current result; edits or cancellation discard stale output.