Nano ID generator
Short, URL-safe unique IDs with the Nano ID defaults, or your own length and alphabet. The calculator shows how short you can safely go.
64-character alphabet × 21 = 126 bits of entropy per value.
At that rate it takes about 149,174,141,031 years before there’s a 1% chance of any collision.
Press generate to fill this table.
Nano ID in your code
In JavaScript, install the nanoid package and call nanoid(), or customAlphabet('0123456789abcdef', 12) for a custom format. Ports exist for Python, Go, Rust, PHP and most other languages. Keep the same alphabet and length across all of them so IDs look the same everywhere.
Questions people ask
What is a Nano ID?
Nano ID is a popular open-source ID format: by default 21 characters from a 64-character URL-safe alphabet (A–Z, a–z, 0–9, _ and -), giving 126 bits of randomness. That is similar to UUID v4 but shorter.
Nano ID or UUID?
Use UUIDs when a database column type, API contract or standard expects them. Use Nano IDs when you want shorter, URL-friendly identifiers, such as slugs, share links and client-side keys.
How short can a Nano ID be?
That depends on how many you generate. The collision calculator on this page shows how long you can keep generating at a given rate before there’s a 1% chance of a duplicate. Shorter IDs are fine for low volumes; check before going below about 12 characters.