🆔 UUID Generator

Generate RFC 4122 compliant UUID v4 identifiers

What is a UUID?

A UUID (Universally Unique Identifier), also known as a GUID (Globally Unique Identifier), is a 128-bit number used to uniquely identify information in computer systems. UUIDs are standardized by RFC 4122 and are represented as 32 hexadecimal digits displayed in five groups separated by hyphens: xxxxxxxx-xxxx-Mxxx-Nxxx-xxxxxxxxxxxx. The total number of possible UUIDs is 2^128, which is approximately 3.4 × 10^38 — so large that the probability of generating a duplicate is effectively zero.

This generator creates UUID version 4 (random), which uses random or pseudo-random bits for all 122 variable bits. The version digit (M) is set to 4 and the variant bits (N) are set to 8, 9, a, or b. Version 4 is the most commonly used UUID version because it requires no coordination between systems and works on any machine.

UUID Format Breakdown

A UUID looks like this: 550e8400-e29b-41d4-a716-446655440000

Common UUID Use Cases

UUID Versions Explained

Version 1 (Time-based)

Generated from the current timestamp and the machine's MAC address. The concern with v1 is that it can reveal the MAC address and when the UUID was created. Not recommended for security-sensitive applications.

Version 3 (Name-based, MD5)

Generated from a namespace UUID and a name string using MD5 hashing. The same inputs always produce the same UUID, making it deterministic.

Version 4 (Random) — What we generate

Uses random numbers for all variable bits. The probability of a collision is astronomically low — you'd need to generate over 2.71 quintillion UUIDs to have a 50% chance of a single duplicate. This makes v4 ideal for almost all use cases.

Version 5 (Name-based, SHA-1)

Same as v3 but uses SHA-1 hashing instead of MD5. Preferred over v3 for new applications.

What is the difference between UUID and GUID?

Same thing. UUID is the RFC 4122 name, GUID is Microsoft's name. Both are 128-bit identifiers.

Are UUID v4 collisions possible?

Theoretically yes, but you'd need 2.71 quintillion UUIDs for a 50% chance of one collision. Practically impossible.

Should I use UUID as a database primary key?

Works well for distributed systems. Prevents enumeration and enables merging. Tradeoff: 16 bytes vs 4 bytes, potential index fragmentation.

Are UUID v4 truly random?

Uses crypto.getRandomValues() — cryptographically strong PRNG. Not suitable for crypto keys but excellent for unique IDs.

Can I generate UUIDs offline?

Yes — entirely browser-based using Web Crypto API. No server calls, safe for sensitive applications.