UUID Generator
Generate one or many version 4 (random) UUIDs at once, using your browser's cryptographically secure random number generator.
How UUID Generator Works
A UUID (Universally Unique Identifier) is a 128-bit value used across software as a practically-guaranteed-unique ID -- for database rows, session tokens, file names, or anything that needs an identifier without a central authority handing out sequential numbers. Version 4 UUIDs, the most common type, are generated almost entirely from randomness, and this tool produces them one at a time or in bulk using your browser's cryptographically secure random number generator.
Formula & Method
Where available, the browser's native crypto.randomUUID() is used directly. As a fallback, 16 random bytes are drawn from crypto.getRandomValues() (the same cryptographically secure source, not Math.random()), then two of those bytes are adjusted to encode the UUID version (set to 4, marking it as randomly generated) and variant (set to the standard RFC 4122 variant bits) in the positions the UUID spec reserves for them -- the remaining 122 bits are fully random. The result is formatted into the standard 8-4-4-4-12 hyphenated hex layout, with optional uppercase, no-hyphens, or brace-wrapped variants applied on top.
Worked Example
A generated v4 UUID looks like 3f2504e0-4f89-4198-9a54-b8c821e6e938 -- 32 hex digits arranged in five hyphen-separated groups, where the "4" immediately after the second hyphen marks it as version 4, and the leading digit of the next group (8, 9, a, or b) marks the RFC 4122 variant.
Frequently Asked Questions
- Can two v4 UUIDs ever collide (be the same)?
- Practically, no -- a v4 UUID has 122 random bits, giving roughly 5.3 × 10³&sup6; possible values. Generating a billion UUIDs a second for hundreds of years still wouldn't give a meaningful chance of a collision; UUID collisions are treated as effectively impossible in real-world system design, which is exactly why they're trusted as unique identifiers without a central coordinating registry.
- Why does the tool use crypto.getRandomValues() instead of Math.random()?
- Math.random() is a fast, non-cryptographic random number generator not designed to be unpredictable -- its internal state can potentially be inferred from enough outputs, which matters if a UUID is ever used somewhere security-sensitive (like a session token or password-reset link). crypto.getRandomValues() draws from the operating system's cryptographically secure random source, which is the appropriate choice for anything a UUID might end up protecting.
- What's the difference between the "4" and the version 1/version 7 UUIDs I sometimes see elsewhere?
- Different UUID versions encode different information -- version 1 embeds a timestamp and the generating machine's network address, version 7 embeds a sortable timestamp for database-friendly ordering, while version 4 (what this tool generates) is nearly pure randomness with no embedded metadata at all. Version 4 is the most common choice specifically because it reveals nothing about when or where it was generated.
- Why would I want to remove hyphens or add braces?
- Different systems expect different UUID formatting conventions -- some databases and older Windows APIs (like COM/DCOM GUIDs) expect the brace-wrapped
{...}form, while some string-based identifiers or URL-safe contexts prefer no hyphens at all. These options exist purely to match whatever format the system you're pasting the UUID into actually expects.