Advertisement

UUID v5 Generator

Create deterministic UUIDs (version 5) from a namespace and a name. The same inputs always produce the same ID, which makes v5 perfect for stable identifiers derived from existing data like usernames, URLs or file paths.

UUID v5 options

Same namespace plus same name always gives the same UUID.

Press Generate UUID.

Everything runs locally. Nothing is sent to any server.

Advertisement

How UUID v5 works

Version 5 takes a namespace UUID and a name string, concatenates their bytes, and runs SHA-1 over the result. The first 128 bits of the hash become the UUID, with the version nibble forced to 5 and the variant bits set to RFC 4122. Because SHA-1 is deterministic, identical inputs always yield the identical UUID on any machine, in any language.

When to use version 5

Use v5 when you need stable IDs derived from data you already have: user IDs from email addresses, content IDs from URLs, or test fixtures that must be identical on every run. Anyone can recompute the same ID later without storing a mapping. For random, unpredictable IDs use v4; for time-ordered IDs use v1 or v7.

UUID v5 Generator FAQs

Will the same name always give the same UUID?
Yes, as long as the namespace is the same too. v5(DNS, "www.example.com") is 2ed6657d-e927-568b-95e1-2665a8aea6a2 everywhere, in every programming language.
Which namespace should I choose?
Use DNS for hostnames, URL for full URLs, OID for object identifiers, and X.500 for distinguished names. The namespace only changes the hash input, so pick the one that matches your data.
Is UUID v5 secure or reversible?
SHA-1 is one-way, so you cannot recover the name from the UUID. But names with low entropy (like common words) can be guessed by hashing candidates, so do not use v5 to hide secrets.
What is the difference between v3 and v5?
Both are name-based and deterministic. v3 uses MD5 while v5 uses SHA-1. v5 is preferred because MD5 is more broken, though neither should be used for security purposes.
Can two different names produce the same UUID?
Only if SHA-1 collides, which has never been demonstrated for a meaningful preimage attack on UUID inputs. For practical purposes, different names give different UUIDs.
Advertisement