ULID Generator
Generate Universally Unique Lexicographically Sortable Identifiers.
01KXADSKD351PX2V1Y3M3MX87V01KXADSKD3R5PHA2BJ6V1H2CZ601KXADSKD3MDKM8F7B1X2TN2YX01KXADSKD3A1E5G843TB0EK2RM01KXADSKD3DN1ACEAG071R4J64How 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.