UTILS.
Private by default
nano

Nano ID Generator

Generate compact, URL-safe, unique IDs with a custom size and alphabet.

Your files stay on this device

Files are processed in your browser, never uploaded. The site downloads code and assets to run the tools. No accounts or trackers.

Use Download to save this tool as one HTML file for offline use.

Privacy →
— output appears here —

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