ULID generator for time-sortable IDs
This ULID generator creates Universally Unique Lexicographically Sortable Identifiers: 128-bit IDs that start with a millisecond timestamp, so sorting them as plain strings also sorts them by creation time. Each ULID is 26 characters of Crockford Base32, safe in URLs and file names, and the random part comes from your browser's cryptographically secure generator.
What is a ULID?
A ULID packs two parts into 128 bits:
| Part | Bits | Characters | Content |
|---|---|---|---|
| Timestamp | 48 | 10 | Milliseconds since the Unix epoch |
| Randomness | 80 | 16 | Random bits |
Crockford Base32 uses the digits and the letters A–Z except I, L, O and U, which avoids confusion between 1, I and l or 0 and O. A 48-bit timestamp lasts until the year 10889, so you will not run out of time range.
Example output
Three ULIDs generated in one batch with Monotonic on look, for example, like this:
01M3DTZEJWBV5SZ9WHNHH1CE6Z
01M3DTZEJWBV5SZ9WHNHH1CE70
01M3DTZEJWBV5SZ9WHNHH1CE71
The first ten characters, 01M3DTZEJW, are the shared timestamp. Because all three fall in the same millisecond, monotonic mode keeps the first random part and adds one for each following ID (…CE6Z, …CE70, …CE71), so the list stays in strict order. The status line shows the exact time the batch was created. Your IDs will be different every time.
Options explained
- How many: from 1 to 1,000 IDs per click. A batch uses a single timestamp.
- Monotonic: when on, IDs from the same millisecond increment instead of getting fresh random bits, which guarantees the sort order matches generation order. When off, every ID gets independent randomness and IDs within the same millisecond sort in random order.
- Lowercase: ULIDs are case-insensitive by spec, so lowercase output decodes to the same value.
- Format — UUID form: writes the same 128 bits as 36-character hex with hyphens, e.g.
01a0dbaf-ba5d-693e-1794-78a29c218b28. Use it to store ULIDs in a PostgreSQLuuidcolumn. Note that the version and variant nibbles are just ULID bits, so a UUID validator will report an arbitrary version.
ULID vs UUID v7
Both are 128-bit IDs with a 48-bit Unix millisecond timestamp at the front, so both sort by time and index well in B-tree databases. The differences are in encoding and standardization:
- Text form: a ULID is 26 Base32 characters; a UUID v7 is 36 hex characters with hyphens.
- Randomness: a ULID has 80 random bits; UUID v7 spends 6 bits on the version and variant fields, leaving 74.
- Standard: UUID v7 is defined in RFC 9562 and is accepted by any system that expects a UUID. ULID is a community specification that needs a library or a UUID-form conversion.
Choose ULID when short, readable IDs matter, for example in URLs or log lines. Choose UUID v7 from the UUID generator when your database, ORM or API already speaks UUID.
Common questions when adopting ULIDs
- They leak creation time. Anyone with the ID can read its timestamp with a ULID decoder. Do not use ULIDs where that is sensitive; use a random ID instead.
- Sorting across machines. Monotonic ordering applies within one generator. IDs from different servers in the same millisecond are ordered by their random bits.
- Case and look-alikes. Decoders treat
IandLas1andOas0, so a ULID typed by hand still resolves correctly.
Privacy
ULIDs are generated in your browser with crypto.getRandomValues. Nothing is requested from or logged on a server, so the IDs you copy have never been seen by anyone else.