ULID Generator – Create Sortable, URL-Safe Identifiers Online
Use the ULID Generator above to create Universally Unique Lexicographically Sortable Identifiers in your browser. Generate one or thousands, choose the timestamp, switch between canonical uppercase and lowercase output, enable monotonic ordering and decode an existing ULID to see when it was created.
A ULID is a 128-bit identifier represented as 26 Crockford Base32 characters.
Its first 48 bits encode a millisecond timestamp. The remaining 80 bits provide randomness.
That layout makes ULIDs compact, URL-friendly and naturally sortable by time—a useful combination for database records, APIs, logs, events and distributed applications.
What Is a ULID?
ULID stands for Universally Unique Lexicographically Sortable Identifier.
A typical ULID looks like:
01ARZ3NDEKTSV4RRFFQ69G5FAV
The format contains two logical parts:
| Part | Size | Purpose |
|---|---|---|
| Timestamp | 48 bits | Unix time in milliseconds |
| Randomness | 80 bits | Uniqueness within the timestamp |
| Total | 128 bits | Complete ULID |
The 128-bit value is encoded using Crockford Base32, producing a fixed 26-character string.
Because the timestamp comes first, normal lexicographic string sorting also sorts correctly generated ULIDs by time.
How to Use This ULID Generator
Choose how many identifiers you want.
For normal use, leave the timestamp set to the current time.
For test fixtures, you can choose a specific date and time. This is useful when you need realistic records that sort as if they were created in the past.
Next, choose uppercase or lowercase output.
The canonical ULID representation is uppercase. Crockford Base32 decoding is case-insensitive, so many implementations also accept lowercase.
Enable Monotonic within a millisecond when generating multiple values that may share exactly the same millisecond timestamp.
Then copy, download or export the generated values.
You can paste an existing ULID into the decoder to inspect its timestamp and validate the string.
Why Are ULIDs Sortable?
The timestamp is encoded at the beginning of the identifier.
That means an older ULID normally starts with a lower encoded time value than a newer one.
Example conceptually:
Older record: 01H...
Newer record: 01J...
Because the time component comes first, text sorting can follow creation chronology.
This is different from UUID v4, where the value is random and sorting the ID does not meaningfully represent creation time.
Sortable IDs are convenient in databases, logs and event systems where recent records are often grouped together.
What Is Crockford Base32?
Crockford Base32 is an encoding alphabet designed to be compact and easier for humans to read than many other binary-to-text formats.
ULID uses characters that avoid several ambiguous letters.
The canonical encoding does not use letters such as I, L, O and U.
That reduces visual confusion in copied identifiers.
Base32 also allows a 128-bit value to fit into 26 characters, compared with the 36-character standard textual form of a UUID.
ULIDs contain no punctuation, which makes them convenient in URLs, filenames and systems where hyphens are undesirable.
ULID Timestamp Explained
The timestamp portion is 48 bits and represents Unix time in milliseconds.
That gives ULID millisecond-level time ordering, and a decoder can recover the approximate creation time.
Do not choose ULID if creation time itself must remain hidden.
Also avoid treating the embedded timestamp as your only business timestamp. Keep a normal created_at field when your application needs explicit date queries, auditing or time-zone-aware logic.
What Does Monotonic ULID Mean?
Several ULIDs can be created during one millisecond.
If every value uses a new random 80-bit portion, those same-millisecond ULIDs are unique but may not appear in the exact order they were generated.
A monotonic ULID generator solves that by incrementing the random component when the timestamp has not advanced.
This preserves lexicographic order for identifiers created in the same millisecond.
Monotonic generation is especially useful in high-throughput applications where many records can be created during one clock tick.
Production code should use a library that correctly handles monotonic state and overflow.
How Unique Is a ULID?
The random component contains 80 bits.
Within a given millisecond, that provides an enormous identifier space.
The ULID specification describes roughly 1.21 × 10²⁴ possible random values per millisecond.
Collisions are therefore extremely unlikely with a secure implementation.
Still, identifier uniqueness should not be treated as a replacement for database integrity.
If a column must be unique, enforce that with a UNIQUE constraint or primary key.
The generator makes structurally valid IDs; your application remains responsible for persistence rules.
ULID vs UUID v7
ULID and UUID v7 are close alternatives.
Both are 128-bit, timestamp-first identifiers designed to sort roughly by creation time.
The biggest difference is representation and standardization.
| Feature | ULID | UUID v7 |
|---|---|---|
| Size | 128 bits | 128 bits |
| Text length | 26 characters | 36 characters |
| Encoding | Crockford Base32 | UUID hexadecimal format |
| Millisecond timestamp | Yes | Yes |
| Lexicographically sortable | Yes | Yes |
| URL-friendly text | Excellent | Good |
| IETF UUID standard | No | Yes |
| Native UUID DB type | Not directly | Yes |
Use ULID when compact sortable text is attractive.
Use UUID v7 when standards-based UUID interoperability and native database UUID support matter more.
Try the UUID v7 Generator if you want to compare both formats side by side.
ULID vs NanoID
NanoID is usually a random identifier without a timestamp.
ULID includes time by design.
That leads to different strengths.
Choose ULID when:
- You want chronological sorting
- You want a fixed 26-character format
- Exposing approximate creation time is acceptable
Choose NanoID when:
- You want a shorter configurable ID
- You want a custom alphabet
- You do not need time ordering
- You prefer no embedded timestamp
NanoID’s default length is 21 characters, while a ULID is always represented canonically as 26 Base32 characters. See the NanoID Generator.
ULID vs MongoDB ObjectId
Both formats embed time.
MongoDB ObjectId uses a 4-byte timestamp with one-second resolution and additional bytes for process uniqueness and a counter.
ULID uses a 48-bit millisecond timestamp plus 80 bits of randomness.
ObjectId is deeply integrated into MongoDB.
ULID is database-agnostic and useful when IDs need to travel between different systems while remaining sortable as text.
If you are generating MongoDB _id values, the MongoDB ObjectId Generator is the more relevant tool for fixtures and decoding.
Are ULIDs URL-Safe?
Yes. Crockford Base32 uses letters and digits without URL-reserved punctuation, so ULIDs work cleanly in routes, JSON, CSV, filenames and API paths.
URL-safe does not mean secret. The timestamp is decodable, and authorization should never depend on an identifier simply being hard to guess.
Uppercase vs Lowercase ULID
The canonical ULID representation is uppercase, although Crockford Base32 decoding is case-insensitive.
Use uppercase for the safest interoperability. If your application deliberately uses lowercase, make sure every system accepts it and keep the stored format consistent.
Can You Create ULIDs for Past Dates?
Yes. A chosen timestamp is useful for database seeds, historical fixtures, migration simulations and sorting tests.
For production data, generate the identifier at the appropriate event time unless your migration design specifically requires preserving an original timestamp.
ULID Overflow and Validation
A 26-character Base32 string can theoretically represent 130 bits, but a ULID contains only 128 bits.
That means not every possible 26-character Base32 string is a valid ULID.
The canonical specification defines a maximum encoded value. Decoders should reject values above the 128-bit range rather than silently overflowing.
A proper validator should also check:
- Length is 26 characters
- Characters belong to the accepted alphabet
- Encoded value fits the ULID range
- Timestamp can be decoded correctly
Do not validate a ULID using length alone.
Secure Randomness Matters
The 80-bit random component should come from a cryptographically strong random source.
This browser tool uses secure random-number facilities rather than relying on Math.random().
That gives the generated output appropriate randomness for identifier generation.
For production applications, use a trusted ULID library for your runtime or language, especially when monotonic behavior is required across concurrent requests.
The online tool is ideal for fixtures, testing, debugging and one-off batches.
Common ULID Mistakes
Avoid these problems:
- Assuming ULID is an IETF UUID standard
- Treating the embedded timestamp as private
- Depending on ID order as your only event-order guarantee
- Mixing uppercase and lowercase without a policy
- Generating randomness with a weak PRNG
- Validating only the 26-character length
- Forgetting a database uniqueness constraint
- Reimplementing monotonic logic without handling edge cases
The format is simple to read, but robust generation still deserves a tested implementation.