ULID Generator

Generate ULIDs (Universally Unique Lexicographically Sortable Identifiers) instantly in your browser — 26-character Crockford Base32 IDs with a millisecond timestamp baked in, so they sort chronologically as plain strings. Bulk-generate up to 1,000, decode any ULID back to its timestamp, validate the format, and compare ULID vs UUID v7 vs UUID v4. No signup, no server, 100% client-side.

Your ULIDs will appear here.
Randomness comes from crypto.getRandomValues() — the browser's cryptographically secure generator. Nothing leaves your device.

Worked examples

Decode the spec’s example ULID
01ARZ3NDEKTSV4RRFFQ69G5FAV → timestamp 1469922850259 → 2016-07-30 23:54:10.259 UTC. First 10 chars 01ARZ3NDEK decode to the 48-bit millisecond timestamp; the last 16 (TSV4RRFFQ69G5FAV) are 80 random bits.
The zero ULID
00000000000000000000000000 → timestamp 0 → 1970-01-01 00:00:00 UTC. The smallest possible ULID.
The maximum ULID
7ZZZZZZZZZZZZZZZZZZZZZZZZZ → timestamp 281474976710655 (2^48−1) → August of the year 10889. A first character of 8 or higher would overflow the 48-bit timestamp and is invalid.
Anatomy of a ULID
2021-01-01 00:00:00 UTC is 1609459200000 ms → time part 01ETXKWW00. With random bytes 00 01 02 … 09, the full ULID is 01ETXKWW00000G40R40M30E209 — 10 time chars + 16 random chars = 26.
Monotonic mode in action
Two ULIDs minted in the same millisecond (1700000000000 = 2023-11-14 22:13:20 UTC): 01HF7YAT00MQRHAPWAJ71Q1FE3 then 01HF7YAT00MQRHAPWAJ71Q1FE4 — the 80-bit random suffix increments by exactly 1, so lexical order matches creation order.
Invalid ULIDs
01ARZ3NDEKTSV4RRFFQ69G5FAI is invalid: I is not in the Crockford alphabet. 8ZZZZZZZZZZZZZZZZZZZZZZZZZ is invalid: the leading 8 overflows the 48-bit timestamp (max first char is 7).

Frequently asked questions

What is a ULID?

A ULID (Universally Unique Lexicographically Sortable Identifier) is a 26-character identifier encoded in Crockford Base32. Its first 10 characters encode a 48-bit Unix timestamp in milliseconds, and its last 16 characters encode 80 bits of randomness. Because the timestamp comes first, ULIDs sort chronologically when compared as plain strings — unlike random UUIDs. A ULID carries the same 128 bits as a UUID, so the two formats are interconvertible at the bit level.

What is the difference between ULID and UUID v7?

Both put a 48-bit millisecond timestamp first, so both sort by creation time. The difference is the text encoding and the standard: UUID v7 is defined by RFC 9562 and written as 36 hexadecimal characters with hyphens (8-4-4-4-12), while ULID follows the ulid/spec and is written as 26 Crockford Base32 characters with no hyphens. ULID strings are shorter, URL-safe, and case-insensitive; UUID v7 is the safer choice when you need a formal IETF standard. This tool can convert a ULID to its UUID text form bit-for-bit in the Decode tab.

ULID vs UUID v4 — which should I use?

Use ULID when you want IDs that sort by creation time: database primary keys, event logs, queue message IDs. UUID v4 is 122 bits of pure randomness with no embedded timestamp, so a set of v4 UUIDs sorts in no meaningful order. ULID is also shorter on the wire (26 vs 36 characters). Use UUID v4 when you need a standards-based random ID with no time information leaked — a ULID reveals roughly when it was created.

Why does ULID use Crockford Base32?

Crockford Base32 was designed for humans: its 32-symbol alphabet deliberately excludes I, L, O and U, which are easily confused with the digits 1 and 0. The encoding is case-insensitive (this tool accepts lowercase and canonicalizes to uppercase), URL-safe, and more compact than hexadecimal — 128 bits fit in 26 characters instead of 32. Any character outside 0-9A-HJKMNP-TV-Z (for example I, L, O or U) makes a ULID invalid.

What is monotonic mode?

The ULID spec defines monotonicity: when several ULIDs are generated within the same millisecond, the random part is incremented by 1 instead of being re-rolled, so the sequence stays strictly increasing. Without it, two ULIDs minted in the same millisecond would have unrelated random suffixes and could sort out of creation order. Enable “Monotonic” in the Generate tab for log lines and event streams where order matters. If the 80-bit random part ever overflows within one millisecond, generation correctly raises an error rather than going backwards.

Are ULIDs really unique? What are the collision odds?

Each millisecond gets 80 bits of randomness (about 1.2 million billion billion values). A 50% collision chance requires roughly 2^40 — over a trillion — ULIDs generated within the SAME millisecond; across different milliseconds the timestamp part differs, so collisions are effectively impossible. This tool uses crypto.getRandomValues(), the browser’s cryptographically secure generator, never Math.random().

Can you extract the timestamp from a ULID?

Yes — that is the point of the format. The first 10 characters decode to a 48-bit big-endian Unix timestamp in milliseconds. Paste any ULID into the Decode tab to see the exact UTC time, the Unix milliseconds, the random payload in hex, and the equivalent UUID text. Example: the spec’s own example ULID 01ARZ3NDEKTSV4RRFFQ69G5FAV decodes to 2016-07-30 23:54:10.259 UTC (timestamp 1469922850259).

Should I use ULID as a database primary key?

It is one of the best fits: ORDER BY id agrees with ORDER BY created_at, inserts append instead of scattering across the B-tree (the classic UUID v4 index-fragmentation problem), and the 26-character string is shorter than a 36-character UUID. Store it as CHAR(26) or as BINARY(16) if your database prefers bytes. Two caveats: the ID leaks its creation time (don’t use it where the timestamp must stay secret), and the maximum timestamp is the year 10889, after which the format overflows.

Is this ULID generator secure and private?

Yes. Everything runs 100% client-side in your browser: randomness comes from crypto.getRandomValues(), and no ULID you generate, paste, or decode is ever sent to a server — there are zero network requests. Once the page loads you can even disconnect from the internet and keep working.

How do I generate a ULID in JavaScript, Python, or Go?

In JavaScript, combine Date.now() with crypto.getRandomValues() (see the snippets tab for a complete function). In Python, pack (timestamp_ms << 80) | secrets.randbits(80) and map each 5-bit group through the Crockford alphabet with the secrets module — never the random module. In Go, use github.com/oklog/ulid with ulid.Monotonic for spec-compliant monotonic generation. Or just use the bulk generator on this page for up to 1,000 ULIDs at a time.

Related tools: UUID Generator (v1–v7, bulk + validator) · Unix Timestamp Converter

Free tool by NRTechStudio