What is a Nano ID Generator?
A Nano ID is a compact, URL-friendly unique identifier. The default is 21 characters from a 64-character alphabet (A-Z, a-z, 0-9, underscore and hyphen), which gives collision odds similar to a UUID v4 in a shorter string.
When to use it
Use it for short links, database keys, file names, invite codes, session tokens or anywhere a UUID feels too long. You can choose the length and alphabet, for example numbers only or lowercase only, when the ID will be typed by hand.
How it works
The generator uses the browser's secure random number source (crypto.getRandomValues) and maps each random byte to a character from the chosen alphabet. Shorter IDs or smaller alphabets mean fewer possible values, so collisions become more likely. Keep the default 21 characters if uniqueness matters.
Frequently asked questions
What is the difference between Nano ID and UUID?
Both are random identifiers. A UUID is 36 characters in a fixed format. A Nano ID is 21 characters by default, uses a URL-safe alphabet and can be customized.
Is Nano ID secure?
The IDs are created with the browser's cryptographic random source, so they are unpredictable. That said, an ID alone should not be your only access control.
How long should a Nano ID be?
21 characters is the default and is plenty for most apps. Shorter IDs are fine for small datasets, but the chance of a collision rises quickly as length drops.
Are the IDs sent to a server?
No. They are generated locally in your browser.