Skip to content
MyToolers

UUID & NanoID Generator

Generate random UUID v4s or NanoIDs in bulk — up to 1,000 at a time.

About this tool

Create universally unique identifiers (UUID v4) or shorter, URL-safe NanoIDs for database records, test data, file names and API keys in development. Generate up to 1,000 at once, choose upper case or no hyphens for UUIDs or any length from 6 to 64 for NanoIDs, and copy them as a list.

How to use it

  1. Choose UUID v4 or NanoID and how many you need (up to 1,000).
  2. For UUIDs pick upper or lower case and whether to keep hyphens; for NanoIDs choose the length.
  3. Press Generate and copy the list.

Good to know

  • UUIDs come from the browser's secure crypto.randomUUID function; NanoIDs use crypto.getRandomValues with NanoID's 64-character URL-safe alphabet (A–Z, a–z, 0–9, _ and -).
  • A 21-character NanoID has about 126 random bits — slightly more than a UUID v4's 122 — in 21 characters instead of 36.
  • Version 4 UUIDs are random, so the chance of a duplicate is extremely small.
  • Nothing is stored or logged.

What a UUID is

A UUID (universally unique identifier) is a 128-bit ID written as 32 hexadecimal characters in five groups, like 3f2b8c1e-9a4d-4e7b-8f21-6c0d5a9e1b34. Version 4 UUIDs are generated randomly, so any computer can create one without checking a central list.

When to use them

As database primary keys when records are created in different places, for file names that must not clash, as idempotency keys for payment requests, and as IDs in test data. You can spot a version 4 UUID by the 4 at the start of the third group.

How unique is unique?

A version 4 UUID has 122 random bits. Even generating billions of them, the chance of two matching is so small it can be ignored in practice. They are not secret, though — don't use a UUID on its own as a password or security token.

UUID or NanoID?

Both are random IDs made from a secure random number generator. A UUID v4 is 36 characters (32 hex digits and 4 hyphens) and is the standard format many databases, such as PostgreSQL's uuid type, and APIs expect. A NanoID is shorter — 21 characters by default — and uses a URL-safe alphabet, so it reads well in links like /orders/V1StGXR8_Z5jdHi6B-myT.

Shorter NanoIDs have fewer combinations. 10 characters is fine for a few thousand short links but not for millions of records; keep 21 characters when IDs must never clash.

Frequently asked questions

What is a UUID v4?

A 128-bit identifier made from random numbers, written as 32 hexadecimal digits in five groups.

What is a NanoID?

A short, random, URL-safe ID. The default 21 characters use letters, digits, _ and -, so it fits in URLs and file names without encoding and is as hard to guess as a UUID v4.

Should I use a UUID or a NanoID?

Use UUID v4 when a database column, API or standard expects the UUID format. Use NanoID when you want shorter IDs in URLs, links or file names.

Can I use them as passwords?

Use the Password Generator for passwords. UUIDs are designed to be unique, not memorable or policy-compliant.