NanoID / CUID2 / KSUID / Snowflake ID Generator.
Generate NanoID, CUID2, KSUID and Snowflake IDs in bulk with custom size, alphabet and epoch.
Runs in your browserAbout NanoID / CUID2 / KSUID / Snowflake ID Generator
This generator creates the four most common alternatives to UUIDs. NanoID is a short, URL-safe random string: 21 characters from a 64-symbol alphabet give 126 bits of entropy, about the same as a UUID v4 in fewer characters. You can change the length or supply your own alphabet, for example only digits and uppercase letters for codes that people type. CUID2 builds a 24-character lowercase ID that always starts with a letter, so it is safe as an HTML id or a variable name; it mixes the time, a counter, random salt and a fingerprint through SHA3-512. KSUID is 27 base62 characters that sort by creation time: the first four bytes are seconds since 2014-05-13, followed by 128 random bits. Snowflake IDs are 64-bit integers used by Twitter, Discord and many databases: 41 bits of milliseconds since an epoch, a 10-bit worker ID and a 12-bit sequence, so IDs created in the same millisecond still differ. A common mistake is storing Snowflake IDs as JavaScript numbers or JSON numbers; they exceed 2^53 and lose their last digits, so keep them as strings. Another is shortening a NanoID without checking the collision risk: 8 characters are fine for a few thousand records, not for millions. Every random choice uses your browser's cryptographic random generator with rejection sampling, so no character is more likely than another. Nothing is sent to a server.
How to Use
- Pick the ID type and how many IDs you need.
- Adjust the length and alphabet for NanoID or CUID2, or the epoch and worker ID for Snowflake.
- Press Run to generate a new batch, then copy or download the list.
Frequently Asked Questions
Which ID type should I choose?
Use NanoID for short random tokens in URLs, CUID2 when the ID must start with a letter, KSUID when you want random IDs that sort by time, and Snowflake when you need a 64-bit integer primary key.
Are these IDs unique?
They are random or time-based with enough entropy that collisions are practically impossible at the default sizes. Snowflake IDs are unique per worker ID, so give each generating process its own worker ID.
Why does my Snowflake ID change when I parse it in JavaScript?
Snowflake IDs are larger than Number.MAX_SAFE_INTEGER. Parse them as strings or with BigInt, never with Number or JSON.parse into a plain number.
Are the IDs generated on a server?
No. Generation runs in your browser using crypto.getRandomValues. Nothing is uploaded or stored.
Related Tools
Generate UUID v4, UUID v7, and ULID identifiers.
Decode any UUID or GUID — version, variant, embedded timestamp, clock sequence and node, plus other formats.
Generate random strings, API keys and tokens with custom length, character set, hex or Base64 format and prefix.
Convert between Unix timestamps and dates.
Generate secure, random passwords with entropy info.
Generate MD5, SHA-256, SHA-512, and other hashes.