How to use UUID Generator
- 1. Choose an identifier type. UUID v4 for random IDs, UUID v7 for time-ordered IDs, NanoID for compact public IDs, or a custom API key alphabet.
- 2. Set count and length. Bulk generate up to 500 values. Length and alphabet apply to NanoID and API keys, not to UUIDs.
- 3. Copy or download. Copy a single value, copy all, or download a newline-separated file for seeding fixtures.
- 4. Check entropy. The bits estimate is length × log2(alphabet size). Use it as a floor, not as a security audit.
About this tool
Identifiers look simple until they hit a database index, a distributed system, or an attacker who can guess them. UUID v4 (RFC 9562 / RFC 4122) is a 128-bit random value with a version nibble. UUID v7 is a newer time-ordered layout that still contains random bits, which makes B-tree indexes happier than v4. NanoID and custom API keys trade the UUID hyphenated format for a shorter alphabet you control. All of these can be generated in the browser with `crypto.getRandomValues` — there is no reason to call a hosted generator.
UUID v4 vs UUID v7
v4 is random. That is good for uniqueness and hiding creation time, and bad for database locality: inserts scatter across an index. v7 encodes a Unix timestamp in the high bits and fills the rest with random data, so new IDs are roughly sortable by time. Use v7 for primary keys in OLTP databases unless you must hide insertion order. Do not use v1 in new systems (it can leak MAC addresses in older layouts). UUIDs are 36 characters with hyphens (32 hex digits). They are not secrets; they are identifiers. If you need an unguessable capability URL, use more entropy and treat it like a key.
NanoID and API keys
NanoID defaults to 21 characters from a URL-safe alphabet, which is enough uniqueness for most public IDs. API keys should not be UUIDs with a pretty prefix alone. Use a prefix for identification (`sk_live_`, `dk_`) plus a high-entropy random tail, store only a hash (SHA-256) on the server, and show the secret once. Alphabet size matters: `hex` has 4 bits per character; alphanumeric mixed-case is about 5.95 bits; adding symbols increases bits but can break copy-paste in some shells. Rejection sampling in this tool avoids naive modulo bias when mapping random bytes onto an alphabet.
Entropy is a floor
The displayed bits assume independent uniform characters. That is true for this generator. It is not true if you later lowercase the key, strip symbols, or generate from `Math.random()`. Web Crypto CSPRNG is the right source in browsers. For passwords, prefer a generator that uses a word list or a long random string stored in a password manager — this panel is for IDs and API secrets, not for memorized passwords.
Collision reality
v4 UUIDs have 122 bits of randomness. Birthday-bound collisions are not a practical concern at normal application scale. Short NanoIDs in a small alphabet are a different story: estimate volume before you ship a 8-character public slug. If an ID is ever used as a security token, size it like a key (128+ bits) and keep it out of logs.
Code examples
Node v7
import { randomUUID } from "node:crypto";
// Node 20+: crypto.randomUUID() is v4
import { v7 } from "uuid";
const id = v7();Postgres
-- pgcrypto v4
SELECT gen_random_uuid();
-- uuid-ossp v4
SELECT uuid_generate_v4();Hash API keys
const digest = await crypto.subtle.digest("SHA-256", new TextEncoder().encode(apiKey));