🔑 NanoID Generator
Generate NanoIDs — short, URL-safe, cryptographically-random IDs — at any length, single or in bulk.
NanoID: URL-safe, cryptographically random, rejection-sampled for an unbiased distribution. 🔒 Generated entirely in your browser.
How the nanoid generator works
A NanoID is built from a 64-character URL-safe alphabet using crypto.getRandomValues, with rejection sampling so every character is equally likely (no modulo bias). The default 21 characters give roughly the same collision resistance as a UUID in fewer, URL-friendly characters. Set the length to suit your needs, or switch tabs for UUID v4/v7 or ULID.
NanoID is popular for short links, tokens and public IDs where a compact URL-safe string beats a long UUID. It uses the same secure randomness — no predictable sequences.
Frequently asked questions
What is a NanoID?
A compact, URL-safe unique-ID format: cryptographically-random characters from a 64-symbol alphabet (A–Z, a–z, 0–9, _ and -). The default length is 21 characters.
How is it different from a UUID?
NanoIDs are shorter and URL-safe (no hyphens to format), and their length and alphabet are configurable. A 21-character NanoID has collision resistance comparable to a UUID.
Is the randomness unbiased?
Yes — this generator uses rejection sampling over crypto.getRandomValues, so every character is equally likely (a naive modulo would slightly favour some characters).
What length should I choose?
The default 21 is a good general choice. Shorter IDs (e.g. 8–12) suit user-facing short links where a small collision chance is acceptable; longer IDs reduce collision risk further.
Is it generated locally?
Yes — entirely in your browser with the Web Crypto API; nothing is uploaded.