About this tool
Generate Nano IDs using unbiased random sampling from crypto.getRandomValues, entirely in your browser.
Choose a length from 1 to 256, a count from 1 to 500 and one of three alphabets: URL-safe (A-Z, a-z, 0-9, underscore and hyphen), hex (0-9 and lowercase a-f) or numeric (0-9). Values outside the range are clamped, and a blank or invalid entry becomes 1. Results are listed one per line.
The IDs come from the page's own sampler rather than the nanoid package, and nothing checks uniqueness across runs. The hex and numeric alphabets carry less randomness per character than the URL-safe one, so use longer IDs with them.
Frequently asked questions
Is the randomness uniform?
Yes, it uses rejection sampling with a bit mask so every character of the alphabet is equally likely, with no modulo bias.
Why is the default size 21?
21 characters of the 64-symbol URL-safe alphabet give a collision probability comparable to a UUID.
Which length should I use with the hex or numeric alphabet?
Use more than the default 21 when collisions matter. Each hex or numeric character carries less randomness than a URL-safe character, so the same length gives a smaller space of possible IDs.
Are the generated IDs stored or sent anywhere?
No. They are produced in the page with crypto.getRandomValues and shown in the output box. Nothing is uploaded, and reloading the page or changing an option replaces the list.
More tools