DEVELOPER TOOL

ULID Generator

Generate ULIDs, the sortable alternative to UUIDs, one at a time or up to 100 at once, and decode any ULID back to its timestamp.

Decode a ULID

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

ULIDUUID v4
Length as text26 characters36 characters with hyphens
Sortable by timeYes, as textNo, fully random
Randomness80 bits122 bits
Character setCrockford Base32Hexadecimal
Reveals creation timeYes, anyone can decode itNo

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

Frequently asked questions

What is a ULID?

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.

What is the difference between a ULID and a UUID?

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.

Can I generate more than one ULID at a time?

Yes, up to 100 per batch. IDs made in the same millisecond are kept in increasing order by incrementing the random part.

Are the ULIDs from this tool secure random?

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.

How do I get the date from a ULID?

Paste it into the decoder above. It converts the first 10 characters back to a millisecond timestamp and shows the date in UTC.

Why are I, L, O and U missing from ULIDs?

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.