ULID Generator
Generate Universally Unique Lexicographically Sortable Identifiers.
01KX6P8T3E3X7RMAV5KFF511Z701KX6P8T3EKSSENAHT7RKZKB8S01KX6P8T3ESBFBAB8WZA5ZBRS501KX6P8T3EVT26R6DVFYFBJG5601KX6P8T3EKBMFKNSXHXDZ9KB4How to Use
- Set the number of ULIDs to generate. Optionally specify a custom timestamp (defaults to the current time in milliseconds).
- 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).
- 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.