๐ ULID Generator
Generates ULIDs (Universally Unique Lexicographically Sortable Identifiers), which combine a 48-bit millisecond timestamp with 80 bits of randomness. Unlike UUIDs, ULIDs sort correctly as plain strings in the order they were generated.
How to use
- Set how many IDs to generate.
- Click "Generate" to produce a list of ULIDs.
- Copy individual IDs or the whole list to your clipboard.
How the calculation works
A ULID (Universally Unique Lexicographically Sortable Identifier) is a unique ID that sorts as text in the order it was created. Like a UUID it is 128 bits, but it is only 26 characters long and starts with a timestamp. Layout โข First 10 characters: milliseconds since 1 January 1970 (48 bits) โข Last 16 characters: cryptographically secure random data (80 bits) It uses Crockford's Base32 (0โ9 and AโZ without the easily confused I, L, O and U). Because the timestamp comes first, sorting ULIDs as strings puts them in creation order. The tool can also read the creation time back out of a ULID.
Worked example
Sample ULID 01J8GZ5N3K7Q9V2XWM4YBTCRHE First 10 characters "01J8GZ5N3K": the creation time in milliseconds Remaining 16: the random part ULIDs created within the same millisecond sort by their random part, so not necessarily in creation order.
Things to be aware of
- As database primary keys, ULIDs sort by creation time, which can make indexes more efficient than random UUID v4s.
- A ULID reveals when it was created, so avoid it where the creation time should stay private.
- UUID version 7, standardised in RFC 9562 in 2024, serves the same purpose.
FAQ
What's the difference between a ULID and a UUID?
A UUID is essentially random, so its generation order and sort order don't match. A ULID embeds a timestamp at the start, so sorting the strings alphabetically also sorts them by creation time.
What characters does a ULID use?
Crockford's Base32 โ 0-9 and a subset of A-Z that excludes I, L, O, and U to avoid visual ambiguity โ encoded as 26 characters total.
What's the structure of a ULID?
The first 10 characters encode a 48-bit millisecond timestamp, and the remaining 16 characters encode 80 bits of randomness.