GUID / UUID V3 - Name-Based Identifier (MD5 Hash)
GUID / UUID v3 is a name-based identifier using MD5 hashing. Learn about its deterministic generation, structure, MD5 security concerns and why v5 is preferred for new systems.
GUID / UUID v4 is the most widely used GUID / UUID version and is designed to be generated from randomness or a cryptographically secure pseudorandom generator. It requires no coordination, no central authority, no clock synchronization and no device identifiers. Making it ideal for distributed systems, APIs, databases and general-purpose unique identifiers.
GUID / UUID v4 was defined in the original GUID / UUID specifications around 1997 and standardized in RFC 4122 in July 2005.
V4 remains the most popular and widely recommended GUID / UUID version. It is fully supported in both RFC 4122 and RFC 9562 and has no deprecation concerns.
For applications requiring time-based sortability, consider v7 (Unix timestamp-based).
Bit layout: a GUID / UUID is 128 bits written in a canonical 36-character string format with 32 hexadecimal digits plus 4 hyphens (8-4-4-4-12). For v4, the value is mostly random bits, with a few reserved bits to indicate the version and variant.
Field structure: Although GUID / UUID v4 uses named fields from the original time-based layout (time_low, time_mid, time_hi_and_version, clock_seq, node), these fields are not interpreted as timestamps or MAC addresses in v4. They are effectively random bits except for the reserved version and variant bits.
The 128-bit GUID / UUID v4 structure inherits field names from the time-based layout but fills them with random data:
Field Name Bits Hex Description
─────────────────────────────────────────────────────────────────────────
random_low 32 8 32 random bits
random_mid 16 4 16 random bits
random_hi_and_version 16 4 12 random bits + 4-bit version (0100)
random_seq_hi_and_reserved 8 2 2-bit variant (10) + 6 random bits
random_seq_low 8 2 8 random bits
random_node 48 12 48 random bits
Version bits: bits 12-15 of random_hi_and_version are set to 0100 (4 in hex), identifying this as a version 4 UUID.
Variant bits: bits 6-7 of random_seq_hi_and_reserved are set to 10, indicating RFC 4122 compliance.
Random bits: the remaining 122 bits are filled with random or pseudorandom data, providing 2¹²² = 5.3 × 10³⁶ possible unique values.
Try our GUID / UUID Inspector to decode and visualize the bit-level structure of v4 UUIDs.
GUID / UUID v4 uses the standard 8-4-4-4-12 canonical format with 32 hexadecimal digits separated by hyphens (36 characters total).
Canonical format: 8-4-4-4-12
Example (v4): 5c98eda8-b852-4eec-9960-ac2e29d734f4
Layout: xxxxxxxx-xxxx-Mxxx-Nxxx-xxxxxxxxxxxx
^ ^
| └─ N = Variant: typically 8, 9, a or b (RFC variant)
└────── M = Version: first hex digit of 3rd group is "4" for v4
Practical rule: in the canonical string, the version is encoded as the first hex digit of the third group. For v4 it is 4. The variant is indicated by the high bits of the fourth group (often rendered as 8-b in hex). All other characters are random hexadecimal digits.
Randomness: a GUID / UUID is designed to be generated entirely from randomness or pseudorandom numbers.
A version-4 GUID / UUID has 122 bits of randomness (with 6 predetermined variant/version bits), providing 2¹²² possible combinations.
That's approximately:
5.3 × 10³⁶ unique values
To put this into perspective:
/dev/urandom on Linux, CryptGenRandom on Windows, or language-specific secure random functions (crypto.randomBytes in Node.js, secrets module in Python).crypto.randomUUID()import uuid; uuid.uuid4()UUID.randomUUID()Guid.NewGuid()uuid.New() (with google/uuid package)Uuid::new_v4() (with uuid crate)crypto.randomBytes() with sufficient length (256+ bits) and proper encoding.GUID / UUID v4 is the recommended choice for most general-purpose applications. It provides excellent uniqueness guarantees without requiring time-based ordering, deterministic generation, or coordination between systems. From databases and distributed systems to cloud services and APIs, v4 GUIDs / UUIDs offer simplicity, privacy, and scalability.
These articles expand on related concepts, formats and practical considerations.