Nano ID generator

Creates ids the Nano ID way: 21 characters by default from a 64-symbol URL-safe alphabet, or a custom alphabet and length.

Loading the tool…

Processing and privacy: The result is calculated inside your browser and your data is not sent to any server.

How to use it

  1. Enter length, alphabet, custom alphabet (when selected) and how many.
  2. The result appears straight away and updates as you edit.
  3. Copy the result, or copy a link that keeps the same values to share it.

How it is calculated

Each character comes from a secure random byte masked to the nearest power of two; bytes beyond the alphabet size are rejected so the distribution stays uniform. Entropy = length × log2(alphabet size) bits.

Example

Inputs: Length = 21, Alphabet = URL-safe A-Z a-z 0-9 _ - (64), Custom alphabet (when selected) = ABCDEFGHJKLMNPQRSTUVWXYZ23456789, How many = 5. Result: IDs: 11IY0uOes4v0mIsxsKEZB hrLCuDOq07mPrWrry_pbm hGu1LgXJ0IEKBhAYgY-2O BJ0P4xeRKqP-t6rF3LI4e XUp-V9kFGWGO6o4-83qhP; Length of each id: 21 symbols; Alphabet size: 64.

ABCDEFGHJKLMNPQRSTUVWXYZ23456789
11IY0uOes4v0mIsxsKEZB
hrLCuDOq07mPrWrry_pbm
hGu1LgXJ0IEKBhAYgY-2O
BJ0P4xeRKqP-t6rF3LI4e
XUp-V9kFGWGO6o4-83qhP

Limits and caveats

  • The ids are random and change on every recalculation, so copy them before changing options.
  • Short lengths raise the collision risk quickly; keep around 120 bits of entropy for public ids.

Questions about this tool

Is a Nano ID shorter than a UUID for the same security?

Roughly yes: the default 21 symbols carry 126 random bits, against 122 bits in a 36-character UUID v4.

Why are some random bytes rejected?

Taking a plain remainder makes some symbols more common than others; rejection keeps every symbol equally likely.

Can a custom alphabet use Arabic letters?

Yes, each letter counts as one symbol, but URLs will then be percent-encoded and become longer.