1. Home
  2. Developer
  3. ULID and NanoID Generator

ULID and NanoID Generator

Generate ULID, NanoID and UUID v7 in bulk, and read a ULID creation time.

Runs in your browser · No upload

26 characters whose first 10 hold the creation time (ms), so sorting the strings sorts by creation order. Case-insensitive Crockford Base32.

1 to 1,000
0 ID(s)

Inspect a ULID

Shows the creation time and the random part.
Created (UTC)
2016-07-30T23:54:10.259Z
Created (local)
-
Milliseconds
1469922850259
Random part (16 chars)
TSV4RRFFQ69G5FAV

IDs are created on this device with the browser’s cryptographic RNG (crypto.getRandomValues) and are never sent or stored anywhere.

How to use

  1. Pick the type. For IDs that sort in creation order choose ULID or UUID v7, and for short public IDs choose NanoID.
  2. Enter how many (1 to 1,000) and they are made straight away. Generate new gives fresh values, and you can download them as .txt, one ID per line.
  3. For NanoID set the length and the character set (URL-safe 64, alphanumeric, lowercase and digits, digits, no look-alikes, or custom). The random bit count and approximate collision odds appear below.
  4. With ULID selected, paste any ULID into Inspect a ULID below to read its creation time.

The three IDs compared

ULID NanoID UUID v7
Length 26 characters 21 by default (adjustable) 36 (with hyphens)
Characters Crockford Base32 (0-9 A-Z, no I L O U) A-Za-z0-9_- 64 by default hex
Time information first 48 bits (ms) none first 48 bits (ms)
Random part 80 bits 126 bits by default 74 bits
String sort = creation order yes no yes

In the ULID example 01ARZ3NDEKTSV4RRFFQ69G5FAV the first 10 characters 01ARZ3NDEK are 1,469,922,850,259 ms, which is 2016-07-30 23:54:10.259 UTC. The last time 48 bits can hold is in the year 10889.

Making several in the same millisecond

With the ULID monotonic option on, a value made in the same millisecond as the previous one takes the previous random part plus 1, so sorting the strings always gives creation order. If all 80 bits are already 1 and cannot be incremented, the time moves up 1 ms and a fresh start is made. If the clock steps backwards, the previous time is kept. UUID v7 keeps order the same way (RFC 9562).

NanoID length and collision odds

With character set size N and length L the random bits are L × log₂(N). The count of IDs at which the collision chance reaches 1%, estimated with the birthday problem, is below. These are rough figures to give a feel, not exact values.

Character set × length Random bits IDs for a 1% collision chance
64 × 21 (default) 126.0 about 1.3×10^18
62 × 12 71.5 about 8.1×10^9
64 × 10 60.0 about 1.5×10^8
36 × 10 51.7 about 8.6×10^6
digits × 8 26.6 about 1,418
digits × 6 19.9 about 142

A short ID such as 6 digits can collide after only a few hundred. If you keep IDs short, check uniqueness in storage.

How they are generated and how safe they are

  • All randomness comes from the browser’s crypto.getRandomValues. When picking from a character set, rejection sampling removes the bias that would make some characters appear more often.
  • IDs are hard to guess but are not a substitute for passwords or auth tokens. Use ULID and UUID v7, which reveal the creation time, only where that exposure is fine. For passwords use the Password Generator.
  • The “no look-alikes” set drops characters such as 0 O 1 l I, which suits codes that people read or say aloud.

FAQ

How do ULID and UUID differ?

Both are 128-bit values. A UUID is the standard 36-character hex form, while a ULID writes the same 128 bits in 26 Base32 characters, which is shorter and easier to read. UUID v4 carries no time, whereas v7 and ULID put the time first so they sort. For UUID formatting (uppercase, no hyphens) or v4, use the UUID Generator.

Which is better as a database primary key?

On a B-tree index where insertion order matters, time-sortable ULID or UUID v7 fragments the index less than random UUID v4. In return, the creation time is visible in the ID.

Are ULIDs always uppercase?

The spec is case-insensitive and ULIDs are usually written in uppercase. The Lowercase option converts them. The inspector reads either.

Can the server see the IDs I make?

No. They are made on this device only and never sent or stored.

Are the values compatible with the NanoID library?

With the default settings (64 characters, length 21) the format matches the library’s default output. The values are random, so they never repeat each other.

Generated IDs are created only in your browser and never sent to a server.

Can't find the tool you need?

Tell us what you want to do. We build the most requested tools first.