Nano ID Generator Online
Generate URL-safe, collision-resistant Nano IDs with a custom size and alphabet, right in your browser.
The Nano ID Generator runs entirely in your browser. Every id is generated locally using the Web Crypto API and nothing is uploaded to ArrayKit.
Open the UUID Generator
About Nano ID Generator
The Nano ID Generator creates short, URL-safe, collision-resistant unique identifiers using the same rejection-sampling algorithm as the popular nanoid library. It defaults to a 21-character id drawn from a 64-character url-safe alphabet, giving you roughly the same collision resistance as a UUID in about a third of the length. You can dial the size up or down, generate a batch of ids at once, and swap in your own custom alphabet — for example digits only, or a case-insensitive set for ids read aloud over the phone. It is useful for database keys, session tokens, short link slugs, and any place a UUID feels too long. Everything runs locally in your browser, so no id ever touches a server before you decide to use it.
Features
- Generates URL-safe Nano IDs with the default 21-character, 64-character alphabet
- Adjustable size from 2 to 128 characters per id
- Generate a batch of up to 500 Nano IDs in one click
- Custom alphabet support — restrict output to digits, hex, or any character set you choose
- Unbiased rejection sampling avoids the modulo bias of naive random-index generators
- One id per line, ready to copy or paste into code, spreadsheets, or migrations
- Uses your browser's cryptographic random number generator for every id
- Runs entirely on your device — no id is ever sent to a server
How to use the Nano ID Generator
- Set the id size (21 by default) and how many ids you need
- Optionally replace the alphabet with your own character set
- Click Generate to draw fresh ids from your browser's crypto RNG
- Copy the list, or click Generate again for a new batch
Example
Input
size = 21
Output
V1StGXR8_Z5jdHi6B-myT
A 21-character Nano ID drawn from the default 64-character url-safe alphabet.
Common errors & troubleshooting
- The custom alphabet field is rejected or produces an error. — The Nano ID Generator needs at least 2 unique characters in the alphabet; duplicate characters are automatically de-duplicated before generating.
- IDs generated with a short custom alphabet look longer to type than expected. — A smaller alphabet needs more characters to reach the same collision resistance — increase the size when you restrict the alphabet, for example to digits only.
- Not sure how many Nano IDs are safe to generate without collisions. — At the default 21-character size you would need to generate around a trillion ids per second for a thousand years before a 1% chance of a single collision — shrink the size only if you also expect far fewer ids.
Frequently asked questions
- What is a Nano ID?
- A Nano ID is a short, URL-safe, random unique identifier, typically 21 characters long, generated with cryptographically secure randomness. It offers similar collision resistance to a UUID in a much shorter string.
- How is a Nano ID different from a UUID?
- A UUID is a fixed 36-character format with a defined structure (version, variant bits). A Nano ID has no fixed structure — you choose the size and alphabet — and is shorter while remaining just as safe against collisions at its default settings.
- Can the Nano ID Generator use a custom alphabet?
- Yes. Replace the alphabet field with any set of unique characters — for example digits only, hex characters, or a case-insensitive set — and the generator will draw ids exclusively from that set.
- Does the Nano ID Generator upload the ids I create?
- No. Every Nano ID is generated locally using your browser's cryptographic random number generator. Nothing is sent to a server, so the ids you create are only ever visible on your device.
- Is the Nano ID Generator's output biased toward certain characters?
- No. It uses unbiased rejection sampling, discarding random bytes that fall outside the alphabet's range instead of reducing them with modulo, so every character in the alphabet has an equal chance of appearing.
- What size should I pick for a Nano ID?
- The default of 21 characters is a safe general-purpose choice. Shorter ids (10-14 characters) work well for short link slugs with lower volume; longer ids suit high-volume systems that need stronger collision resistance.
Related tools
- UUID Generator — Generate one or many random UUID v4 values.
- ULID Generator — Generate sortable ULIDs and decode a ULID to its timestamp, in your browser.
- Snowflake ID Generator — Generate and decode Twitter and Discord style Snowflake IDs, with timestamp extraction.
- Password Generator — Generate strong, random passwords with a strength meter (crypto-secure).
- Base58 Encoder / Decoder — Encode and decode Base58 (Bitcoin / IPFS alphabet), with hex and text input.
- Hash Generator — SHA-256 / SHA-1 / SHA-384 / SHA-512 via the Web Crypto API.
All ArrayKit tools