Generate random UUID v4 identifiers using the browser cryptographic random generator.
NanoID Generator
Generate compact URL-safe random identifiers with a configurable length and alphabet, and a real entropy figure.
- Free
- No sign-up
- Runs in your browser
Input
Generate up to 1,000 at once.
Leave empty for the 64-character URL-safe set. Duplicates are removed.
Ready
Everything happens on this device. No upload, no account, no network request.
How to use this tool
- 1
Choose how many you need and they are generated immediately.
- 2
Every value comes from the browser’s cryptographically secure random generator, never Math.random.
Questions about NanoID Generator
How long should the id be?
The tool reports the actual entropy and a collision estimate for your chosen length, so you can decide from numbers rather than habit. 21 characters over the 64-symbol alphabet gives 126 bits - comparable to a UUID v4, in 15 fewer characters. For a short URL slug, 10 characters (60 bits) is usually ample.
Is a custom alphabet safe?
Yes, and the entropy figure updates to match. Index selection uses rejection sampling rather than the modulo operator, so there is no bias toward the earlier characters even when the alphabet size is not a power of two.
Is the randomness good enough to use as a secret?
The random bits come from crypto.getRandomValues, which is the platform CSPRNG - so yes for an unguessable URL token or a database key. Math.random is never used; it is seeded predictably enough that generated values can be recovered.
Is my data sent anywhere?
No. This tool runs as JavaScript inside your browser tab. There is no network request carrying your input, nothing is written to a server log, and it keeps working with your connection switched off. You can confirm it in the browser’s network panel. That matters more here than elsewhere on the site: developer tools handle tokens, keys and production data.
Does the NanoID Generator work offline?
Yes. Once the page has loaded it runs entirely as JavaScript on your own device, so the NanoID Generator keeps working with the network switched off and nothing is ever sent to a server.
Related tools
Other tools you might reach for next.
Generate time-ordered UUID v7 identifiers that sort chronologically, suitable as database keys.
Generate ULIDs: 26-character, time-sortable, case-insensitive identifiers in Crockford base32.
Format and indent JSON, with optional alphabetical key sorting and a precise syntax error when it will not parse.
Strip every byte of insignificant whitespace from JSON and report the saving.
Check that JSON is syntactically valid, report its structure, and flag duplicate keys that JSON.parse accepts silently.
Compare two JSON documents structurally, by path, distinguishing a type change from a value change.
Evaluate a JSONPath expression against a document and see every match with the path that produced it.