NanoID Generator
Generate lightweight, secure, URL-friendly unique IDs.
pages.dev.nanoid.defaultAlphabetHint
Usage
Features
NanoID is a lightweight JavaScript library for generating random IDs. Compared to UUID, it is smaller (only 108 bytes), more secure, URL-friendly, and uses a larger alphabet than UUID (A-Za-z0-9_-). The default 21 characters ensure sufficient uniqueness.
Key Features
Uses a hardware random number generator for security; uses a URL-safe character set that can be used directly in links; supports custom length and alphabet (e.g., digits only 0123456789); suitable for database primary keys, session identifiers, short-link IDs, and more.
Steps
Set the "Quantity" (default 5) and "ID Length" (default 21); if you need a custom alphabet, check "Use custom alphabet" and enter the allowed characters; click the "Generate NanoID" button, and the result is shown one per line in the text box; click "Copy Result" to copy all IDs to the clipboard.
Notes
To avoid performance issues, a maximum of 2000 IDs can be generated at once, with a length limit of 1000 characters; the custom alphabet requires at least 2 characters; all generation is done locally in the browser and is never uploaded to a server.