DevTools Surf logoDevTools Surf
AI / Modern DevAnimation / CSSAPI / Config
Sign in
DevTools Surf logoDevTools Surf
AI / Modern DevAnimation / CSSAPI / Config
Sign in
HomeGeneratorsNano ID Generator

About Nano ID Generator

Nano ID Generator preview - Generators tool

Generate Nano IDs with custom alphabet. Part of the DevTools Surf developer suite. Browse more tools in the Generators collection.

Use Cases

  • Generate short, URL-safe IDs for permalinks, session tokens, or shareable link slugs.
  • Create unique IDs for client-side objects before they're persisted to a database.
  • Generate API correlation IDs for distributed tracing with custom length and alphabet.
  • Produce batch IDs for test data fixtures or database seeding scripts.

Tips

  • Use the default 21-character length for collision resistance equivalent to UUID v4 — at 1000 IDs/second, collision probability over 4 billion years is ~1%.
  • Use the URL-safe alphabet (A-Za-z0-9_-) for IDs embedded in URLs or filenames — it avoids characters that require percent-encoding.
  • Reduce ID length only for low-volume, short-lived contexts — each character you remove roughly halves the ID space.

Fun Facts

  • Nano ID was created by Andrey Sitnik (also creator of PostCSS and Autoprefixer) in 2017. It reached 1 billion weekly downloads on npm in 2023 — making it one of the most-downloaded packages ever.
  • The Nano ID alphabet of 64 URL-safe characters was chosen because 64 = 2^6 — each character represents exactly 6 bits of entropy, giving mathematically clean entropy calculations without approximation.
  • Nano ID is 3x more compact than UUID v4 in URL-safe form: UUID v4 is 36 characters including hyphens; Nano ID's default is 21 characters with the same collision resistance.

FAQ

How does Nano ID compare to UUID?
Nano ID's 21-character default has 126 bits of entropy vs. UUID v4's 122 bits. Nano ID is URL-safe, 41% shorter, and significantly faster to generate than UUID in JavaScript.
Can I use a custom alphabet?
Yes — define any character set. The tool validates that the alphabet doesn't contain duplicate characters and calculates the resulting entropy per character for your custom combination.
Is it cryptographically random?
Yes — Nano ID uses crypto.getRandomValues() in browsers and crypto.randomFillSync() in Node.js. It is not suitable for cryptographic keys but is appropriate for collision-resistant IDs.

Related Generators Tools

UUID GeneratorULID GeneratorPassword GeneratorcURL to CodeCron Expression ParserSQL FormatterGraphQL FormatterJSON Schema Generator
New · Flagshipsimple REST client

REST Handler — Collections, env vars, history, cURL converter

Send requests, save collections (nested), swap environments, and convert between cURL / Collection JSON / REST Handler YAML.

Open

Popular tools

The most-used tools on DevToolsSurf, one click away.

Encoding & crypto

  • Base64 Encode
  • Base64 Decode
  • URL Encoder
  • URL Decoder
  • Hash Generator
  • JWT Decoder
  • JWT Encoder
  • UUID Generator
  • ULID Generator
  • Password Generator
  • Bcrypt Hash Tester

Converters

  • CSV to JSON
  • JSON to CSV
  • XML to JSON
  • JSON to XML
  • HTML → Markdown
  • HTML → React JSX
  • cURL to Code
  • Collection JSON → cURL
  • Swagger to Collection JSON
  • JSON → Go Struct
  • JSON → TypeScript Types

JSON & YAML

  • JSON Formatter
  • JSON Validator
  • JSON Viewer
  • JSON Minifier
  • JSON Diff
  • JSONPath Tester
  • YAML Formatter
  • YAML to JSON
  • JSON to YAML

Text & regex

  • Regex Tester
  • Text Diff
  • Case Converter
  • Word Counter
  • Markdown Preview
  • Slug Generator
  • Lorem Ipsum Generator
  • Markdown → PDF

CSS & color

  • CSS Beautifier
  • Minify CSS
  • Color Converter
  • Gradient Generator
  • Contrast Checker
  • Color Palette Generator
  • Flexbox Playground
  • Tailwind → CSS

Generators

  • QR Code Generator
  • Mock Data Generator
  • Favicon Generator
  • .gitignore Builder
  • README.md Generator
  • Dockerfile Generator
  • Sitemap Generator

API & networking

  • REST Handler
  • HTTP Header Analyzer
  • IP Address Lookup
  • CIDR Calculator
  • User-Agent Parser
  • HTTP Status Reference
  • OpenAPI Viewer

Date & time

  • Timestamp Converter
  • Timezone Converter
  • Cron Expression Parser
  • Duration Calculator
  • Age Calculator
  • Date Format Converter

Images

  • Image Converter
  • Image Resizer (Batch)
  • SVG Optimizer
  • Base64 ↔ Image
  • WebP ↔ AVIF Converter
  • Image Compressor

PDF tools

  • PDF Merger
  • PDF Splitter
  • PDF Compressor
  • Markdown → PDF
  • EPUB → PDF
  • MOBI / AZW → PDF
  • DOCX → PDF
  • HTML → PDF

Resources

  • Community feed
  • Themes marketplace
  • Pricing & credits
  • Privacy policy
  • Terms of service
  • Sitemap
  • robots.txt

Your account

  • Sign in
  • Dashboard
  • Run history
  • My profile
  • Settings
DevTools Surf logo
DevTools Surf912+ tools

Fast · privacy-first · client-side · © 2026

Home·Feed·ThemesPricing·Sign inPrivacy·Sitemap Feedback