🔧

ULID Generator

Generate Universally Unique Lexicographically Sortable Identifiers.

01M2N2WAVKC3YXCZ3YM01WY9AA
01M2N2WAVKES85D7V1BDBJF9SQ
01M2N2WAVKVRSBQYRHMQJB5TZE
01M2N2WAVKWDJR5CXHC28W34MS
01M2N2WAVKK6MT2TC043C4WR8C

How to Use

  1. Set the number of ULIDs to generate. Optionally specify a custom timestamp (defaults to the current time in milliseconds).
  2. Each generated ULID consists of a 10-character timestamp prefix and a 16-character random suffix, encoded in Crockford Base32 (26 characters total, uppercase letters and digits, no ambiguous characters).
  3. Copy the ULIDs for use as database primary keys, event IDs, log entry identifiers, or any situation requiring time-sortable unique identifiers.

Frequently Asked Questions

What is the difference between ULID and UUID?
ULIDs are lexicographically sortable — sorting them alphabetically is the same as sorting by creation time. They are also more compact: 26 characters vs 36 for UUID (no hyphens). UUID v4 is purely random with no time ordering. ULID is ideal when you need both uniqueness and natural time-based ordering.
How precise is the timestamp portion?
The timestamp encodes millisecond precision. For ULIDs generated within the same millisecond, the random portion is monotonically incremented to guarantee strict ordering even at high generation rates.
Can ULIDs be used as database primary keys?
Yes — ULIDs are an excellent choice for primary keys. Their time-ordered nature improves B-tree index performance by reducing page splits compared to random UUIDs. They work as text or binary columns in any major database.