UUID Generator
UUID v4 is built from crypto.getRandomValues, with 122 of its 128 bits random — about 5.3×10^36 combinations, so even a billion UUIDs keep the collision chance near one in a billion. Generate 1–500 at a time with case switching and batch copy: database keys, distributed IDs and test data.
UUID v4 is a 128-bit random identifier, usually written as five hyphenated groups of 8-4-4-4-12, used for database primary keys, distributed IDs, request tracing and test data. Its value is being generated locally with no central coordination, so machines working independently will not collide — which makes it a better fit than an auto-incrementing ID for sharded databases and offline work.
Two distinctions worth making. Generation uses cryptographically secure randomness (crypto.getRandomValues here), but a UUID is not a password or an access token — it carries no expiry and no signature, so one captured in a log or guessed can be replayed. And v4 is entirely random with no time component, so using it as a primary key in InnoDB causes page splits through random insertion; write-heavy workloads are better served by an ordered ID such as v7 or a snowflake ID.
Did this tool solve your problem?
Submitting sends the tool name, your input and the current result to the server. Please do not include ID numbers, phone numbers or other private data.
AI assistant It answers using your current input and result
Asking again sends your current input and result to the server once more. Please do not include private data.
How to use
- Set how many UUIDs to generate, from 1 to 500.
- Choose the letter case.
- Copy the list.
- Prefer an ordered ID for write-heavy primary keys.
How it works
Generate in one click
Set the count (1-500) and press generate.
Case switching
Case is switchable: standard output is lowercase, though some database keys or business scenarios want uppercase.
Reading and copying results
The first UUID shows in the result area, the full list lines up below, and copy-all takes them all at once (newline-separated).
Code example
Shell Generating on the command line
# Linux / macOS ship uuidgen
uuidgen # e.g. 3F2504E0-4F89-11D3-9A0C-0305E82C3301
uuidgen | tr A-Z a-z # lowercase
# Batch generation with the Python standard library
python3 -c "import uuid; [print(uuid.uuid4()) for _ in range(5)]"
SQL Using it as a primary key (MySQL 8)
-- Store UUIDs as CHAR(36); BINARY(16) halves the space at scale
CREATE TABLE api_token (
id CHAR(36) NOT NULL PRIMARY KEY,
user_id BIGINT UNSIGNED NOT NULL,
created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP
);
INSERT INTO api_token (id, user_id) VALUES (UUID(), 1001);
-- Note: random primary keys cause page splits — prefer ordered IDs for write-heavy tables
FAQ
Can UUIDs collide?
Theoretically, but negligibly: v4 has 122 random bits — about 5.3x10^36 combinations. It takes roughly 103 trillion UUIDs to reach a one-in-a-billion collision chance. Distributed systems can each generate freely with no central coordination.
Are UUID and GUID the same thing?
Essentially yes. GUID (globally unique identifier) is Microsoft's name for UUID; implementations follow RFC 4122 — SQL Server's NEWID() and .NET's Guid.NewGuid() both produce UUID v4.
Can a UUID serve as a password or token?
Its randomness comes from a cryptographic source, so it works as a one-time token (like an email verification link). As a password it's too long to remember — use the dedicated password generator, which offers symbol sets and length control.
What is a UUID?
Universally Unique Identifier: a 128-bit identifier written as 8-4-4-4-12 — 36 characters with 4 hyphens. It needs no central authority, letting distributed systems generate nearly collision-free IDs.
UUID v1 vs. v4 vs. v7 — what differs?
v1 builds on a timestamp plus MAC address — sortable by time but leaking generation time and device info; v4 is fully random, best for privacy; v7 puts the timestamp in the high bits with randomness after — both random and time-sortable, ideal for database keys. This tool generates v4.
Why are UUID keys sometimes slow in databases?
v4's randomness scatters insert positions, causing B+ tree page splits and random IO that slow index writes. Use ordered UUID v7 or snowflake IDs instead, or keep an auto-increment key and add a uniquely-indexed UUID column.
Can the hyphens be removed?
Yes. Hyphens exist only for readability; without them it's 32 hex characters with identical information. Strip them in storage to save space, restore the standard form for display and cross-system interchange.