ULID Generator and Decoder

Create up to 1,000 ULIDs at once, decode the timestamp inside any ULID and convert between the ULID and UUID forms of the same 128 bits.

Loading tool…

About the ULID Generator

A ULID (Universally Unique Lexicographically Sortable Identifier) is a 128-bit ID written as 26 characters. The first 10 characters encode a 48-bit Unix timestamp in milliseconds and the last 16 encode 80 random bits, here taken from crypto.getRandomValues. Because the time comes first and the alphabet is in ASCII order, sorting ULIDs as plain strings sorts them by creation time, which keeps database indexes compact in the same way as UUID v7.

The text form is Crockford Base32: the digits and the upper-case letters without I, L, O and U, so an ID cannot be misread and is safe in URLs and file names. 26 characters could hold 130 bits, so the first character of a valid ULID is at most 7; the largest timestamp, 7ZZZZZZZZZ, falls in the year 10889. With the monotonic option, ULIDs made within the same millisecond take the previous random part plus one instead of new random bits, so even a batch generated in one go is strictly increasing.

A ULID and a UUID are both 128 bits, so every ULID has a UUID form and the reverse: the decoder shows both, which lets you store ULIDs in a native uuid column and show them as 26 characters. It also reads the timestamp as ISO 8601, local and relative time, and the random part in hex. Remember that the creation time is visible to anyone who sees the ID.

How to use it

  1. Set the count and choose monotonic order and lower case as needed.
  2. Tick “Custom time” to generate ULIDs for a given date and time instead of now.
  3. Click Generate, then Copy all or Download.
  4. Paste a ULID or a UUID into the inspector to decode it and convert it.

Frequently asked questions

ULID or UUID v7: which one should I use?
Both start with a 48-bit millisecond timestamp and sort by time. UUID v7 is an IETF standard (RFC 9562) with native support in many databases and has 74 random bits; ULID has 80 random bits and a shorter, case-insensitive text form. If you store the 128-bit value, the choice is mostly about how the ID looks.
Are ULIDs case sensitive?
No. The canonical form is upper case, but decoders accept lower case, and the lower-case form sorts the same way as long as you do not mix the two.
Why is my ULID reported as invalid?
A ULID has exactly 26 characters, uses no I, L, O or U, and its first character must be 0–7: anything larger would not fit in 128 bits.
Can two ULIDs collide?
Only within the same millisecond, and then the 80 random bits would have to match: with a million IDs in one millisecond the chance is about 1 in 2.4 trillion. Monotonic generation in a single process excludes it entirely.

Related tools