Generators

Nano ID Generator

Generate compact, URL-safe unique IDs with customizable length and alphabet. Smaller than UUIDs, perfect for URLs and database keys.

21
Default: A-Z a-z 0-9 _ - (64 characters)
Click Generate
Size Comparison
Entropy (bits)
Characters
Alphabet Size
vs UUID v4 (122 bits)
Batch Generation

How to use this tool

  1. Drag the Length (characters) slider to set the ID length, from 2 to 100. The default is 21.
  2. Optionally edit the Alphabet field to control which characters the ID may contain.
  3. Click Generate to produce a new ID — it appears in the output box above the buttons.
  4. Click Copy to copy the current ID to your clipboard.
  5. Check the Size Comparison stats to see the entropy in bits and how it compares to a UUID v4.
  6. Click Generate 5 to batch-generate five IDs at once, each with its own Copy button.

Why this tool is helpful

Compact keys & slugs

Nano IDs are shorter than UUIDs (21 characters by default) and use URL-safe characters, so they're ideal for shareable links, slugs, and database primary keys.

Cryptographically secure

IDs are generated with crypto.getRandomValues, so they're practically impossible to guess or predict — far safer than Math.random().

Customize length & alphabet

Restrict the character set (for example, hex-only or no lookalike characters) and tune the length to meet your exact constraints.

Reason about entropy

The size comparison panel shows real entropy in bits and how your settings stack up against a UUID v4's 122 bits.

Batch generation

Need several IDs at once? Generate five in a single click and copy each one individually.

Stay private

Everything runs in your browser. Nothing is uploaded, logged, or sent to a server.

FAQ

What is a Nano ID?

A Nano ID is a compact, URL-friendly unique identifier generated from cryptographically secure random bytes. It's commonly used for database keys, slugs, and shareable links.

How is a Nano ID different from a UUID?

Both are unique identifiers, but a Nano ID is shorter (21 characters by default vs. a UUID's 36) and lets you choose the length and alphabet. A UUID v4 has 122 bits of entropy; a default 21-character Nano ID has about 126 bits.

What characters does the default alphabet use?

The default alphabet is A–Z, a–z, 0–9, _, and - — 64 characters that are safe to use unencoded in URLs and filenames.

Is it cryptographically secure?

Yes. IDs are generated with the browser's crypto.getRandomValues, a CSPRNG, rather than the predictable Math.random().

Can two generated IDs collide?

Collisions are astronomically unlikely at the default length. The chance depends on your length and alphabet size — the Entropy (bits) stat shows how much randomness each ID carries.

Why would I customize the alphabet?

You might need IDs that only use certain characters — for example, hex digits, uppercase letters, or no lookalike characters like 0 and O. Smaller alphabets carry less entropy per character, so you may want to increase the length.

Does any of my data leave my browser?

No. Generation happens entirely in your browser using JavaScript. Nothing is sent to, stored on, or logged by any server.