Contact

Tools  /  Generators  /  Nano ID Generator

Nano ID Generator

Generate URL-safe Nano IDs with the real unbiased algorithm — choose the alphabet, length and count, see the exact entropy and collision odds, and export as lines / JSON / CSV / SQL.

What a Nano ID is

Nano ID is a tiny unique-string library. An ID is a run of characters drawn uniformly at random from an alphabet — by default 21 characters from a 64-symbol URL-safe set (A–Z a–z 0–9 _ -), which carries about the same collision resistance as a UUID in fewer characters.

Why the algorithm matters

The naive approach — randomByte % alphabet.length — is biased whenever 256 is not a multiple of the alphabet size, so some characters come up slightly more often. This tool uses the real Nano ID method: a bitmask plus rejection sampling, so every character is exactly equally likely. A "fast (biased)" mode is offered only for comparison.

Entropy and collisions

Each character contributes log2(alphabet size) bits. The tool shows the total entropy and, for a number of IDs you choose, the probability that any two collide (the birthday bound).

Seeded mode

Leave the seed blank for the browser CSPRNG. Set it and generation becomes deterministic — handy for fixtures, never for real IDs.

Privacy

Everything is generated in your browser. Nothing is sent anywhere.

Frequently asked questions

Is this the same as the nanoid npm package?
The default alphabet and the unbiased bitmask + rejection-sampling algorithm match nanoid. Output is drawn from crypto.getRandomValues just like the library.
How long should my IDs be?
The 21-character default gives ~126 bits, comparable to a UUID. Shorter is fine for low-volume IDs — the collision panel shows the odds at your chosen length and volume.
What does "fast (biased)" mode do?
It uses plain modulo, which slightly favours some characters. It exists only so you can see the difference; leave unbiased on for real use.
Can I use my own alphabet?
Yes. Pick "Custom" and enter the characters — duplicates are removed and the entropy figures update to match.
Is anything uploaded?
No. Generation is entirely local to your browser.
Theme Accent