UUID v5 Generator
Generate deterministic name-based UUID v5 values. The same namespace and name always produce the same UUID - useful for creating stable, reproducible identifiers from known inputs.
UUID v5 is deterministic - the same namespace + name always produces the same UUID. Generation uses the browser's native SubtleCrypto SHA-1 API. No data leaves your browser.
What is UUID v5?
UUID v5 is a name-based UUID version that uses the SHA-1 cryptographic hash function to derive a UUID from two inputs: a namespace UUID and a name string. The defining property is determinism: given identical inputs, you always get the identical output UUID. This makes v5 fundamentally different from v1 and v4, which always produce a new unique value.
UUID v3 is the earlier name-based version using MD5; v5 with SHA-1 is preferred for all new applications. Neither v3 nor v5 is intended for security purposes - the hash output is truncated to 122 bits and the version/variant bits are modified, so they do not preserve SHA-1's collision resistance properties.
How UUID v5 is Computed
- Convert the namespace UUID to its 16-byte binary representation.
- Encode the name string as UTF-8 bytes.
- Concatenate the namespace bytes followed by the name bytes.
- Compute the SHA-1 hash of the concatenated byte sequence (produces 20 bytes).
- Take the first 16 bytes of the hash.
- Set bits 12-15 of byte 6 to
0101(version 5). - Set bits 6-7 of byte 8 to
10(RFC 4122 variant). - Format the 16 bytes as the canonical UUID string.
This generator performs the SHA-1 computation using the browser's crypto.subtle.digest('SHA-1', data) API. The operation is asynchronous but completes in microseconds. No data is transmitted to any server.
Standard Namespaces
DNS namespace
6ba7b810-9dad-11d1-80b4-00c04fd430c8
Use with fully-qualified domain names. For example, example.com always maps to the same UUID in the DNS namespace.
URL namespace
6ba7b811-9dad-11d1-80b4-00c04fd430c8
Use with full URLs. https://example.com/page and https://example.com/ produce different UUIDs even though the domain is the same.
OID namespace
6ba7b812-9dad-11d1-80b4-00c04fd430c8
Use with ISO OID strings. Common in healthcare (HL7, FHIR) and enterprise systems where ASN.1 Object Identifiers are the canonical identifier scheme.
X.500 namespace
6ba7b814-9dad-11d1-80b4-00c04fd430c8
Use with X.500 distinguished names. Relevant when working with LDAP directories, digital certificates (X.509), and enterprise identity systems.
Practical Applications
- Idempotent ID generation: When importing records from an external system that has string identifiers (email addresses, slugs), use UUID v5 with a custom namespace to deterministically map each external ID to a UUID. Re-running the import will produce the same UUIDs, preventing duplicates.
- Content-addressable references: Systems that need a stable UUID for a given URL or resource name can use UUID v5 with the URL namespace so the same URL always resolves to the same identifier across deployments.
- Feature flags and configuration: Map feature flag names to UUIDs for use in analytics pipelines where the flag name string is inconvenient. Use a private namespace so the mapping cannot be reverse-engineered from the UUID alone.
Custom Namespaces
You can use any valid UUID as a custom namespace. The recommended practice is to generate a random v4 UUID to serve as your application's private namespace UUID, then use that consistently across all your v5 UUID generation calls. Store the namespace UUID in your application's configuration.
Using a private custom namespace ensures that UUIDs generated by your application cannot be predicted by someone who only knows the name string but not the namespace UUID. This does not make UUID v5 a security primitive - it simply reduces guessability for low-sensitivity use cases.