Tooleux

Generate ULIDs in bulk. 26 characters, timestamp-prefixed, lexicographically sortable.

Runs in your browser. Nothing leaves your device.
Generate ULIDs - 26-character sortable identifiers that combine a timestamp and random data. Read more Show less

What is a ULID?

A ULID (Universally Unique Lexicographically Sortable Identifier) is a 128-bit identifier encoded as 26 characters of Crockford's Base32. It combines a 48-bit millisecond timestamp with 80 bits of randomness, so IDs generated later always sort after IDs generated earlier when compared as strings.

ULIDs solve a specific problem with UUID v4: randomness-only IDs have no natural ordering, which makes them hostile to database indexes. UUID v7 solved the same problem within the UUID spec. ULID is the earlier, simpler, standalone version of that idea - and unlike UUIDs, ULIDs are naturally compact and URL-safe.

Structure

A ULID has two parts, encoded together as 26 base32 characters:

  • First 10 characters - 48-bit Unix timestamp in milliseconds. This sorts chronologically.
  • Last 16 characters - 80 bits of randomness. Collision probability is negligible for any realistic workload.

Example: 01ARZ3NDEKTSV4RRFFQ69G5FAV

How to use

Set the quantity and letter case, then click Generate. Every change to a setting regenerates the batch. The output is one ULID per line, ready to copy.

ULID vs UUID

UUID v4 - 36 characters, purely random, no ordering, has hyphens.

UUID v7 - 36 characters, timestamp-prefixed and sortable, has hyphens. Newer (RFC 9562, 2024).

ULID - 26 characters, timestamp-prefixed and sortable, no hyphens. Older, widely used in Go, Rust, and JavaScript ecosystems.

Both ULID and UUID v7 give you sortable unique IDs. ULID is more compact; UUID is more standardized. Either is fine for a new project.

FAQ

Are ULIDs guaranteed to be unique?

Not mathematically, but the 80-bit random component means collision probability is roughly 1 in 10^24 for a million IDs generated in the same millisecond. For any realistic system, they are unique.

Can I sort ULIDs as strings?

Yes. That is the point. Because the encoding is fixed-length and the alphabet is ordered, string comparison produces chronological order for IDs generated in the same process with synchronized clocks.

Are ULIDs case-sensitive?

No. ULIDs use Crockford's Base32, which is case-insensitive and omits the letters I, L, O, and U to avoid confusion. Uppercase is conventional.

Should I use ULID as a database primary key?

Usually, yes - it is a good choice. It is smaller than UUID-as-text (26 vs 36 chars), sorts by creation time, and avoids the index fragmentation that random UUIDs cause in B-tree databases. Monotonic variants exist that guarantee strict ordering even within the same millisecond.

Command line equivalent
# Node
npm i ulid
node -e 'const { ulid } = require("ulid"); console.log(ulid())'

# Python
pip install python-ulid
python3 -c 'from ulid import ULID; print(ULID())'

# PostgreSQL
# No native ULID type. Store as text or bytea.
Loads a test value into the form
About this tool
Generated ULIDs