Nano ID Generator

Generate URL-safe random IDs with Web Crypto. Choose length, count and a custom alphabet with unbiased byte sampling.

How to use

The default alphabet contains 64 URL-safe characters and the default length is 21. Each character contributes 6 bits of randomness, for 126 bits per default ID. Results are generated on your device with crypto.getRandomValues.

Custom alphabets may contain 2–256 distinct characters, without spaces or control characters. Rejection sampling discards bytes that would bias a non-power-of-two alphabet. Length is 1–128; count is 1–1,000.

Behavior and limits

Shorter IDs and smaller alphabets increase collision risk. Randomness does not guarantee uniqueness; enforce a unique index in your database. Custom alphabets can include characters that are not URL-safe.

Reference

Questions & answers

Are these official library outputs?

This is an independent Web Crypto implementation of random IDs with a Nano ID-compatible default alphabet and length. It does not reproduce a seeded sequence.

Is my input uploaded?

No. Processing runs in your browser. This tool does not send your input to an API or save it in local storage. Text tools accept up to 200,000 characters.

Other Languages