URL-safe ULID generator
A ULID (Universally Unique Lexicographically Sortable Identifier) is a 26-character identifier designed as a friendlier alternative to the UUID. It combines a 48-bit millisecond timestamp with 80 bits of randomness and encodes the result in Crockford base32, producing IDs that sort by creation time, contain no hyphens, and are safe to drop straight into URLs, filenames and log lines. This generator creates one ULID or a sortable batch of up to a thousand, all in your browser.
How it works
The 128 bits of a ULID are split into two parts and base32-encoded:
- Timestamp (first 10 characters) — the current time in milliseconds since the Unix epoch, encoded as a 48-bit integer.
- Randomness (last 16 characters) — 80 random bits drawn from the browser’s
crypto.getRandomValues.
Crockford base32 uses the alphabet 0-9 and A-Z minus the ambiguous letters
I, L, O and U. Because this encoding preserves byte order, sorting ULIDs
as plain strings sorts them chronologically. When you request a batch, each ULID’s
timestamp is incremented by one millisecond so the whole batch stays strictly
ordered.
Example
A ULID generated now looks like 01ARZ3NDEKTSV4RRFFQ69G5FAV. The first ten
characters 01ARZ3NDEK are the encoded timestamp; the remaining sixteen
TSV4RRFFQ69G5FAV are random. Generate a batch of three and you get three IDs
whose leading characters increase in lockstep, so they sort in creation order
even before the random tail is considered.
| Property | Value |
|---|---|
| Total length | 26 characters |
| Timestamp bits | 48 (first 10 chars) |
| Random bits | 80 (last 16 chars) |
| Encoding | Crockford base32 |
| Case-sensitive | No |
Generation happens entirely on your device — the timestamp and random bits come from your browser’s Web Crypto, and nothing is uploaded.