🆔 UUID v5 Generator
UUID v5 is deterministic: the same namespace UUID and name always produce the same UUID, unlike the random v4/v7 UUID Generator. Pick a standard namespace or supply your own.
Namespace plus name, hashed
The 16 raw bytes of the namespace UUID are concatenated with the UTF-8 bytes of the name and hashed with SHA-1. The first 16 bytes of that 20-byte digest become the UUID, with six bits overwritten to mark it version 5, RFC 4122 variant:
SHA1(namespace_bytes || name_bytes) -> take 16 bytes
DNS namespace + "www.example.com"
= 2ed6657d-e927-568b-95e1-2665a8aea6a2
That value is fixed for all time and every implementation - run it in Python,
Go or here and you get the same 36 characters. There is no randomness and no
clock involved, so uniqueness rests entirely on your names being unique inside
the namespace you picked. The same name under the URL namespace gives
b63cdfa4-... instead, which is the whole purpose of namespaces.
Choosing inputs
- The four presets are the RFC's own - DNS, URL, OID and X.500. Any valid UUID works as a custom namespace; generate one v4 for your application and write it down.
- Names are byte-exact. No trimming, no lowercasing:
WWW.example.comhashes toceb6936f-..., nothing like the lowercase form. Normalise before you hash. - v5 over v3. Version 3 is the same construction with MD5; pick v5 unless you must match an existing v3 value.
Frequently asked questions
Will the same name always give the same UUID?
Yes, provided the namespace and the exact bytes of the name are the same. That is what makes v5 useful for stable IDs across systems that never talk to each other, such as importing the same catalogue into two databases.
Does SHA-1 being broken matter here?
Not for ordinary use. The known attacks are collisions between two crafted inputs, not reversing a hash, and a UUID keeps only 122 of the 160 bits anyway. Do not build a signature or a capability token out of one.
Can I get the original name back from a v5 UUID?
Not by reversing it - the hash is one way and most of the digest is discarded. A short or predictable name can still be found by guessing and re-hashing until the output matches.