ULID Generator and Decoder

Generate and decode Universally Unique Lexicographically Sortable Identifiers (ULID). Extract millisecond timestamps, parse Crockford Base32, and generate monotonic batches.

Live ULID Generator

26-character, URL-safe, lexicographically sortable identifier.

Decode ULID Identifier

Please enter a valid 26-character Crockford Base32 encoded ULID string.

Batch ULID Generator

Generate multiple sequential IDs for seed scripts or database testing.

High-Performance Distributed Primary Keys with ULID

Universally Unique Lexicographically Sortable Identifiers (ULIDs) resolve the performance drawbacks of traditional random UUIDv4s in relational and document databases (PostgreSQL, MySQL B-Trees). By combining a 48-bit millisecond timestamp with 80 bits of cryptographic randomness in 26 characters of URL-safe Crockford's Base32, ULIDs prevent database index fragmentation, provide natural time sorting, and remain 100% compatible with 128-bit UUID binary storage.

Key Technical Features

Instant ULID Generation

Generate single or batch (up to 50) cryptographically secure Crockford Base32 ULID identifiers.

Millisecond Timestamp Extraction

Decodes the leading 10 characters into human-readable ISO-8601 UTC dates, Unix epoch timestamps, and relative time.

Monotonic Factory Support

Ensures sequential ordering even when multiple IDs are generated within the exact same millisecond.

UUIDv4 Hex Cross-Conversion

Convert ULIDs to standard 8-4-4-4-12 hex UUID format for seamless migration into legacy UUID database columns.

Crockford Base32 Compliance

Case-insensitive, excludes ambiguous characters (I, L, O, U) to avoid human transcription errors.

Developer Code Snippets

Implementation snippets ready to copy for Node.js, Python, Go, and Rust.

Practical Engineering Scenarios

  • Database B-Tree Index Optimization

    Replace random UUIDv4 primary keys in Postgres and MySQL to eliminate cache misses and page splits.

  • Distributed Event Sourcing & Messaging

    Tag Kafka and RabbitMQ event stream payloads with naturally time-sortable IDs.

  • Public URL & API Resource Identifiers

    Expose clean, 26-character, URL-safe resource IDs (e.g. stripe-like or linear-like IDs) without leaking consecutive database auto-increments.

  • Log & Telemetry Correlators

    Embed traceable trace IDs across distributed microservices.

Frequently Asked Questions

What is the difference between a ULID and a UUIDv4?

UUIDv4 is 128 bits of pure pseudorandomness, which causes severe B-Tree index fragmentation when used as a database primary key. A ULID is also 128 bits, but its first 48 bits encode a Unix millisecond timestamp, making it lexicographically sortable and highly index-friendly.

Can ULIDs be stored in a PostgreSQL UUID column?

Yes! Because ULIDs are 128 bits in binary, they can be seamlessly converted to standard 36-character hexadecimal UUID format and stored directly in PostgreSQL's native 16-byte `UUID` data type.

What happens if two ULIDs are generated in the exact same millisecond?

Standard ULID implementations use a monotonic factory: when generating multiple IDs within the same millisecond, the random component is incremented by 1 bit, guaranteeing absolute sequential sort order without collisions.

What is Crockford's Base32 encoding?

Crockford's Base32 is an alphanumeric encoding alphabet of 32 characters (0-9, A-Z) that intentionally excludes I, L, O, and U to prevent confusion with numbers 1 and 0, and to avoid accidental obscenities.

ARCADE BRAIN BREAK

Need a Brain Break? ☕

Done working on your task? Take a quick 60-second break, test your reflexes, and flap through infinite pixel obstacles in Sky Flap!

Instant Browser Play High Score Tracker