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).