Generate compact, URL-safe random IDs. Choose the length and alphabet. A smaller, faster alternative to UUIDs.
Nano IDs use a hardware random generator (Web Crypto) and a URL-safe alphabet by default, so they need no encoding in links or filenames. At the default length of 21 they are about as collision-safe as a UUID, in fewer characters.
Nano ID is a tiny, secure, URL-friendly unique ID format. It is popular as a smaller alternative to UUIDs: at 21 characters it offers similar collision safety while being shorter and safe to drop straight into URLs and filenames.
URL-safe is the default and works everywhere. Alphanumeric avoids the underscore and hyphen, lowercase-plus-digits is handy for case-insensitive systems, and numbers-only or hex suit specific needs. Shorter alphabets need more length for the same uniqueness.
Yes. The bytes come from the Web Crypto API, the browser's secure random source, and everything runs locally so no ID is ever transmitted.