ULID
Universally Unique Lexicographically Sortable Identifier. ULIDs combine a 48-bit millisecond timestamp with 80 bits of randomness — producing IDs that are both unique and chronologically sortable. 26 characters using Crockford's Base32 (case-insensitive). More database-friendly than UUID v4 since sorting by ULID also sorts by creation time. Available in many languages; multiple npm packages implement the spec.
Score Breakdown
⚙ Agent Friendliness
🔒 Security
Uses cryptographically secure randomness. Timestamp component is publicly visible in the ID — don't use for tokens where timing should be hidden.
⚡ Reliability
Best When
You need unique IDs that are chronologically sortable for use as database keys, cursor pagination, or event IDs.
Avoid When
You need random IDs without embedded timestamp (use Nano ID), or standard UUID format compliance (use uuid library).
Use Cases
- • Generate database primary keys that sort chronologically without a separate created_at column
- • Create agent-generated resource IDs where chronological ordering is important — events, messages, records
- • Use as cursor-compatible pagination IDs that are both unique and inherently ordered
- • Generate correlation IDs for distributed tracing that can be used to determine event ordering
- • Replace UUID v4 where time-sortability matters — event sourcing, message queues, audit logs
Not For
- • Security-sensitive tokens where timestamp information should not be embedded — use Nano ID or UUID v4
- • Exact timestamp extraction requirements — ULIDs embed millisecond precision; if microsecond precision matters, use UUIDv7
- • Browser environments where crypto.getRandomValues is unavailable — verify compatibility
Interface
Authentication
No authentication — local ID generation.
Pricing
Multiple open-source implementations. The 'ulid' npm package is MIT licensed.
Agent Metadata
Known Gotchas
- ⚠ Multiple 'ulid' npm packages exist — ulid, ulidx, @std/ulid — verify you're using an actively maintained implementation; the ecosystem is fragmented
- ⚠ ULIDs generated in the same millisecond are monotonically incremented — ensure this behavior meets your sortability requirements
- ⚠ Embedded timestamp is extractable — don't use ULID as a primary key if creation time should be hidden from end users or in URIs
- ⚠ UUIDv7 is the standards-track alternative — if interoperability with UUID-based systems matters, UUIDv7 provides similar time-ordering in UUID format
- ⚠ ULID monotonic mode (same-millisecond increment) requires shared state — distributed systems generating ULIDs concurrently don't coordinate increment; multiple concurrent ULIDs in same millisecond may sort unpredictably
- ⚠ Crockford Base32 encoding means ULIDs contain only 0-9 and A-Z (excluding I, L, O, U) — case-insensitive; both uppercase and lowercase are valid when parsing
Alternatives
Full Evaluation Report
Detailed scoring breakdown, competitive positioning, security analysis, and improvement recommendations for ULID.
Scores are editorial opinions as of 2026-03-06.