Generate Nano ID–style random identifiers: short, URL-friendly strings like V1StGXR8_Z5jdHi6B-myT. The default (21 characters from a 64-symbol alphabet) carries about 126 bits of randomness, comparable to a UUID v4 in a shorter string. IDs are created with crypto.getRandomValues and rejection sampling, so every character is uniformly distributed even with custom alphabets.

Alphabet presets include URL-safe (the Nano ID default), alphanumeric, lowercase, hex, numbers only and a no-look-alikes set that avoids characters such as 1/l/I and 0/O. You can also supply your own alphabet.

The collision estimate uses the birthday bound: it shows how many IDs you would need to generate before there is a 1% chance of any duplicate, and how long that takes at your expected generation rate. Use it to pick the shortest size that is still safe; for example, short invite codes are fine at low volume but not as primary keys for a busy table.