← All Tools

UUIDv5 / v3 Namespace Generator

Given the same namespace UUID and the same name, UUIDv5 (SHA-1) and UUIDv3 (MD5) always produce the same output UUID. Use them when you need to generate a stable identifier from something that isn’t already an ID — a URL, a DNS name, an internal path, an email — and you want two systems to agree on that ID without coordinating. Prefer v5 for new work; v3 exists mainly for compatibility with older systems.

Single

DNS URL OID X.500 nil

Batch

One name per line. Blank lines are skipped. Namespace and version are taken from the single-mode inputs above.

Algorithm

  1. Serialise the namespace UUID as 16 raw bytes (big-endian across all fields).
  2. Encode the name as UTF-8 bytes.
  3. Hash namespace_bytes + name_bytes with SHA-1 (v5) or MD5 (v3).
  4. Take the first 16 bytes of the digest.
  5. Overwrite the version nibble: byte[6] & 0x0f | 0x50 (v5) or | 0x30 (v3).
  6. Overwrite the variant bits: byte[8] & 0x3f | 0x80 — the RFC 9562 variant (10xx).
  7. Format as 8-4-4-4-12 hex.

Once a namespace is chosen for a system, don’t change it. Every downstream ID depends on the input pair; a different namespace UUID produces a completely different output for the same name.

Known reference vectors

These are checked against RFC 4122 Appendix B and independent implementations. Type www.example.org or python.org in the single form above with the DNS namespace to reproduce.

VersionNamespaceNameExpected UUID
v5DNSwww.example.org74738ff5-5367-5958-9aee-98fffdcd1876
v5DNSpython.org886313e1-3b8a-5372-9b90-0c9aee199e5d
v3DNSwww.example.org0012416f-9eec-3ed4-a8b0-3bceecde1cd9
v3DNSpython.org6fa459ea-ee8a-3ca4-894e-db77e160355e