A ULID is a 128-bit identifier like a UUID, but encoded as 26 Crockford Base32 characters with a millisecond timestamp at the front. That makes ULIDs sort lexicographically by creation time while staying compact and URL-safe.
Key takeaways
- ULIDs are 26 characters and sort by creation time.
- The first 10 characters encode a 48-bit millisecond timestamp.
- Use Crockford Base32, which avoids ambiguous characters (I, L, O, U).
For implementation context, continue with UUID vs ULID, UUID v7, and Nano ID. These pages cover the closest generator, comparison, validation or storage decisions without repeating this guide.
What a ULID is
A ULID (Universally Unique Lexicographically Sortable Identifier) packs the same 128 bits as a UUID into a shorter, case-insensitive Base32 string. The leading 48 bits are a Unix millisecond timestamp and the remaining 80 bits are random, so newer ULIDs sort after older ones as plain text.
That ordering is the whole appeal: ULIDs work well as database keys, log identifiers and cursor values where you want rough time ordering without a separate timestamp column.
01ARZ3NDEK TSV4RRFFQ69G5FAV
^^^^^^^^^^ 48-bit timestamp (10 chars)
^^^^^^^^^^^^^^^^ 80-bit randomness (16 chars)ULID vs UUID v7
Both ULID and UUID v7 put a timestamp first to gain sortability. ULID is shorter (26 vs 36 characters) and Base32-readable, while UUID v7 stays inside the UUID standard with native database types and universal tooling. If standardization matters, prefer UUID v7; if a compact sortable string matters most, ULID is a good fit.