What is a ULID?
A ULID (Universally Unique Lexicographically Sortable Identifier) is a 128-bit identifier that combines a 48-bit Unix timestamp (milliseconds) with 80 bits of cryptographically secure randomness. It's encoded as 26 characters using Crockford Base32, making it more compact than a UUID's 36 characters while being case-insensitive and URL-safe.
The format is
TTTTTTTTTTRRRRRRRRRRRRRRRR,
where the first 10 characters encode the timestamp and the last 16 are random.
The character set excludes I, L, O, and U to avoid ambiguity.
ULID vs UUID
| Feature | ULID | UUIDv4 | UUIDv7 |
|---|---|---|---|
| Length | 26 chars | 36 chars | 36 chars |
| Encoding | Crockford Base32 | Hex + hyphens | Hex + hyphens |
| Sortable | Yes | No | Yes |
| Timestamp | 48-bit ms | None | 48-bit ms |
| Case-sensitive | No | No | No |
Frequently Asked Questions
- Can I store a ULID in a UUID database column?
- Yes. A ULID is 128 bits, the same as a UUID. Most ULID libraries provide conversion functions between ULID strings and standard UUID format.
- Why does ULID exclude I, L, O, and U?
- Crockford Base32 excludes these letters to prevent visual confusion with 1, 1, 0, and V respectively, reducing transcription errors when ULIDs are read or typed by humans.
- Is my data sent to a server?
- No. ULIDs are generated and validated entirely in your browser. Nothing is sent to any server.