Nanoid Generator Online — URL-Safe Compact IDs

Generate Nanoid-style IDs in your browser with a cryptographic random source. Set the size from 2 to 64, pick an alphabet (URL-safe, alphanumeric, numeric, no look-alike or custom) and create up to 50 IDs at once.

Loading…
How the Nanoid generator works
Compact IDs drawn without bias from an alphabet you choose. URL-safe by default (64 characters), any length from 2 to 64 with presets, plus custom and no-look-alike alphabets.

NanoID vs UUID

NanoID solves the same problem as a UUID, unique IDs, but trades the fixed 128-bit RFC layout for a shorter, URL-safe string. The default alphabet has 64 URL-friendly characters. Set the length with the slider or the number field (2 to 64) or a preset, and switch to numeric, alphanumeric, no-look-alike or a custom alphabet (at least two different characters). Shorter IDs are easier to copy but collide more often as volume grows. No length fits every case: match it to your storage format and how many IDs you will create. Generation uses rejection sampling with crypto.getRandomValues in your browser. For standard UUID v4 or v7, or ULIDs that sort by time, use the UUID generator or the ULID generator.

How generation works

Set the size with the slider, the number field or a preset, from 2 to 64. Pick an alphabet and a count up to 50. The list is filled when the page opens and generated again each time you change an option. Randomness comes from crypto.getRandomValues with rejection sampling, never Math.random. Copy one line, copy all, or download a .txt file.

Options

Size (2–64)
Longer IDs mean fewer collisions. Use the slider or the number field for any length from 2 to 64, or select a preset (8, 12, 16, 21, 32).
Alphabet
URL-safe uses uppercase and lowercase letters, digits, underscore and hyphen, the Nanoid default. Alphanumeric drops the underscore and hyphen. Numeric keeps the digits only. No look-alike removes 0, O, o, I, l and 1. Custom uses the characters you paste.
Count (1–50)
Several IDs for a set of fixtures, up to 50.
Custom alphabet
Paste any string of up to 256 characters. Repeated characters are dropped and at least 2 different ones must remain. The entropy shown uses the size of that cleaned-up alphabet.

Examples

Default URL-safe

Settings

size=21, alphabet=url

Output

V1StGXR8_Z5jdHi6B-myT

Short numeric

Settings

size=8, alphabet=numeric

Output

eight digits 0–9

Related utilities

Need UUIDs? Use the UUID generator. For IDs that sort by time, the ULID generator.

Nanoid generator FAQ

Compact IDs

Can I type a custom size?

Yes. Use the slider or the number field for any length from 2 to 64. The presets are only shortcuts.

Custom alphabet?

Yes. Select Custom and paste your characters (up to 256, at least 2 different ones). Emoji and other Unicode code points work, but a character made of several code points is split into its parts.

Is data uploaded?

No. IDs are generated in your browser and nothing is sent to FastMinify.

Why not the npm nanoid package?

The page uses a few lines of its own: crypto.getRandomValues with rejection sampling, the same approach as our password generator. Every character of the alphabet has the same chance, and no extra package is loaded.

What length should I choose?

Longer IDs lower the chance of a collision. The URL-safe default uses 21 characters, like the Nanoid library. Use the slider for any length from 2 to 64, or a preset (8, 12, 16, 21, 32). A numeric alphabet needs more characters than a mixed one for the same entropy.

Timestamps, UUID, ULID, Nanoid, cron, passwords, regex, slugs, number bases, letter case, text diff, chmod and Lorem Ipsum, all in your browser.