Developer

ULID Generator

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

Loading interactive tool…

Embed this tool on your site

About this tool

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. This tool generates 1 to 50 ULIDs per click from the current time, shows the decoded timestamp beside each one, and includes a decoder that extracts the timestamp from any ULID you paste. It does not use the optional monotonic mode: ULIDs made in the same millisecond share a timestamp but have independent random suffixes, so their order within that millisecond is random. ULIDs are widely used as primary keys in distributed systems, event logs, and databases where insertion order matters.

Why use it

  • Embeds creation timestamp — ULIDs sort chronologically by default.

  • 128-bit identifiers whose 80 random bits make collisions vanishingly unlikely in distributed systems.

  • URL-safe Crockford Base32 encoding — no special characters.

  • Batch generation of up to 50 IDs 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

  1. Move the Count (1–50) slider to choose how many ULIDs to create; five are generated when the page loads.
  2. Click Generate to create a new batch from the current time.
  3. Click Copy next to a ULID to copy it, or Copy All for the full batch, one per line.
  4. Read the decoded timestamp shown beside each ULID to verify the embedded time.
  5. Paste any 26-character ULID into the Decode ULID box to see its timestamp as an ISO 8601 UTC value.

When it helps

  • 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

Decode the ULID spec's sample ID

Input
Decode ULID: 01ARZ3NDEKTSV4RRFFQ69G5FAV
Expected result
Timestamp: 2016-07-30T23:54:10.259Z

Decode an existing ULID

Input
Decode ULID: 01HF2M9V7K4Y0Q3P2N1R5T8Z6W
Expected result
Timestamp: 2023-11-12T20:41:50.579Z

Wrong length

Input
Decode ULID: 01HF2M9V7K
Expected result
ULID must be 26 characters

Batch for seeding

Input
Count: 5, click Generate
Expected result
Five 26-character ULIDs, each with its decoded timestamp and a Copy button; Copy All copies them one per line.

Tips

  • Generate a batch and compare the IDs: ULIDs made in the same click usually share the 10-character timestamp prefix, while the 16-character random suffix differs and is not ordered within that millisecond.
  • 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 in your own code, use a monotonic ULID factory from your language's ULID library to keep ordering stable inside one millisecond; this tool does not generate monotonic sequences.
  • 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.
A LITTLE HELP. A LOT DONE.
Good tools.
Great flow.

Your shortcut to the everyday. Create, convert, calculate,
and get back to what you love.

✓ Free to use✓ No sign-up✓ 500+ possibilities