ULID Generator

Generator

Generate ULIDs instantly. Time-sortable, 128-bit, URL-safe Crockford Base32. Monotonic mode and custom timestamps. Free, runs in your browser.

Options
ULID
Click Generate to create your first ULID
What is a ULID?

ULID (Universally Unique Lexicographically Sortable Identifier) is a 128-bit identifier designed as a sortable alternative to UUID v4. Proposed by Alizain Feerasta in 2016, it encodes the current millisecond timestamp in its first 10 characters, so IDs generated close together sort close together in any standard alphabetical or B-tree index.

Unlike UUID v4 (which is entirely random), a ULID reveals its creation timestamp and guarantees chronological sort order — a critical property for database primary keys, event logs, and distributed tracing. The format uses Crockford Base32 (no I, L, O, or U) to be URL-safe and visually unambiguous.

ULID predates UUID v7 (the 2024 IETF standard that solves the same problem) and still has broader library support across languages. Many teams use ULID for new projects while UUID v7 adoption grows.

ULID Format Breakdown
01ARZ3NDEKTSV4RRFFQ69G5FAV
Timestamp (10 chars · 48 bits · ms since Unix epoch)Random (16 chars · 80 bits · CSPRNG)
ULID vs UUID v4 vs UUID v7
ULIDUUID v4UUID v7
Sortable✓ Yes✗ No✓ Yes
Timestamp48-bit msNone48-bit ms
Random bits80 bits122 bits74 bits
EncodingCrockford Base32Hex + hyphensHex + hyphens
String length26 chars36 chars36 chars

About this tool

About ULID Generator

ULID (Universally Unique Lexicographically Sortable Identifier) is a 128-bit identifier format designed to fix one of UUID v4's biggest pain points: random IDs that break database index locality. A ULID encodes the current millisecond in its first 10 characters, so IDs generated close together sort close together — making range queries fast and INSERT performance smooth on B-tree indexes.

Every ULID is encoded as exactly 26 characters using Crockford Base32 (alphabet 0–9 A–Z, excluding I, L, O, U to avoid visual ambiguity). The first 48 bits carry the Unix timestamp in milliseconds; the remaining 80 bits are cryptographically random. Monotonic mode guarantees that multiple ULIDs generated within the same millisecond still sort in generation order by incrementing the random section.

ULIDs are ideal for distributed systems that need time-ordered primary keys without a central sequence generator — event sourcing, message queues, log correlation, and any append-heavy workload benefit immediately. They are URL-safe, case-insensitive, and decode back to an exact creation timestamp without any external lookup.

Compared to UUID v4, ULIDs are about 48% shorter when stored as a string, sort correctly in any lexicographic index, and expose the creation timestamp for free. Compared to UUID v7 (the new IETF standard), ULID has broader library support and a larger random section (80 bits vs 74 bits in UUID v7). All generation happens in your browser using the Web Crypto API — nothing is sent to a server.

Key Features

  • 26-character Crockford Base32 encoding (URL-safe)
  • 48-bit millisecond timestamp prefix for natural sort order
  • 80-bit cryptographically random suffix
  • Monotonic mode: sequential IDs in the same millisecond
  • Custom timestamp: generate ULIDs for any point in time
  • Bulk generation: up to 1000 ULIDs at once
  • Decoded timestamp shown for every generated ULID
  • One-click copy per ID and copy-all
  • 100% browser-based, no server calls

FAQ

ULID Generator — Frequently Asked Questions

Is ULID better than UUID?

It depends on your use case. ULID has one major advantage over UUID v4: it is lexicographically sortable. Because the first 48 bits encode the creation timestamp, ULIDs generated close together sort close together in any B-tree index. This means INSERT-heavy workloads on databases like PostgreSQL or MySQL see less index fragmentation and better range query performance. If sort order and timestamp decoding matter to you, ULID is the better choice. If you only need global uniqueness and don't care about ordering, UUID v4 is simpler and more universally supported.

Are ULIDs secure?

The 80-bit random suffix is generated with the Web Crypto API (crypto.getRandomValues), which provides cryptographically secure pseudo-random values. This means it is computationally infeasible to predict or enumerate future ULIDs from observed ones. However, ULIDs are not secret tokens — the timestamp prefix is intentionally visible. Never use a ULID alone as a secret bearer token; pair it with a separate authentication mechanism.

Can I decode the timestamp from a ULID?

Yes. The first 10 characters of a ULID encode the Unix timestamp in milliseconds using Crockford Base32. To decode: treat each character as its Base32 value (0–31), concatenate the values into a 50-bit integer (the upper 10 bits of a 48-bit timestamp are unused — it's 48 bits, not 50), and convert to a JavaScript Date. This generator shows the decoded timestamp next to every ULID it produces.

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

Without monotonic mode, both ULIDs get independently random 80-bit suffixes. There is a tiny probability (roughly 1 in 2^80) they could be identical or sort in the wrong order. With monotonic mode enabled, the generator remembers the last random part and increments it by 1 for each subsequent ID within the same millisecond. This guarantees strict sort order even at high generation rates, at the cost of making the suffix slightly less random (the last few bits are incremental rather than random).

What about ULID collisions?

The probability of a collision between two independently generated ULIDs is astronomically small. The random section holds 2^80 ≈ 1.2 × 10^24 possible values. Even generating 1 million ULIDs per second for an entire year would leave the birthday-paradox collision probability below 1 in 10^12. In practice, ULID collisions are not a concern for any realistic workload.

ULID vs UUID v7 — which should I use?

UUID v7 (RFC 9562, finalised 2024) and ULID solve the same problem — time-ordered unique IDs — but UUID v7 is now an IETF standard with growing native database support (PostgreSQL 17 understands UUID v7 natively). ULID has been around longer and has more library implementations across more languages today. UUID v7 has a slightly smaller random section (74 bits vs 80 bits), uses hyphenated hex instead of Crockford Base32, and stores more efficiently in UUID-typed database columns. If you're starting a new project in 2024+, UUID v7 is worth evaluating; if you have existing ULID infrastructure or need the 80-bit random section, stick with ULID.

Tips

  • Enable monotonic mode when generating multiple IDs in a tight loop — it guarantees sort order within the same millisecond
  • Use a custom timestamp to generate ULIDs anchored to a past or future time, useful for seeding test databases
  • The first 10 characters of any ULID are its timestamp — you can sort any list of ULIDs alphabetically and they'll be in chronological order
  • Copy All outputs one ULID per line, ready to paste into a SQL script or CSV