Nano ID Generator

Generate URL-safe, collision-resistant IDs with custom size and alphabet.

Generate Nano IDs — short, URL-friendly, cryptographically random identifiers used by databases like Prisma and Postgres adopters as a UUID alternative. Choose your size, count and an optional custom alphabet, then copy the lot.

Common use cases

  • Generate primary keys for new database tables
  • Mint short-lived invite tokens for SaaS apps
  • Create slug-style IDs for URLs and short links
  • Replace UUID v4 where smaller IDs are preferred

Frequently asked questions

How is Nano ID different from UUID?
Nano ID's default alphabet is URL-safe (no dashes), and 21 characters give roughly the same collision probability as UUID v4 — but only 21 chars instead of 36.
Is it secure?
Yes. Random bytes come from crypto.getRandomValues, the same source used for UUID v4 and security tokens.
What size should I pick?
21 (the default) is collision-safe up to ~2 trillion IDs. Use larger sizes for very high volumes; smaller sizes only when an existing system constrains length.

Related tools