UtilityKit

500+ fast, free tools. Most run in your browser only; Image & PDF tools upload files to the backend when you run them.

ULID Generator

Generate Universally Unique Lexicographically Sortable Identifiers (ULIDs) — sortable alternatives to UUIDs.

About ULID Generator

The ULID Generator creates Universally Unique Lexicographically Sortable Identifiers, a modern alternative to UUID/GUID. A ULID is a 26-character Crockford Base32 string encoding a 48-bit millisecond timestamp followed by 80 bits of randomness — making ULIDs globally unique while sorting chronologically by default. Unlike UUID v4, ULIDs embed a time component, so a sorted list of ULIDs is also sorted by creation time. They are URL-safe, case-insensitive, and monotonically sortable when multiple are generated within the same millisecond. ULIDs are widely used as primary keys in distributed systems, event logs, and databases where insertion order matters.

Why use ULID Generator

  • Embeds creation timestamp — ULIDs sort chronologically by default.
  • 128-bit unique with no collision risk in distributed systems.
  • URL-safe Crockford Base32 encoding — no special characters.
  • Bulk generation with one-click copy of single or all IDs.
  • Compact 26-character representation is shorter than a hyphenated UUID (36 chars) while still carrying 128 bits of uniqueness.
  • Specification is open and stable since 2016, with battle-tested implementations in every major language.

How to use ULID Generator

  1. Click Generate to create a new ULID.
  2. Use the Count field to generate multiple ULIDs at once.
  3. Click Copy to copy a single ULID or Copy All for the full batch.
  4. The timestamp component is decoded and displayed so you can verify the embedded time.
  5. Switch on Monotonic mode if you need multiple ULIDs in one millisecond to maintain strict insertion order.
  6. Pick a custom timestamp to generate historical ULIDs for backfilling records or simulating time-travel test data.

When to use ULID Generator

  • Generating primary keys for database records where insertion order should be sortable.
  • Creating event IDs in distributed logs where time ordering is needed.
  • Replacing UUID v4 when lexicographic sort order matters.
  • Generating batch IDs for imports, jobs, or distributed tasks.
  • Building append-only event stores or audit logs where range queries by time are common.
  • Sharding data across nodes when you want recent rows to colocate naturally on the same partition.

Examples

Single ULID at a known timestamp

Input: Timestamp: 2016-07-30T22:00:00Z (ms: 1469916000000)

Output: 01ARZ3NDEKTSV4RRFFQ69G5FAV

Two ULIDs in the same millisecond

Input: Generate count: 2 (single click)

Output: 01HF2M5K8R0001ABCDXYZ12345 01HF2M5K8R0001ABCDXYZ12346

Decode an existing ULID

Input: 01HF2M9V7K4Y0Q3P2N1R5T8Z6W

Output: Timestamp: 2023-11-15T14:23:51.219Z Random: 4Y0Q3P2N1R5T8Z6W

Bulk batch for seeding

Input: Count: 5

Output: 01HFA1... 01HFA1... 01HFA1... 01HFA1... 01HFA1...

Tips

  • Generate a batch and inspect the IDs side by side — within the same millisecond, ULIDs incremement monotonically so you can verify the random suffix is sorted, not just the timestamp prefix.
  • Treat the 26-character ULID as opaque in your application code; do not slice the string to extract the timestamp manually because edge cases at the 48-bit boundary will bite you.
  • Store ULIDs as a 16-byte BINARY(16) column in MySQL or BYTEA in Postgres for index density — VARCHAR storage works but doubles the size and slows range scans.
  • When inserting many rows in a tight loop, reuse a monotonic ULID factory rather than calling Generate per row to keep ordering stable inside one millisecond bucket.
  • ULIDs are case-insensitive, but always normalize to uppercase on write so that clustered indexes stay tight and string comparisons remain stable across drivers.
  • Avoid mixing ULIDs and UUIDs in the same primary-key column — Crockford Base32 and hex-with-dashes have different sort orders and any join you build will misbehave.
  • If you expose ULIDs in URLs, audit for ID-enumeration risk; the timestamp prefix leaks creation time, which can be a privacy concern for user-facing resources.

Frequently Asked Questions

What is the difference between ULID and UUID?
UUID v4 is purely random with no time component. ULID encodes a millisecond timestamp in the first 48 bits, making ULIDs lexicographically sortable by creation time.
Is ULID unique across machines?
Yes. The 80-bit random suffix combined with the timestamp provides collision resistance equivalent to UUID v4.
What does Crockford Base32 mean?
Crockford Base32 uses a 32-character alphabet that excludes visually ambiguous characters (I, L, O, U), reducing transcription errors.
Can I extract the timestamp from a ULID?
Yes. The first 10 characters encode the millisecond timestamp. This tool decodes and displays it alongside each generated ULID.
Are ULIDs case-sensitive?
No. Crockford Base32 is case-insensitive, so uppercase and lowercase ULIDs are equivalent.
Are ULIDs safe to expose in public URLs?
The random suffix is unguessable, but the timestamp prefix leaks creation time. If creation time is sensitive (e.g. account signup order), prefer Nano ID or UUID v4 for public URLs.
Do popular databases support ULIDs natively?
Postgres can store ULIDs as UUID, BYTEA, or TEXT; MySQL supports BINARY(16); MongoDB stores them as a string field. Few engines have a native ULID type, but extensions exist for Postgres.
What happens after the year 10889?
The 48-bit timestamp space exhausts in 10889 AD. ULID specifications consider this acceptable for any realistic system; there is no rollover handling defined.

Explore the category

Glossary

ULID
Universally Unique Lexicographically Sortable Identifier — a 128-bit ID encoded as 26 Crockford Base32 characters with a 48-bit timestamp prefix.
Crockford Base32
An alphabet of 32 characters (0-9, A-Z minus I, L, O, U) designed by Douglas Crockford to be unambiguous when read or transcribed by humans.
Lexicographic sortability
The property that sorting strings as text yields the same order as sorting them as creation timestamps; ULIDs are designed to satisfy this.
Monotonicity
Guarantee that two IDs generated in the same millisecond still sort correctly — implementations achieve this by incrementing the random component.
Time component
The first 48 bits (10 characters) of a ULID, encoding Unix milliseconds since 1970, valid through the year 10889 AD.
Random component
The trailing 80 bits (16 characters) of a ULID, drawn from a cryptographically secure RNG to give 2^80 unique values per millisecond.
Collision probability
Chance that two independently generated IDs are identical; for ULIDs, requires more than 2^40 IDs in one millisecond before collisions become likely.