Compact yet collision-resistant
A 21-character URL-safe ID carries about 126 bits of entropy, in the same league as a UUID but far shorter and friendlier in a URL, a filename or a database key.
Create compact, URL-safe unique IDs in the NanoID style, in bulk.
Loading tool…
The tool is loading its code on your device. This happens once and is cached for later visits.
Processed entirely on your device
Overview
Generate NanoID-style unique IDs free. Pick a length and an alphabet — URL-safe, alphanumeric, lowercase, numeric or hex — and create a batch of compact random identifiers for keys, tokens and slugs in your browser.
Unique identifiers are everywhere in software: database keys, session tokens, file names, URL slugs, order references. A UUID works but is long and punctuated with hyphens. NanoID is the compact alternative — a short, URL-safe random string with enough entropy to treat as unique — and this generator produces them in bulk, in the browser, with no dependency to install.
An ID is just a sequence of symbols drawn from an alphabet. The more symbols in the alphabet and the longer the ID, the more possible IDs exist, and the less likely any two of them are to collide. The default alphabet is 64 URL-safe characters — the letters, the digits, underscore and hyphen — and the default length is 21, which together give roughly 126 bits of entropy.
A smaller alphabet needs a longer ID to reach the same entropy: a numeric code has to be much longer than a URL-safe one to be equally collision-resistant. Match the alphabet to where the ID will live, then choose a length that leaves comfortable margin for however many you will ever generate.
Each character is drawn with rejection sampling over your browser's cryptographic random source, not with a modulo of a raw byte. That detail prevents modulo bias: without it, an alphabet whose size does not divide 256 evenly would quietly favour its first few symbols, shrinking the real entropy below the advertised number. With it, every symbol is equally likely and the stated bit-strength is the true bit-strength.
No random scheme guarantees uniqueness, but the numbers are comfortably large. At 126 bits, generating a billion IDs would still leave the probability of any collision vanishingly small — comparable to a UUID. For almost every application you can treat these as unique without a central coordinator checking each one. If you are generating at extreme scale with a short ID or a small alphabet, lengthen the ID: entropy is cheap and collisions are expensive.
Set a count and a length, pick an alphabet, and press Generate. You get a batch you can copy whole or line by line, straight into seed data, configuration or a migration. Because generation is entirely local, an ID you intend to use as a secret token is never sent anywhere — though for high-value secrets you should still store them hashed and prefer a dedicated, reviewed library over any ad-hoc generator.
Step by step
Set how many IDs you need and how long each one should be.
Choose an alphabet — URL-safe by default, or alphanumeric, lowercase, numeric, hex or alphabetic.
Press Generate; each character is drawn from the cryptographic source with no modulo bias.
Copy the batch into your keys, tokens or seed data, or regenerate for a fresh set.
Why use it
What this tool is good for, and what it deliberately does not try to do.
A 21-character URL-safe ID carries about 126 bits of entropy, in the same league as a UUID but far shorter and friendlier in a URL, a filename or a database key.
Match the character set to the job: URL-safe for links, numeric for PIN-style codes, hex for byte-aligned values, lowercase for case-insensitive stores.
Every character uses rejection sampling over crypto.getRandomValues, so alphabets that are not a power of two stay uniform instead of quietly favouring their first symbols.
Produce up to 500 IDs at once without installing NanoID or calling a service. Generation is local, so no key or token you create is ever transmitted anywhere.
Questions
Short, honest answers about quality, limits and privacy.