ULID Generator & Decoder

Generate, decode, and validate ULIDs instantly

Free ULID generator to create universally unique, lexicographically sortable identifiers. Generate single or bulk ULIDs, decode timestamps, and validate format. 100% client-side, your data never leaves your browser.

Click Generate to create a ULID

ULID Structure

Timestamp 48 bits / 10 chars
Randomness 80 bits / 16 chars
01ARZ3NDEKTSV4RRFFQ69G5FAV

ULID Format

Length26 characters
EncodingCrockford Base32
Size128 bits (16 bytes)
SortableYes, lexicographically
CaseCase-insensitive

ULID vs UUID

LengthULID: 26, UUID: 36
SortableULID: Always, UUID v4: No
EncodingULID: Base32, UUID: Hex
TimestampULID: Always, UUID v4: No
URL-safeULID: Yes, UUID: Needs encoding

ULID Guide

What is a ULID?

ULID (Universally Unique Lexicographically Sortable Identifier) is a 128-bit identifier that combines a timestamp with randomness. It is encoded as a 26-character string using Crockford Base32. Unlike UUID v4 which is random and unsortable, ULIDs are always sorted by creation time when you sort them as strings.

ULIDs were created as a modern alternative to UUIDs for cases where time-ordering matters, like database primary keys, event logs, and distributed systems.

How ULIDs Work

A ULID has two parts:

  • Timestamp (48 bits, 10 chars): Unix time in milliseconds. This is always the first part, so string sorting equals time sorting.
  • Randomness (80 bits, 16 chars): Cryptographically random data for uniqueness within the same millisecond.

The encoding uses Crockford Base32, which excludes the letters I, L, O, and U to avoid visual confusion with digits. This makes ULIDs easy to read, copy, and type.

Monotonic ULIDs

When multiple ULIDs are generated in the same millisecond, the random portion can either be fully random (which doesn't guarantee sort order within that ms) or monotonically incremented.

Monotonic generation takes the previous ULID's random bits and adds 1. This guarantees strict ordering even when generating thousands of IDs per millisecond. Most ULID libraries support this mode.

ULID vs UUID: When to Use Which

  • Use ULID when you need sortable IDs, shorter strings, or better database index performance.
  • Use UUID v4 when you need maximum compatibility with existing systems that expect UUID format.
  • Use UUID v7 as a middle ground: sortable like ULID but in the standard UUID format.

Generate UUIDs with our UUID Generator or decode distributed IDs with the Snowflake ID Decoder.

Crockford Base32 Encoding

ULIDs use Crockford Base32 which encodes 5 bits per character using this alphabet:

0123456789ABCDEFGHJKMNPQRSTVWXYZ

  • No I (confused with 1 or l)
  • No L (confused with 1 or I)
  • No O (confused with 0)
  • No U (could be offensive in some combinations)

This results in 26 characters for 128 bits, compared to 36 characters for a UUID. ULIDs are case-insensitive: 01ARZ3NDEK and 01arz3ndek are the same ULID.

ULID Generator FAQ

What is a ULID?

A ULID is a 128-bit unique identifier encoded as 26 Crockford Base32 characters. It combines a 48-bit millisecond timestamp with 80 bits of randomness. ULIDs are sortable by creation time, case-insensitive, and URL-safe.

What is the difference between ULID and UUID?

ULIDs are 26 characters (Base32), always sortable, and always contain a timestamp. UUIDs are 36 characters (hex), and only v1 and v7 contain timestamps. UUID v4, the most common version, is random and not sortable. ULIDs are shorter and better for database primary keys.

Are ULIDs sortable?

Yes. The timestamp is encoded first, so standard string sorting puts ULIDs in chronological order. This is the main advantage over UUID v4.

Can I use ULIDs as database primary keys?

Yes, and they work great. Because ULIDs are time-sorted, new rows always append to the end of B-tree indexes. This avoids the page splits and fragmentation that random UUIDs cause.

What is Crockford Base32?

An encoding that uses 32 characters: digits 0-9 and letters A-Z excluding I, L, O, U. It avoids characters that look similar (I vs 1, O vs 0). It is case-insensitive and produces shorter strings than hexadecimal.

What is monotonic ULID generation?

When multiple ULIDs are generated in the same millisecond, monotonic mode increments the random portion instead of generating new random bits. This guarantees strict sort order within the same millisecond.

Can two ULIDs ever collide?

With 80 bits of randomness per millisecond, collisions are practically impossible. You would need to generate about 1.21 x 1012 ULIDs in the same millisecond for a 50% collision chance. With monotonic generation, collisions are impossible by design.

Is it safe to generate ULIDs online?

Yes. This tool uses crypto.getRandomValues() for cryptographically secure randomness. All ULIDs are generated entirely in your browser. No data is sent to any server.