NanoID Custom Generator
Custom alphabet and length NanoID
Enter values above and click Generate
About
NanoID supports custom alphabets and lengths. You can specify your own character set and desired length. Custom NanoIDs are useful when you need specific character sets for compatibility, branding, or system requirements. The alphabet determines which characters can appear in the ID, and the length determines how many characters the ID will have. Custom alphabets allow you to create IDs that match specific formats, avoid certain characters, or use only alphanumeric characters for case-insensitive systems.
Use Cases
- •Case-insensitive systems (lowercase only)
- •Numeric-only IDs for compatibility
- •Custom character sets for branding
- •Avoiding specific characters (e.g., no hyphens)
- •Legacy system compatibility
- •Custom length requirements
How to Generate
Library
nanoid
NPM Package
npm install nanoidCode Example
import { customAlphabet } from 'nanoid';
// Custom alphabet (lowercase + numbers)
const alphabet = '0123456789abcdefghijklmnopqrstuvwxyz';
const customNanoid = customAlphabet(alphabet, 21);
const id = customNanoid();
console.log(id); // e.g., 'k3j9h2f8m1n5p7q4r6s2t0'