NanoID Generator
Generate compact, URL-friendly unique IDs instantly in your browser.
- Zero Network LatencyGenerated 100% locally in under 1ms via
crypto.getRandomValues(). - Entropy Guarantee21 characters pack ~126 bits of uniform entropy. Safe against collision attacks.
- URL-Safe & CompactUses 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.
compact length
entropy pool
url-safe symbols
Choosing between NanoID and UUID for your database keys or public API URLs?
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);Got Questions?
Frequently Asked Questions
crypto.getRandomValues() API.