We use cookies.This website uses essential cookies to operate core features. With your consent, we also use analytics cookies to understand traffic and improve the service. For more details, see our .
If this tool helped you, you can buy us a coffee ☕
Generate secure, unique, and URL-friendly identifiers for database IDs, API keys, and more.
Configure options and click "Generate Nano IDs"
When you need to generate unique identifiers for database records, short links, or API keys, Nano ID is a more compact and efficient alternative to UUID. Nano ID is a URL-safe, random string generation algorithm that uses a 64-character alphabet (A-Za-z0-9_-) and a cryptographically secure random generator by default. A standard 21-character ID provides approximately 2.18×10³⁸ possible combinations.
Can Nano IDs have collisions?
With a 21-character length, generating 1 billion IDs per second would take about 30,000 years for a collision to occur.
How is the randomness of the ID guaranteed?
It uses the browser's built-in Web Crypto API to obtain cryptographically secure random numbers, which is significantly safer than using Math.random().
It is not recommended to use the generated IDs directly for extremely high-security scenarios like password storage. For ultra-large-scale systems, we recommend adding an extra uniqueness validation step.
Typical use cases: We recommend a 16-character length for user session IDs (e.g., Xq3F_9kLpYb2mN7R) and 8-10 characters for short links (e.g., aB3dFg7H). If you need a specific character set, you can enter it in the custom alphabet area (requires at least 16 distinct characters).