Skip to content
UUID App
Contact
UUID App

Nano ID Generator

Your new Nano ID is ready below. Change the length or alphabet if you need to. Click Copy to use it, or Generate for a fresh one.

Your Nano ID21 characters
xxxxxxxxxxxxxxxxxxxxx
  • Free, no sign-up
  • Follows the official RFC 9562 standard

Free UUID generator: v4, v7, GUID and more

Need more? Make them in bulk

Make up to 10,000 Nano IDs at once and save them as a file. Three quick steps.

Pick a file type
Check and download

What is a Nano ID?

A Nano ID is a short random ID, 21 characters by default, made only of characters that are safe to use in URLs.

Nano ID is a small open-source library, not a formal standard. By default it picks 21 characters from a 64-character alphabet: A to Z, a to z, 0 to 9, underscore and hyphen. Each character carries 6 random bits, so a default ID has 126 bits of randomness, a little more than the 122 in a UUID v4.

It packs that into 21 characters instead of 36, and needs no encoding in links. You can pick a shorter length or a different alphabet, but every change to either one changes how likely a repeat is.

What a Nano ID looks like

Here is the ID you just made. Click Generate above and watch it change.

  • Every character is random. There is no version digit, no time and no fixed layout. With the default alphabet, each one adds 6 bits.
Need 10,000 UUIDs? Export to CSV, JSON or SQL. Try it free

When to use Nano ID

Good for

  • Short IDs in links, like /p/V1StGXR8_Z5jdHi6B-myT
  • Public IDs for posts, files and invites
  • Keys in front-end state and DOM elements
  • Codes in your own alphabet, like hex or numbers only

Pick something else when

  • Your database or API expects a UUID: UUID v4
  • IDs must sort by time: ULID or UUID v7
  • The same input must give the same ID: UUID v5
  • You need a password or secret token: use a token generator

How short can a Nano ID be?

Shorter IDs are easier to read, but they repeat sooner. These figures use the default URL-safe alphabet. Check your length against how many IDs you will ever make.

10.9 quintillionIDs before a 50% chance of one repeat, at 21 characters
1.3 billionIDs before a 50% chance of one repeat, at 10 characters
20 millionIDs before a 50% chance of one repeat, at 8 characters

Make a Nano ID in code

import { nanoid } from 'nanoid';

const id = nanoid();     // 21 characters
const short = nanoid(10); // 10 characters
console.log(id, short);

Uses the nanoid package from npm. Current versions are ESM only, so use import, not require().

Nano ID vs UUID v4, ULID and UUID v7

FormatLengthRandom bitsSorts by time
Nano ID (this page)21 chars (you choose)126No
UUID v436 chars122No
ULID26 chars80, plus 48 bits of timeYes
UUID v736 chars74, plus 48 bits of timeYes
Need 10,000 UUIDs? Export to CSV, JSON or SQL. Try it free

Questions people ask

Is a Nano ID as unique as a UUID?

At the default 21 characters, yes. It has 126 random bits against 122 in a UUID v4, so a repeat is even less likely. Shorter lengths or smaller alphabets lower that number quickly.

Can I store a Nano ID in a UUID column?

No. A UUID column only takes 128-bit UUIDs. Store Nano IDs in a text column, such as varchar(21) or char(21). If the column must be a UUID, use UUID v4 instead.

Can I change a Nano ID to uppercase?

No. Nano IDs are case-sensitive. "abc" and "ABC" are different IDs, so changing the case would change the ID. To get only one case, pick the "Lowercase and numbers" alphabet.

How do I pick a safe length?

Work out how many IDs you will ever make, then pick a length where a repeat stays very unlikely. Each character you remove makes a repeat much more likely. Our collision probability guide shows the maths.