Tools

Nano ID Generator

Short, URL-safe random IDs of any length


How to generate Nano IDs

  1. Choose the length. The default of 21 characters gives a collision probability similar to UUID v4.
  2. Enter how many IDs you want and press Generate.
  3. Copy the list or download it as a file.

About Nano ID

Nano ID is a popular format for short random identifiers. It uses a 64-character URL-safe alphabet (A–Z, a–z, 0–9, _ and -), so each character carries 6 bits of randomness. A 21-character Nano ID has 126 random bits, more than a UUID v4's 122, in 15 fewer characters.

Shorter lengths are fine when the number of IDs is small: 10 characters give about a quadrillion combinations, enough for share links, invite codes or front-end list keys in most apps. The rule of thumb is that collisions become likely around the square root of the number of possible values, so pick a length well above your expected volume.

Because the alphabet has exactly 64 symbols, every random byte maps to a character without bias. IDs here use the browser's cryptographically secure generator, the same approach as the nanoid npm package, and are created locally on your device.

FAQ

Is Nano ID secure?

Yes, when generated with a cryptographically secure random source, as here. It is suitable for unguessable links and tokens of sufficient length.

How short can a Nano ID be?

As short as you like, but collision risk rises quickly. For a million IDs, use at least 12–14 characters.

Can Nano IDs go in URLs?

Yes. The default alphabet contains only URL-safe characters, so no encoding is needed.