SpeedDrain
Web Crypto API · Zero Collisions · URL-Friendly

NanoID Generator

Generate compact, secure, and URL-friendly unique identifiers using native cryptographic randomness. Customize alphabet length, inspect entropy, and export in batches.

Alphabet Character Set:
125 bits entropy
6 (Short URL)21 (NanoID Default)36 (UUID Size)64 (High Entropy)
Security bound: ~6.6e+17 IDs needed for 1% collision risk (billions of years)
Generated NanoIDs:

NanoID Architecture & Collision Probability

Why NanoID Is Better Than UUIDv4 for Web URLs

NanoID is a tiny, secure, URL-friendly unique string ID generator created by Andrey Sitnik. While UUIDv4 requires 36 characters (including four hyphens) with 122 bits of entropy, NanoID packs 126 bits of entropy into just 21 characters.

It uses a 64-character URL-safe alphabet (A-Za-z0-9_-), making it ideal for clean shareable URLs, database slugs, short links, and API tokens without requiring URL percent-encoding.

How Collision Probability Is Calculated (Birthday Paradox)

Even though NanoID is random, two independently generated IDs could theoretically collide. Using the Birthday Problem approximation:

p ≈ 1 - exp(-N² / (2 * A^L))

Where A is the alphabet size (64) and L is the length (21). At a generation rate of 1,000 IDs every second, it would take roughly 41,000 years to reach a 1% chance of a single collision.