NanoID Generator
Generate compact, URL-friendly NanoID strings, instantly in your browser.
How to use the NanoID Generator
- Set the ID length. 21 characters is the NanoID default.
- Choose how many IDs to generate.
- Pick an alphabet: the default URL-safe set, alphanumeric only, lowercase and digits, digits only, or hex.
- Click Run to generate your IDs.
How the NanoID Generator works
Each character is picked from the chosen alphabet using a random byte from your browser's cryptographically secure random number generator (crypto.getRandomValues).
The default alphabet has 64 URL-safe symbols (A-Za-z0-9_-), so each character carries 6 bits of randomness and a 21-character ID has 126 random bits, slightly more than a UUID v4's 122, in 15 fewer characters. Smaller alphabets need longer IDs for the same collision resistance.
Frequently asked questions
- Is this tool free?
- Yes. Generate NanoIDs at no cost, with no account required.
- How is a NanoID different from a UUID?
- NanoIDs are shorter and use a larger, URL-friendly alphabet, giving comparable uniqueness in fewer characters than a standard UUID.
- Are these IDs cryptographically secure?
- Yes. Characters are chosen using your browser's cryptographically secure random number generator.