Skip to content

NanoID Generator

Generate compact, URL-safe NanoIDs with Web Crypto. Choose count and size, optionally set a custom alphabet, then copy one or all. Everything runs in your browser — nothing is sent to a server.

NanoID generator controls

How it works

NanoID produces compact random strings from a configurable alphabet. By default it uses the URL-safe set A–Z a–z 0–9 _ - (64 symbols) at length 21, which offers strong collision resistance while staying shorter than a classic UUID string.

Set how many IDs to create, the size (8–64), and optionally a custom alphabet. Random bytes come from Web Crypto; biased sampling is avoided so each alphabet symbol stays evenly likely.

Unlike ULID or UUID v7, NanoIDs here carry no embedded timestamp — they are opaque random tokens suited to public URLs and short references.

When to use this tool

Tips

Frequently asked questions

What is a NanoID?

A NanoID is a compact, URL-safe unique string ID. The default alphabet is A-Za-z0-9_- (64 characters) and the default length is 21, which gives collision resistance comparable to UUID v4 while producing shorter, prettier IDs for URLs and public tokens.

NanoID vs UUID / ULID?

UUID (including v7) is a fixed 128-bit standard with hex formatting. ULID is 26 Crockford Base32 characters and embeds a timestamp so IDs sort by time. NanoID is fully random (no timestamp), customizable in length and alphabet, and typically shorter for the same collision resistance when using the URL-safe alphabet.

Does my NanoID data leave my browser?

No. Generation runs entirely in your browser with JavaScript and Web Crypto. Nothing is uploaded to a server.

Is this NanoID generator free?

Yes. The Formattly NanoID Generator is free to use with no signup required.

What size should I choose?

The default size of 21 with the URL-safe alphabet is a solid general-purpose choice. Use longer IDs for very high issuance rates, or shorter ones only when collisions are acceptable (for example throwaway demo labels).