Nano ID Generator

Short, secure random IDs with custom alphabet and length, plus collision odds.

About this tool

Choose an alphabet, such as URL-safe, alphanumeric, lowercase, no look-alikes, numbers or hex, or type your own. Set the length, how many IDs to make and an optional prefix. The IDs appear as a list ready to copy. The tool also shows how many bits of randomness each ID carries and roughly how many you could create before a 1% chance that any two match.

How Nano IDs work and how long they should be

A Nano ID is a short random string, 21 characters from a 64-character URL-safe alphabet by default. That gives about 126 bits of randomness, close to a version 4 UUID's 122 bits, in 21 characters instead of 36. Characters come from your browser's cryptographically secure random generator. Each one is chosen without bias by masking random bytes to the next power of two and rejecting values outside the alphabet, the same method as the widely used nanoid library. Collisions are governed by the birthday problem. With the default settings you would need about 1.3 × 1018 IDs for a 1% chance of a single duplicate, which is roughly 149 billion years at 1,000 IDs an hour. Shorter IDs are fine for small datasets, but check the estimate. Six digits allow only about 140 IDs before a 1% chance of a clash. The no-look-alikes alphabet avoids 0 and O, 1, l and I, and similar pairs for codes people read or type, and a prefix such as usr_ makes IDs self-describing in logs. The UUID generator makes standard UUIDs, the password generator makes secrets and the Base32 converter encodes bytes. What a UUID is, the versions that matter, and whether collisions can happen compares the formats.

Frequently asked questions

Is Nano ID better than UUID?

Neither is better in general. Nano ID is shorter and URL-safe for similar randomness; UUIDs are a standard format many databases and tools understand natively.

How long should a Nano ID be?

21 characters with the default alphabet is safe for almost any system. Use the collision estimate to check shorter IDs against how many you will create.

Are these IDs secure?

They use the browser's cryptographically secure random number generator, so they are unpredictable. Don't use short IDs as passwords or secrets.

Is anything saved?

No. IDs are generated in your browser and nothing is stored or sent.