KSUID Generator

Generate KSUIDs: 27-character, time-sortable unique IDs.

Your input

 
0 lines · 0 bytes

What is a KSUID?

A KSUID (K-Sortable Unique IDentifier) is a 27-character ID made of a 32-bit timestamp followed by 128 random bits. It is written in base 62, using digits and upper and lower case letters. It was created by the company Segment for distributed systems.

The timestamp counts seconds from 14 May 2014, which is 1,400,000,000 in Unix time. Because time comes first, KSUIDs sort roughly in creation order, to the second. With 128 bits of randomness, the chance of two matching is extremely small without any central counter, so many servers can create them independently.

How to use the KSUID Generator

  1. Choose how many IDs you want.
  2. Press the button to generate them.
  3. Check the time shown in the note.
  4. Copy or download the IDs.

Real situations

When people use the KSUID Generator

  • 1

    Generate IDs across many servers

    Each machine can make its own IDs without talking to a central counter and still keep a rough time order.

  • 2

    Keep records sorted by creation

    A text sort of KSUIDs orders by time to the second, useful for listings and storage keys.

  • 3

    Use compact, URL-safe identifiers

    Only letters and digits are used, so they work in links, file names and keys.

  • 4

    Create test data

    Generate a batch to seed a database or try out a library.

FAQ

KSUID Generator: questions answered

What does a KSUID look like?

A string such as 3MoXom6lWVWjd0d2BWAjE4Hwsbe: 27 characters of letters and digits. The first part encodes the time and the rest is random.

How is a KSUID different from a ULID?

A ULID has 48 bits of millisecond time and 80 random bits in 26 characters. A KSUID has 32 bits of second-level time and 128 random bits in 27 characters. KSUIDs have more randomness, ULIDs have finer time.

How accurate is the time in a KSUID?

To the second. IDs created within the same second are not ordered relative to each other, because the rest is random.

Can I read the time out of a KSUID?

Yes. The tool shows the time part of the first ID as a date. It counts from 14 May 2014, so add 1,400,000,000 to get Unix time.

Are KSUIDs unique?

With 128 random bits, a clash is practically impossible, even with huge numbers of IDs. The tool uses the browser's secure random generator.

Will KSUIDs run out?

The 32-bit timestamp counts seconds from 2014 and lasts until around the year 2150, which is not a problem for current use.

Is this KSUID Generator free and private?

Yes. It is free with no sign-in, and every calculation runs inside your browser. Nothing you type is sent to a server or stored, and the page keeps working offline once it has loaded.

Private by design. No accounts, no cookies, no tracking. Everything you type stays on your device.

How we keep it that way