Tech

UUID v5 generator

Pick a namespace (DNS, URL, OID, X.500 or your own), type a name and get its deterministic UUID v5 per RFC 4122: the same input always produces the same UUID. SHA-1 computed with WebCrypto, 100% in your browser.

Instant🔒In your browserNo signup
Live
UUID v5

What a UUID v5 is and why it is deterministic

A UUID v5 is a 128-bit identifier defined in RFC 4122 that, unlike the random v4, is computed from two inputs: a namespace (which is itself a UUID) and a name (any text). The algorithm applies SHA-1 to the concatenation of both, so the same namespace with the same name always produces the same UUID — in any language, on any machine, today and ten years from now. That reproducibility is gold for several real-world problems: deduplication (two systems that see the same record generate the same ID without coordinating), stable cache keys, data migrations where you need to regenerate IDs without breaking references, and reproducible IDs in tests and pipelines. The namespace prevents collisions between different domains: "john" as a user and "john" as a product yield different UUIDs if you use different namespaces.

How it is computed (the algorithm step by step)

The RFC 4122 algorithm is simple: take the 16 bytes of the namespace UUID, append the UTF-8 bytes of the name, and compute the SHA-1 of the whole thing. Of the 20 hash bytes, the first 16 are used; then the version nibble is forced to 5 in byte 6 and the variant bits (10) in byte 8, and the result is formatted as 8-4-4-4-12. For example, with the DNS namespace and the name www.example.com the result is always 2ed6657d-e927-568b-95e1-2665a8aea6a2 — the official example from RFC 9562 (the revision of RFC 4122), which you can verify above or in Python with uuid.uuid5(uuid.NAMESPACE_DNS, 'www.example.com'). This tool computes the SHA-1 with crypto.subtle, the browser's native crypto API, so nothing leaves your device.

v5 is not for everything: when another version fits better

If what you need is a fresh unique ID with no input at all (the most common case in databases and APIs), you want a random v4 or a time-sortable v7: for that we have our UUID generator, which produces v4 and v7 individually or in bulk. Use v5 only when the property you are after is that the same data always produces the same ID.

UUID version comparison

VersionData sourceDeterministicHashWhen to use it
v1Timestamp + MAC addressNoLegacy systems; leaks the machine's MAC (privacy issue)
v3Namespace + nameYesMD5Only for compatibility with old systems; prefer v5
v4Random (CSPRNG)NoThe general case: unique IDs with no coordination between systems
v5Namespace + nameYesSHA-1Reproducible IDs: deduplication, cache keys, migrations
v7Timestamp + randomNoTime-sortable database keys (index-friendly)

The 4 standard RFC 4122 namespaces

NamespaceUUIDWhat kind of name it is for
DNS6ba7b810-9dad-11d1-80b4-00c04fd430c8Domain names (e.g. www.example.com)
URL6ba7b811-9dad-11d1-80b4-00c04fd430c8Full URLs (e.g. https://example.com/a)
OID6ba7b812-9dad-11d1-80b4-00c04fd430c8ISO object identifiers (e.g. 1.3.6.1.4.1)
X.5006ba7b814-9dad-11d1-80b4-00c04fd430c8Directory distinguished names (LDAP/X.500 DNs)

If your names do not fit any standard category, generate a UUID v4 once, pin it as a constant in your project and use it as your own namespace via the "Custom" option.

FAQ

What is a UUID v5?

A deterministic UUID from RFC 4122: SHA-1 over a namespace (another UUID) plus a name. Same namespace and name → always the same UUID.

Does UUID v5 always return the same result?

Yes. With the DNS namespace and "www.example.com" it always yields 2ed6657d-e927-568b-95e1-2665a8aea6a2, in any language and on any machine.

What is the difference between UUID v3 and v5?

v3 hashes with MD5 and v5 with SHA-1; the RFC recommends v5. We do not offer v3 because WebCrypto does not expose MD5, and SHA-1 is preferable.

Is it a problem that v5 uses SHA-1, since SHA-1 is "broken"?

Not for this use: here the hash merely distributes names across the ID space; it is not a security mechanism.

Which namespace should I choose?

DNS for domains, URL for URLs, OID for ISO identifiers, X.500 for directory names. If none fits, use your own.

Can I use my own custom namespace?

Yes: generate a UUID v4 once, store it as a constant and paste it into the "Custom" option. Any valid UUID works.

Can the original name be recovered from a UUID v5?

Not directly (SHA-1 is one-way), but with a small name space it can be brute-forced. Do not use it to anonymize sensitive data.

When should I use v5 and when v4?

v4 for fresh unique IDs with no input; v5 when the same data must always produce the same ID (deduplication, cache, migrations).

Is my data sent to a server?

No. The SHA-1 is computed with crypto.subtle in your browser; neither the namespace nor the names leave your device.

Was this generator useful?