Illustration of a Nano ID string being generated from a URL-safe alphabet

NanoID Generator

Generate URL-friendly unique IDs, one or in bulk. Runs entirely in your browser.


ℹ️ How this works
  • Uses the same masking algorithm as the real nanoid library: draws random bytes, keeps only the ones landing within the alphabet's range, and retries until the target length is reached — this avoids the bias a naive byte % alphabet.length would introduce whenever the alphabet size isn't a power of 2.
  • Default alphabet and length (21 characters) matches nanoid's own default, with roughly the same collision probability as a UUID v4 at that length.
  • Runs entirely client-side — nothing here is ever sent anywhere. The JSON API below is a separate, opt-in endpoint for scripts.
💻 Show API usage example (cURL)
curl -sS "https://devops.majbase.com/nanoid-generator/api?size=10&count=5"

Returns {"values": [...]}. Optional alphabet (default is the URL-safe A-Za-z0-9_-) and count (default 1, max 100).

🤖 Use this API as a Claude Skill

Want an AI agent (Claude Code, claude.ai, or anything else that supports the Agent Skills format) to use this tool for you on request? Download the skill below and add it:

⬇️ Download SKILL.md · View raw