About the Nano ID Generator
A UUID is 36 characters, which is a lot to carry in a URL, a filename or a support ticket reference. Nano-ID-style identifiers use a larger alphabet in fewer characters: a 21-character URL-friendly ID has roughly the same collision resistance as a UUID v4 while being 40% shorter and safe to drop in a path without encoding.
How to use the Nano ID Generator
- Choose the ID length — 21 characters is the common default.
- Pick an alphabet: URL-friendly, alphanumeric, lowercase, hex or digits only.
- Add an optional prefix such as user_ or ord_.
- Generate a batch and copy them all.
Why use this tool?
Entropy shown live
See how many bits of randomness your chosen length and alphabet actually provide before you commit to a format.
Cryptographic randomness
IDs come from crypto.getRandomValues, not Math.random, so they are unpredictable.
Bulk output with prefixes
Generate up to 500 at once with a consistent prefix for seed data or test fixtures.
Frequently asked questions
How likely is a collision?
At 21 characters from a 64-character alphabet you have about 126 bits of entropy. Generating a thousand IDs a second, you would need millions of years for a 1% chance of one collision.
Nano ID or UUID?
Use UUID when a standard format matters — database types, interop, existing schemas. Use a short ID when the value appears in URLs, filenames or anywhere humans read it aloud.
Are these safe as security tokens?
They are unpredictable, but a session or reset token should be at least 128 bits and stored hashed. Use 22+ characters and treat them with the same care as any secret.