BYTETOOLS

NanoID Generator

Generate NanoIDs online with a configurable size and alphabet. Uses crypto-secure, unbiased random sampling. Create up to 50 URL-safe IDs at once. Free and private.

What is the NanoID Generator?

The ByteTools NanoID Generator produces compact, URL-safe unique IDs. By default it uses a 21-character ID from a 64-symbol URL-safe alphabet — the same defaults as the popular nanoid library — but you can change both the length and the alphabet to suit your keys, slugs or tokens.

  • Configurable size and custom alphabet
  • URL-safe 64-symbol default alphabet
  • Crypto-secure, unbiased random sampling
  • Generate 1–50 IDs at once
  • Copy one or copy the entire batch
  • 100% client-side — IDs never leave your browser

How to use the NanoID Generator

  1. 1

    Set the ID size (length) you want, default 21.

  2. 2

    Optionally edit the alphabet — the default is URL-safe.

  3. 3

    Choose how many IDs to generate (1–50).

  4. 4

    Click Generate, then copy one ID or the whole batch.

About the NanoID Generator

The ByteTools NanoID Generator produces compact, URL-safe unique IDs. By default it uses a 21-character ID from a 64-symbol URL-safe alphabet — the same defaults as the popular nanoid library — but you can change both the length and the alphabet to suit your keys, slugs or tokens.

Randomness comes from your browser's cryptographically secure generator, and the tool uses unbiased rejection sampling so every character in your alphabet is equally likely — no modulo bias that would subtly weaken the IDs. You can create 1 to 50 IDs at once and copy the whole batch in one click.

Everything runs 100% locally in your browser. Nothing is uploaded, logged or stored, so the IDs are private to you and the tool works offline.

Frequently asked questions

What is a NanoID?

A NanoID is a compact, URL-safe unique string ID. The default is 21 characters drawn from a 64-symbol alphabet of letters, digits, underscore and hyphen. It is shorter than a UUID for the same collision resistance and needs no dashes or special formatting.

How is a NanoID different from a UUID?

Both are random IDs, but a NanoID is customizable and typically shorter — 21 URL-safe characters versus a UUID's 36 with dashes. You can shrink or grow it and swap the alphabet, trading length against collision probability to fit your use case.

What does unbiased sampling mean here?

Naively taking a random byte modulo the alphabet size makes some characters slightly more likely than others. This tool uses rejection sampling: it masks random bytes and discards values that fall outside the alphabet, so every symbol has exactly equal probability.

Can I use my own alphabet?

Yes. Edit the alphabet field to any set of characters you like — for example digits only for numeric codes, or lowercase letters for readable slugs. The generator adjusts its sampling automatically so the output stays uniform and unbiased.

Are the IDs generated on a server?

No. Every NanoID is created in your browser with crypto.getRandomValues. Nothing is uploaded, logged or stored, so the IDs stay private and the tool works even offline.

Guides for NanoID Generator

Related tools