Nano ID Generator

Generates short, URL-safe random identifiers from a 64-character alphabet, in any length up to 256 and in batches up to 200, using crypto-grade randomness in the browser.

Generate nanoid-style unique IDs online — URL-safe alphabet, any length, batch of up to 200, built with crypto randomness in your browser.

Steps and notes

What is Nano ID Generator — Short, URL-safe Unique IDs Online?

nanoid is an identifier scheme in the same family as UUID and ULID: a random string meant to be unique enough for keys, slugs and tokens. Compared with a UUID v4 (36 characters, hex with hyphens) a 21-character nanoid carries slightly more entropy (about 126 bits against 122) while being short enough to sit in a URL. Compared with a ULID it has no embedded timestamp, so it is not sortable — if you need ordering, use the ULID generator instead.

  1. Set the length — 21 characters is the default and is what most nanoid implementations use
  2. Set the quantity if you need a batch
  3. Pick an alphabet, or type your own if an upstream system restricts the character set
  4. Copy the list, or regenerate it
  • IDs are generated locally; nothing is sent anywhere, so there is no server-side uniqueness guarantee — collision risk is a function of alphabet size and length, not of this page
  • A custom alphabet collapses duplicate characters, because a repeated character silently doubles that symbol's probability
  • Alphabets that are not a power of two discard out-of-range random bytes rather than wrapping them, so the sample stays unbiased

Frequently asked questions

How long should an ID be?
21 characters from the 64-character alphabet is the usual default: roughly 126 bits of entropy, which is comfortable for primary keys. Shorten it for user-facing codes only if you can tolerate the higher collision chance, and check the entropy line the page shows.
Are these IDs guaranteed unique?
No tool can guarantee that on its own. Uniqueness is probabilistic; the generator uses a cryptographically strong random source, which is what makes the probability math hold, but if the IDs are database keys the database still needs a unique constraint.
Why can I choose the alphabet?
Because downstream systems disagree about what is safe. A URL path, a file name, a base32 secret and a numeric OTP all want different character sets; the length and alphabet together decide how much entropy each ID carries.
Is a nanoid better than a UUID?
Different trade-off, not better. A nanoid is shorter and URL-friendly; a UUID has no collision risk discussion to redo across languages and libraries and is universally supported by database types. If you interoperate with systems that expect UUID text, keep using the UUID generator.
What is the collision risk at my size?
Roughly n^2 / 2^(bits+1) after generating n IDs. With a 21-character default that is negligible for anything short of astronomical row counts; with 6 characters from a 36-character alphabet, expect collisions once you are in the low hundreds of thousands.
Does anything get uploaded?
No. There is no network request in this tool; the page never leaves the browser for generation, and nothing is stored beyond your own local preferences for length, quantity and alphabet.

Read the full step-by-step guide for this tool

Category: Crypto

ID generators workflow

UUID Generator — v4, v1, v3, v5 and NIL IDs → ULID Generator — Time-Ordered, Sortable IDs Online → Nano ID Generator — Short, URL-safe Unique IDs Online → Token Generator → Password Generator → OTP code generator → BIP39 passphrase generator