NanoID Generator

Generate NanoID identifiers. Compact, URL-safe, cryptographically secure IDs. Smaller than UUID with configurable alphabet and length. Free, client-side.

Loading tool...

Frequently Asked Questions

What is NanoID?

NanoID is a compact, URL-safe, cryptographically secure unique identifier generator. The default output is 21 characters using an alphabet of A-Za-z0-9_- (64 characters), providing 126 bits of entropy. It uses the crypto.getRandomValues() API for secure randomness and is widely adopted in JavaScript, Python, Go, and other ecosystems.

How does NanoID compare to UUID?

A UUID v4 is 36 characters (with hyphens) and provides 122 bits of randomness. A default NanoID is only 21 characters while providing 126 bits of randomness. NanoID is 40% shorter, uses a URL-safe alphabet by default, and has no fixed format, making it more efficient for URLs, database keys, and file names.

What is the collision probability of NanoID?

With the default 21-character length and 64-character alphabet, NanoID provides 126 bits of entropy. You would need to generate approximately 1 billion IDs per second for 4 million years to have a 1% probability of a collision. For most applications, this is effectively zero. You can increase the length for even lower collision probability.

Can I use a custom alphabet with NanoID?

Yes. NanoID supports custom alphabets, allowing you to restrict output to specific character sets such as lowercase only, digits only, or hex characters. When using a smaller alphabet, increase the ID length to maintain sufficient entropy. For example, a hex-only alphabet (16 characters) needs 32 characters to match the entropy of the default 21-character output.

Is this tool free?

Yes. All KappaKit tools are free, run in your browser, and require no signup or account.

Built by Michael Lip. 100% client-side — no data leaves your browser.

Usage data from our Developer Tool Usage Report 2026