What is NanoID Generator?
NanoID produces short, URL-safe random identifiers. The default is 21 characters drawn from a 64-character alphabet, which works out to roughly 126 bits of entropy — the same league as UUID v4 but 15 characters shorter. IDs come from a cryptographic random source and are generated locally in your browser.
How to use NanoID Generator
- 1Set the length (the 21-character default is already secure enough).
- 2Set how many IDs to generate.
- 3Copy the results for short links, invite codes or temporary keys in the front end.
Frequently asked questions
Why is 21 characters enough?+
NanoID uses a 64-character alphabet, so each character carries 6 bits and 21 characters give about 126 bits of entropy — comparable to the 122 bits of a UUID v4. Even at a rate of one million IDs per hour, you would expect thousands of years to pass before a single collision.
Can I shorten a NanoID to 8 characters?+
Eight characters is about 48 bits of entropy, where collisions become likely enough to matter once the dataset grows, so you have to back it with a unique constraint in the database and retry on conflict. Only shorten the ID when a person has to type it and the total volume is bounded, such as a promo code.
Related tools
All toolsUUID Generator
Generate UUID v4 or v7 in bulk, with optional hyphen removal
ULID Generator
Generate ULIDs and decode the timestamp embedded in each one
ObjectId Generator
Generate ObjectIds and decode their timestamps
Password Generator
Generate strong random passwords with a configurable character set
Random String Generator
Generate random strings in bulk from a character set of your choice
Lorem Ipsum Generator
Generate Latin or Chinese placeholder text by paragraph or sentence