About this ULID generator
A ULID, short for Universally Unique Lexicographically Sortable Identifier, is a 26-character ID that is unique like a UUID but also sorts by creation time. This ULID generator makes one ID or a batch of up to 100 in your browser, using the browser's secure random number generator. Nothing is sent to a server.
How a ULID is built
A ULID has two parts. The first 10 characters are a 48-bit timestamp in milliseconds since 1970-01-01 UTC. The last 16 characters are 80 bits of randomness. Both parts are written in Crockford's Base32, which uses the digits 0 to 9 and the letters A to Z without I, L, O and U, so the ID is easy to read aloud and has no look-alike characters. A ULID looks like this: 01ARYZ6S41TSV4RRFFQ69G5FAV.
Because the timestamp comes first and the alphabet is in ascending order, sorting ULIDs as plain text sorts them by time. When you generate several in the same millisecond, this tool increments the random part of the previous one, so the batch stays in strict order, as the ULID specification recommends.
ULID vs UUID
| ULID | UUID v4 | |
|---|---|---|
| Length as text | 26 characters | 36 characters with hyphens |
| Sortable by time | Yes, as text | No, fully random |
| Randomness | 80 bits | 122 bits |
| Character set | Crockford Base32 | Hexadecimal |
| Reveals creation time | Yes, anyone can decode it | No |
ULIDs suit database keys, where time-ordered values keep index inserts local and make recent rows easy to find. A UUID v4 is better when the ID must not reveal when something was created. A time-ordered UUID v7 is similar in idea to a ULID. For random UUIDs, use the UUID generator.
Decode a ULID
Paste any ULID into the decoder to see the date and time it encodes in UTC, the millisecond value and the random part. The decoder also tells you if the text is not a valid ULID. A valid one has 26 characters from the Crockford alphabet, and its first character must be 7 or lower, because the timestamp is limited to 48 bits.
Limits
- The timestamp is read from your device clock. A wrong clock gives IDs with a wrong time.
- A ULID is an identifier, not a secret. Do not use one as a password or token.
- Uniqueness across machines relies on the 80 random bits. Collisions are extremely unlikely but not impossible in theory.
Frequently asked questions
A ULID is a 26-character identifier made of a 48-bit millisecond timestamp and 80 random bits, written in Crockford Base32. It is unique and sorts in time order when compared as text.
A ULID is shorter as text, sorts by creation time, and shows when it was made. A random UUID v4 has more random bits, has no time order and does not reveal its creation time.
Yes, up to 100 per batch. IDs made in the same millisecond are kept in increasing order by incrementing the random part.
The random part comes from crypto.getRandomValues, the browser's cryptographic generator. Still, a ULID shows its creation time, so use it as an identifier and not as a secret.
Paste it into the decoder above. It converts the first 10 characters back to a millisecond timestamp and shows the date in UTC.
Crockford's Base32 leaves them out to avoid confusion with 1, 0 and V and to avoid accidental words, which makes IDs easier to read and type.