Skip to content
Mediawand

Nano ID Generator

Nano IDs are short random IDs for URLs, file names and database keys. The default 21 characters give about the same uniqueness as a UUID in far fewer characters.

How to generate Nano IDs

  1. 1Set the length and the characters to use.
  2. 2Choose how many IDs you need.
  3. 3Copy them or download them as a text file.

Length and uniqueness

The default alphabet has 64 URL-safe characters (A–Z, a–z, 0–9, _ and -), so each character adds 6 bits: 21 characters give 126 bits, a little more than a random UUID's 122.

Your own alphabet

Use lowercase and digits for case-insensitive systems, digits only for codes, or leave out look-alikes like 0 and O for IDs people type. The randomness per ID is shown as you change it.

Truly random

Values come from your browser's cryptographically secure random generator (crypto.getRandomValues), and characters are picked without modulo bias, so every character is equally likely.

Frequently asked questions

Is anything sent to a server?
No. Everything is computed in your browser and nothing leaves your device.
How short can an ID safely be?
It depends on how many you make. Around 10 characters from the default alphabet (60 bits) suits millions of IDs; use the default 21 when in doubt.
Is this the nanoid npm package?
It produces the same kind of IDs, with the same default alphabet and length, generated here in your browser.

Related tools

Loading tools…