ULID Generator

Generate ULIDs in bulk — sortable, time-ordered identifiers that work as a drop-in alternative to UUIDs.

What generating ULIDs means

Generating ULIDs means issuing, in bulk, globally unique identifiers that sort by time — the Universally Unique Lexicographically Sortable Identifier. A ULID is a 26-character Crockford Base32 string whose first 10 characters encode the moment of generation and whose remaining 16 come from a cryptographically secure random source. Unlike a wholly random identifier such as UUID v4, its great virtue is that sorting the strings alphabetically also sorts them in the order they were created.

This tool draws the random part from the Web Crypto API’s crypto.getRandomValues(), so the source is cryptographically secure rather than a mere pseudorandom generator. Everything happens inside the browser: neither the count you enter nor the identifiers produced are sent to a server. Up to 1,000 can be generated at once, and output is available in either upper case — the canonical form in the specification — or lower case.

How to generate ULIDs

  1. Enter how many you need Type the number of ULIDs to issue at once, anywhere from 1 to 1,000.
  2. Decide whether you want lower case Tick the lower-case option if you want them consistent for use in a URL or a log. Both cases are valid under the specification.
  3. Press generate The requested number of ULIDs, using the current time in the timestamp portion, are listed together.
  4. Copy the results Copy them individually, or use copy-all to take the whole list separated by line breaks.

Tips for getting more out of it

  • The first 10 characters of a ULID encode a timestamp (the creation time), while the remaining 16 are random. Except when two ULIDs are generated within the same millisecond, a simple string sort will put them in creation order.
  • Using a fully random UUID v4 as a database primary key tends to fragment B-tree indexes, since new rows get inserted at random positions. Because ULIDs sort roughly by time, new rows land near the end of the index, which helps mitigate this issue.
  • A ULID is represented as 26 characters of Crockford's Base32 (the 32-character alphabet `0`-`9` and `A`-`Z` with the easily confused I, L, O, and U removed), making it shorter than a UUID (36 characters including hyphens) and safe to use in case-insensitive environments.
  • For a side-by-side comparison with Nano ID and UUID v4, see the comparison table on our sister tool, the Nano ID Generator page.

When generating ULIDs helps

Primary keys and record identifiers in a database

When adopting ULIDs as the primary key of a new table, you can prepare a batch of identifiers for dummy records and seed data early in development.

Event identifiers in an event-driven system

Where each event in a message queue or a distributed system needs a unique identifier, ULIDs sort by time, which makes following the logs chronologically far easier.

Sample log and trace identifiers

Produce identifiers in the real format straight away for testing or demonstrating a logging platform or a tracing tool.

Comparing against other identifier formats

If you are weighing ULID against UUID v4, UUID v7 or Nano ID for short URLs, compare the actual appearance and length before deciding. See also UUID generation, UUID v7 generation and Nano ID generation.

Terms used with ULIDs

ULID
Short for Universally Unique Lexicographically Sortable Identifier. A 128-bit unique identifier whose leading 48 bits hold the time of generation, so sorting the strings alone puts them in chronological order.
Crockford Base32
An encoding using 32 characters: the digits 0–9 and the letters A–Z with the visually confusable I, L, O and U removed. A ULID is encoded into 26 characters this way.
Monotonicity
The property of a value always increasing over time. A ULID does not guarantee ordering when several are generated within the same millisecond, but the monotonic generation extension defined in the specification preserves the increase even then.
UUID
Short for Universally Unique Identifier. The 128-bit unique identifier standard defined in RFC 4122, usually written as 36 hexadecimal characters including hyphens. It is a separate standard from ULID.
Unique identifiers in distributed systems
The arrangement whereby several servers or processes each generate non-colliding identifiers independently, without asking a central issuer. ULID and UUID combine generation time and randomness to drive the chance of collision to a negligible level.
Timestamp portion
The first 10 characters of a ULID: a 48-bit value encoding the generation time in milliseconds as Crockford Base32. It is the core of the mechanism that lets a plain string comparison reveal the order of generation.

Frequently Asked Questions

A ULID (Universally Unique Lexicographically Sortable Identifier) is a specification for identifiers that, like a UUID, are globally unique, but also embed creation-time information — meaning a plain string sort will arrange them in chronological order.

The main difference is whether the identifier can be sorted by creation time. UUID v4 is a fully random 128-bit value, so it can't be sorted by creation order, whereas a ULID's first 48 bits are a millisecond-precision timestamp, so a simple string comparison reveals the creation order. There's also a formatting difference: a ULID is 26 characters of Base32, while a UUID is 36 hexadecimal characters including hyphens.

Using a fully random value like UUID v4 as a primary key means new rows get inserted at random positions within the index, which can lead to B-tree index fragmentation and reduced cache efficiency. Because ULIDs sort roughly by time, new rows tend to be appended near the end of the index, which is said to help mitigate this problem.

The first 10 characters are a 48-bit millisecond timestamp (able to represent dates up to roughly the year 10889), and the remaining 16 characters are 80 bits of randomness. In total that's 128 bits — the same as a UUID — but with creation-time information built in, which is ULID's defining feature.
Tool-kun

Side Note — How ULID Brought Chronological Order to the World of IDs

The ULID specification was published in 2016 by Alizain Feerasta. At the time, UUID was already the standard way to generate unique IDs in distributed systems, but its fully random nature — which made it impossible to sort — was seen as inconvenient for database index efficiency and for time-series analysis of logs. ULID was created to address exactly that problem.

UUID does actually have time-based variants of its own: version 1 (a MAC address plus a timestamp) and version 7 (standardized in 2024, combining a timestamp with random bits). ULID, however, is an independent specification distinct from the UUID standard (RFC 4122), and it distinguishes itself by pursuing a simpler design along with a compact Base32 representation.

Today, implementation libraries for ULID exist in nearly every major programming language, and it is widely adopted wherever preserving creation order matters — event IDs in distributed systems, trace IDs in logs, and database primary keys among them. Its design philosophy overlaps considerably with UUID v7, which emerged around the same time, and the two now coexist as different approaches to the same goal: a sortable, UUID-like identifier.