Nanoid Generator Online — URL-Safe Compact IDs

Generate Nanoid-style IDs with CSPRNG in your browser. Pick a size preset and alphabet (URL-safe, alphanumeric, or numeric).

Loading…
Nanoid generator — developer notes
Compact IDs via unbiased sampling over a fixed alphabet. URL-safe alphabet by default (64 chars); UI size presets only.

How generation works

Pick size (8/12/16/21/32), alphabet, and count, then Generate. Rejection sampling + crypto.getRandomValues — never Math.random.

Options

Size (presets)
Longer IDs reduce collisions. The UI offers presets only (no free-form field); the lib clamps 2–64 defensively.
Alphabet
url = A–Z a–z 0–9 _- (Nanoid default). alphanumeric = without _-. numeric = digits only.
Count (1–20)
Multiple IDs for fixtures, capped at 20.

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? See the UUID generator. For time-sortable IDs, the ULID generator.

Nanoid generator FAQ

Compact IDs

Can I type a custom size?

Not in v1 — only presets 8, 12, 16, 21, and 32 to avoid bad configs.

Custom alphabet?

Out of scope. Three documented presets only.

Is data uploaded?

No — local generation only.

Why not the npm nanoid package?

A small implementation aligned with the password-generator CSPRNG pattern, with no npm dependency.

Looking for converters, encoders, formatters, and minifiers in one place? Developer tools hub Open the curated developer tools catalogue.