UUID Generator
Generate RFC 4122 version-4 UUIDs (GUIDs) instantly, entirely in your browser.
What is a UUID?
A UUID (Universally Unique Identifier), also called a GUID, is a 128-bit identifier formatted as 32 hexadecimal characters split into five groups by hyphens, e.g. 3fa85f64-5717-4562-b3fc-2c963f66afa6. The format is standardized by RFC 4122. Version 4 UUIDs — the type this tool generates — derive almost every bit from a random number generator, with only a handful of fixed bits identifying the version and variant.
How it works
This page calls the browser's native crypto.randomUUID() function, which is specified by the WHATWG/W3C Web Cryptography standard and backed by a cryptographically secure random source. Set the quantity field to generate a batch, then copy the newline-separated list for use in seed scripts, test fixtures, or database migrations.
Worked example
Say you're seeding a test database with 10 fake users. Instead of hand-typing IDs like user-1, user-2, generate 10 UUIDs here, paste them into your seed script, and each user gets a production-realistic, collision-free primary key with zero coordination required between services.
Common mistakes
- Using UUID v1 (timestamp + MAC-based) when privacy matters — it can leak the generating machine's network address.
- Storing UUIDs as VARCHAR(36) with hyphens in a hot-path table instead of a native UUID/binary(16) column, wasting index space.
- Assuming UUIDs are unguessable secrets — they are unique identifiers, not authentication tokens.
- Sorting large tables by random UUID primary keys, which can fragment B-tree indexes; consider ULIDs if insert order matters.
Security notes
Because UUID v4 values are generated with a CSPRNG, they are safe to use as unpredictable identifiers, but they are not authentication secrets and should not replace a signed JWT or session token for access control.
Code examples
const id = crypto.randomUUID(); console.log(id); // "3fa85f64-5717-4562-b3fc-2c963f66afa6"
import uuid print(uuid.uuid4())
UUID Generator FAQ
What is a UUID?
A Universally Unique Identifier (UUID) is a 128-bit value, usually written as 32 hex digits in five groups (8-4-4-4-12), designed so that generating one independently anywhere is astronomically unlikely to collide with another.
What's the difference between UUID v4 and v1?
UUID v1 encodes a timestamp and the generating machine's MAC address, which can leak information. UUID v4 is fully random (aside from a few fixed version/variant bits), which is why it's the recommended default for most applications.
Are UUIDs generated here cryptographically secure?
Yes. This tool uses crypto.randomUUID(), which is backed by the browser's cryptographically secure random number generator, not Math.random().
Can I use a UUID as a database primary key?
Yes, UUIDs are widely used as primary keys because they can be generated client-side or across distributed services without coordination, avoiding collisions that auto-increment IDs would risk in a distributed system.
How many UUIDs can I generate before a collision?
For UUID v4, you could generate about 1 billion per second for 85 years before reaching a 50% chance of a single collision — it's considered practically unique.
Can I generate multiple UUIDs at once?
Yes — use the quantity field below to generate a batch, then copy them all as a newline-separated list.