What is ULID Generator?
ULID Generator — A ULID Generator is a free tool that creates Universally Unique Lexicographically Sortable Identifiers for use as database keys and distributed system IDs.
Loading your tools...
Generate ULIDs (Universally Unique Lexicographically Sortable Identifiers) for database primary keys and distributed systems. 26-character Crockford Base32 strings with millisecond timestamp prefix for natural time ordering. Drop-in UUID replacement with better sort performance.
ULID Generator: Click generate to create a new ULID instantly. ULIDs are 26-character strings that are sortable by creation time. Copy the result for use in databases, event logs, or distributed systems.
Loading Tool...
ULID Generator — A ULID Generator is a free tool that creates Universally Unique Lexicographically Sortable Identifiers for use as database keys and distributed system IDs.
Click Generate to create a new ULID with the current millisecond timestamp.
Use bulk generation to create multiple ULIDs for batch database seeding.
Copy the 26-character ULID for use as a primary key, event ID, or correlation ID.
Verify sort ordering by generating ULIDs at different times and comparing lexicographic order.
Database primary keys that sort by creation time without extra indexes
Event stream and message queue identifiers in distributed architectures
Replacing UUID v4 in applications that need time-ordered inserts
Correlation IDs for distributed tracing across microservices
A ULID looks like 01ARZ3NDEKTSV4RRFFQ69G5FAV — 26 characters encoded in Crockford Base32:
01ARZ3NDEK TSV4RRFFQ69G5FAV
└──────────┘ └──────────────┘
Timestamp Random
48 bits 80 bits
10 chars 16 charsTimestamp (10 chars): Unix milliseconds since 1970, encoded as Crockford Base32. Good until the year 10889 (48 bits of milliseconds). Randomness (16 chars): 80 bits from crypto.getRandomValues() — that's 280 ≈ 1.2 × 1024 possible random values per millisecond, making collisions effectively impossible.
Crockford's Base32 (designed by Douglas Crockford in 2005) uses the alphabet 0123456789ABCDEFGHJKMNPQRSTVWXYZ — note the absence of I, L, O, U. These letters are excluded because:
This makes ULIDs safe to read aloud, type by hand, or use in customer-facing URLs — far better than UUIDs full of 4dee2... hex.
| Aspect | UUID v4 | UUID v7 | ULID |
|---|---|---|---|
| Length | 36 chars (incl. dashes) | 36 chars | 26 chars |
| Sortable | No | Yes | Yes |
| Encoding | Hex (0-9 a-f) | Hex | Crockford Base32 |
| Ambiguous chars | None | None | None (I/L/O/U excluded) |
| RFC standard | RFC 4122 | RFC 9562 | Community spec (not RFC) |
| DB / lang support | Universal | Growing | Library-dependent |
| URL-friendly | OK | OK | Best |
Picking advice: ULID and UUID v7 give nearly identical benefits (sortable, 128-bit, time-prefixed). Choose UUID v7 if you need RFC compliance, universal DB driver support, or interop with existing UUID systems. Choose ULID if you want shorter IDs (26 vs 36 chars), URL-safer output, or no-confusion characters for human-readable IDs.
Random UUID v4 inserts kill database write performance. In PostgreSQL / MySQL / SQL Server, the primary key is stored as a B-tree index. When you INSERT with a random key, the row lands at a random position in the tree, forcing page splits, dirtying random pages, and producing random I/O. ULIDs (and UUID v7) fix this because new IDs always sort after existing IDs — INSERTs append to the rightmost leaf of the B-tree, like an auto-incrementing integer. Measured impact: 20–40% higher INSERT throughput, 30–50% smaller index size after long-running tables, better cache locality, fewer vacuum operations.
When you generate multiple ULIDs within the same millisecond, the timestamp portion is identical and the random portion can produce out-of-order ULIDs. Monotonic mode fixes this by incrementing the random part by 1 instead of regenerating it — so ULIDs created in the same millisecond are guaranteed strictly increasing. Enable monotonic mode for event streams, audit logs, and any scenario where strict ordering matters more than max randomness. (Non-monotonic mode is safe for most uses — millisecond resolution is sufficient for almost all sorting needs.)
ULIDs are 128-bit compatible with UUIDs but are lexicographically sortable. They offer millisecond precision timestamps and 80 bits of randomness per millisecond.