Nano ID Generator — Short, URL-Safe Unique IDs

Make short, random, URL-safe IDs like V1StGXR8_Z5jdHi6B-myT — the same format as the popular nanoid library. Choose the length and alphabet, add a prefix, and check the collision calculator to be sure your IDs are long enough.

Runs in your browserUpdated
ULIDs

Decode a ULID

Your data never leaves your computer. All processing happens 100% locally in your browser.

How to use the Nano ID Generator

  1. The page starts in Nano ID mode with the default 21 URL-safe characters.
  2. Pick a shorter or longer length and an alphabet — for codes people type, choose “No look-alikes”.
  3. Enter how many IDs you create per hour to see the time until a 1% chance of a duplicate.
  4. Copy or download the IDs.

How Nano ID picks characters

Each character is drawn from the alphabet with crypto.getRandomValues. To keep every character equally likely, random bytes are masked to the next power of two and values outside the alphabet are thrown away — the same approach as the nanoid library — instead of using modulo, which would favor some characters.

The collision estimate uses the birthday bound: with an alphabet of A characters and length L there are AL possible IDs, and a 1% chance of a duplicate appears after about √(0.02 · AL) IDs. For sortable IDs, see the ULID Generator.

Also searched as: nanoid generator, nanoid online, short id generator, url safe id generator, nanoid collision, custom alphabet id generator, random id generator.

Tools that pair well with the Nano ID Generator

  • Password Generator — Create strong, truly random passwords or easy-to-type passphrases — with advanced rules: include or exclude words, require characters, choose allowed symbols, avoid repeats and sequences.
  • Random Number Generator — Generate random numbers (with or without duplicates), pick winners from a list, shuffle names, split groups into teams, flip coins and roll dice — using your browser’s cryptographically secure randomness.
  • Slug Generator — Convert any title into a clean, lowercase URL slug — with proper transliteration of accents, umlauts and Cyrillic, optional stop-word removal and a bulk mode for whole lists.
  • Hash Generator — Compute MD5 and SHA hashes of any text or file instantly, create HMAC signatures, and paste an expected checksum to verify a download.

Frequently asked questions

Is Nano ID better than UUID?
For IDs in URLs, yes: 21 Nano ID characters carry slightly more randomness than a UUID v4 in 15 fewer characters. UUIDs are better when a database or API expects that exact format.
Which alphabet should I use?
URL-safe is the default and the most compact. Use No look-alikes for codes people read or type (vouchers, invite codes), and Numbers only for things like order numbers — with more length to compensate.
Are these IDs secure?
They come from the browser’s cryptographic random generator, so they are unpredictable. For secrets such as API keys, use 32 or more characters.
Can I install Nano ID Generator as a web app and use it offline?
Yes. Nano ID Generator is an installable web app (PWA) — installed from your browser, not downloaded from an app store. Click Install app at the top of this page in Chrome or Edge (Windows, macOS, Linux, ChromeOS) or on Android, use Share → Add to Home Screen on iPhone and iPad, or File → Add to Dock in Safari 17+ on a Mac. It then opens in its own window with its own icon, and because it runs entirely in your browser it keeps working offline. Firefox on desktop can’t install web apps. How installing works.

Related tools