Boneyard Tools

NanoID Generator

Generate NanoID strings in your browser. Choose the length and alphabet, create a single ID or a bulk batch, and copy the results. Every ID uses your device's secure random source.

How to generate a NanoID

  1. Set the ID size and pick an alphabet, or keep the URL-safe default.
  2. Choose how many IDs you want, from 1 up to 1000.
  3. Click Generate, then copy a single ID or the whole list.

Examples

A default 21-character NanoID

size: 21
V1StGXR8_Z5jdHi6B-myT

Frequently asked questions

What is a NanoID?

NanoID is a tiny, secure, URL-friendly unique string ID. By default it is 21 characters long using a 64-symbol alphabet of A-Z, a-z, 0-9, plus '-' and '_', so it is safe to drop into URLs, filenames and database keys.

NanoID vs UUID - which should I use?

A v4 UUID is a fixed 36-character format with 122 bits of randomness. A default NanoID is shorter at 21 characters with about 126 bits, so it is more compact for the same collision safety. Use UUID when a standard format is required, and NanoID when you want shorter, cleaner IDs.

Are the generated IDs unique?

Practically, yes. A 21-character default NanoID has roughly 126 bits of entropy, so the odds of two colliding are vanishingly small even at billions of IDs. This tool also keeps every ID in a batch distinct.

How are the IDs randomised?

Each ID is built from your browser's cryptographic random source, crypto.getRandomValues. To avoid bias when the alphabet size is not a power of two, the tool uses rejection sampling with a bitmask, the same technique as the NanoID library, so every symbol is equally likely.

Can I change the length or the alphabet?

Yes. Set any size from 1 to 256 characters and supply any alphabet from 2 to 256 symbols. Built-in presets cover URL-safe, alphanumeric, lowercase, numbers and hex. A shorter alphabet or size means fewer bits of entropy, which the collision note reflects.

Is anything sent to a server?

No. Every NanoID is generated locally in your browser, so the values never leave your device. Refresh the page and they are gone.

Related tools