NanoID Generator

Generate compact, URL-friendly unique IDs instantly in your browser.

How many?
Looking for standard 128-bit identifiers? Generate RFC-compliant UUIDv4 and UUIDv7.
Try the UUID Generator
  • Zero Network Latency
    Generated 100% locally in under 1ms via crypto.getRandomValues().
  • Entropy Guarantee
    21 characters pack ~126 bits of uniform entropy. Safe against collision attacks.
  • URL-Safe & Compact
    Uses 64 safe URL symbols (A-Za-z0-9_-) without percentage-encoding expansions.

Documentation

Understanding NanoID

A NanoID is a tiny, cryptographically secure, URL-friendly unique identifier generator created by Andrey Sitnik. Unlike traditional UUID v4 implementations that require 36 hexadecimal characters with hyphens, NanoID uses a 64-symbol alphabet to pack equivalent entropy into 21 characters.

With 21 characters, it provides 126 bits of cryptographic entropy. Generating 1,000 IDs per second would take 4.1 million years to reach a 1% collision risk, making it an ideal drop-in replacement for database keys and short public URLs.

NanoID Anatomy (21 characters)64-Symbol Alphabet
21 chars
compact length
~126 bits
entropy pool
0% escapes
url-safe symbols

Choosing between NanoID and UUID for your database keys or public API URLs?

Read the Complete Comparison
Developer SDKs & APIs

Generate NanoIDs in your code

See implementation examples for JavaScript, Python, Go, Rust and more.

import { nanoid } from 'nanoid';

// Modern JavaScript / Node.js (nanoid package)
const id = nanoid();
console.log(id);
View implementation guides64-Symbol Alphabet

Got Questions?

Frequently Asked Questions

Yes. NanoID relies strictly on cryptographic pseudo-random number generators (CSPRNG). In browser environments, it uses the standard crypto.getRandomValues() API.
A 21-character string from a 64-symbol alphabet yields 126 bits of entropy (log2(64) * 21). This matches the collision probability profile of a standard 128-bit UUID v4 with 15 fewer characters.
Yes. Select quantities like 50 directly in the quick bar or download large batches in JSON or Plaintext directly without leaving your browser.
View all tools (15)