Nano ID Generator
Generate short random IDs with the URL-safe alphabet, alphanumerics, no look-alikes, hex or your own characters, and see their entropy and collision odds.
Free · No sign-up · Your inputs stay in your browser
Input
Generate Nano IDs
Output
Press Generate
Entropy
126 bits
About 1.3e+18 IDs before a 1% chance of any collision.
Random IDs from crypto.getRandomValues with rejection sampling, the method the nanoid package uses. The default, 21 characters of a 64-symbol alphabet, carries 126 bits: about the same as a UUID v4 in fewer characters.
Runs in this browser. Nothing you paste is sent to a server.
About this tool
Method, assumptions, practical next steps, and limits.
Short IDs, quantified
The nanoid default of 21 characters from a 64-symbol alphabet gives 126 bits, about the same as a UUID v4 in 15 fewer characters. Shorter IDs are fine for share links or order numbers as long as the collision odds fit the volume; the birthday bound shown here is the number to compare with how many you will ever create.
Why rejection sampling
randomByte % alphabet.length favours the first characters whenever 256 is not a multiple of the alphabet size. Throwing away bytes above the largest multiple keeps every character equally likely, which is what nanoid does too.