Utilia

ULID and Nano ID Generator

Generate ULIDs (with a monotonic option) or Nano IDs with a custom alphabet and length, in bulk, decode a ULID timestamp and check the collision risk.

Type of ID

Decode a ULID

How to generate ULIDs or Nano IDs

  1. Under Type of ID, pick ULID (sortable) or Nano ID (short).
  2. Set How many (1 to 1,000). Ten IDs are generated as soon as the page loads.
  3. For ULIDs, keep Monotonic (strictly increasing) checked so that IDs created in the same millisecond still sort in order, and tick Lowercase if your system prefers it.
  4. For Nano IDs, choose an Alphabet (or Custom… and type your own characters) and a Length.
  5. Click Generate, then Copy the list or Download .txt (one ID per line).

To read the date hidden in a ULID, paste it under Decode a ULID or click Decode the first ID. The tool shows the timestamp in UTC (ISO 8601), in your local time, as Unix milliseconds, and the 80-bit random part in hex.

What is a ULID?

A ULID (Universally Unique Lexicographically Sortable Identifier) is a 128-bit identifier written as 26 characters of Crockford Base32, for example 01ARZ3NDEKTSV4RRFFQ69G5FAV. The first 10 characters encode a 48-bit timestamp in milliseconds (enough until the year 10889); the last 16 characters are 80 random bits. Crockford Base32 leaves out I, L, O and U to avoid confusion, and decoding is case-insensitive.

Because the time comes first, ULIDs sort alphabetically in creation order. That makes them good primary keys: new rows are appended at the end of a B-tree index instead of being scattered like random UUIDs, and you can sort by ID instead of by a separate date column.

Monotonic mode. Within one millisecond, random ULIDs would sort in random order. With the monotonic option, the tool follows the ULID specification: when several IDs are created in the same millisecond, it keeps the timestamp and adds 1 to the previous random part. If the clock goes backwards, it keeps the last timestamp, so the sequence never decreases.

Keep in mind that a ULID reveals when it was created. Do not use one where that information is sensitive.

What is a Nano ID?

Nano ID is a compact random identifier. The default is 21 characters from a 64-character URL-safe alphabet (A–Z a–z 0–9 _ -), which gives 126 random bits, similar to a UUID v4 (122 bits) in fewer characters. You can pick hexadecimal, digits only, lowercase and digits, alphanumeric, a set without look-alike characters (no 0/O, 1/l/I, 5/S…) for codes people type, or your own alphabet of 2 to 256 characters. Duplicate characters in a custom alphabet are removed, because they would make some characters more likely.

Every character is drawn with crypto.getRandomValues using rejection sampling, so there is no modulo bias.

Collision probability

The Collision probability panel applies the birthday bound. With an alphabet of size A and a length L, there are N = A^L possible IDs. After k IDs, the chance of at least one duplicate is about 1 − e^(−k²/2N), so a 1% risk is reached after k ≈ √(2N · ln(1/0.99)) IDs. Enter the IDs generated per hour to see how long that would take. With the default settings and 1,000 IDs per hour, a 1% risk takes about 149 billion years; with 8 hexadecimal characters it takes only about 9,300 IDs.

Frequently asked questions

ULID or UUID?

Both are 128 bits. A ULID is shorter to write (26 characters instead of 36) and sorts by time. UUID version 7 now offers the same time-ordering in the standard UUID format, which databases often store natively. Pick UUID v7 if your stack supports it, ULID if you want a compact, readable string.

Are ULIDs and Nano IDs secure enough for tokens?

Nano IDs with the default alphabet and length have 126 random bits from a cryptographic generator, which is enough for unguessable links. ULIDs only have 80 random bits, and in monotonic mode consecutive IDs differ by one, so do not use ULIDs as secrets.

Can I shorten a Nano ID?

Yes, but the collision risk grows very fast. Check the IDs for a 1% chance of a duplicate value for your length and alphabet before relying on a short ID.

Why does the decoder reject my ULID?

A ULID must have exactly 26 characters, use only Crockford Base32 characters, and start with 0 to 7 (a larger first character would exceed 128 bits).

Are the IDs stored or sent anywhere?

No. They are generated in your browser and disappear when you leave the page.