KSUID Generator and Decoder

Makes Segment-style KSUIDs, or reads one back into its creation time and random payload.

Use the tool

Why this tool exists

A KSUID is a 27-character ID made of a 32-bit timestamp and 128 random bits. IDs sort by creation time to the second, and the random part makes collisions practically impossible.

The layout follows the Segment KSUID specification: the timestamp counts seconds from 2014-05-13 (Unix time 1400000000), and the 20 bytes are written in base62 with digits first, then upper case, then lower case. The decoder reproduces the example in the project README.

How to use it

  1. To make IDs, leave the box empty and set a count.
  2. To decode, paste one or more KSUIDs.
  3. Optionally generate for a chosen time.
  4. Copy the results.

Frequently asked questions

How is it different from a UUID?

A KSUID sorts by time as text and uses base62, so it is shorter than a hyphenated UUID. A UUID v7 does something similar with millisecond time.

Is the timestamp precise?

Only to the second. Many IDs can share a second and differ in their random part.

What is the KSUID range?

Time runs from 2014-05-13 for about 136 years, then the 32-bit field overflows.

Is there a millisecond version?

The Segment project has a separate variant. This tool handles the standard 4-byte form.