UUID v5 generator — the same name always gives the same UUID

Pick a namespace, type one or more names, and get a version 5 (SHA-1) or version 3 (MD5) UUID for each line. The same namespace and name always give the same UUID, in any language that follows RFC 9562.

Live demo · real result from this tool
Version

Press Generate to create a result.

Processed on your device — nothing is uploaded.

How to use the UUID v5 generator

  1. Choose a Namespace: DNS, URL, OID, X.500 or Custom UUID.
  2. For a custom namespace, paste it into Custom namespace UUID. Hyphens, braces, urn:uuid: and upper-case letters are accepted.
  3. Type the Names (one UUID per line). Empty lines are skipped.
  4. Pick the Version: v5 (SHA-1) or v3 (MD5).
  5. Copy the list, or save the Name / UUID table as uuids.csv.

What it does and when to use it

Name-based UUIDs give you stable IDs without a database lookup. Hash the same natural key, such as a domain, a URL, an email or order-1001, and every service gets the same UUID. That helps when merging data from several systems or rerunning an import.

A good pattern is to make one random UUID for your application and use it as the custom namespace for all your own names.

To read the version, variant and timestamp of any UUID, paste it into the UUID inspector. For random v4 IDs, use the UUID generator. To see the SHA-1 and MD5 digests themselves, use the hash generator.

How it works

As defined in RFC 9562 (which replaced RFC 4122):

  1. The namespace UUID is turned into its 16 bytes, and the name is encoded as UTF-8 and appended.
  2. The bytes are hashed with SHA-1 (v5, using Web Crypto) or MD5 (v3, using the hash-wasm library, which loads on first use).
  3. The first 16 bytes of the hash are kept. The high four bits of byte 6 are set to the version (5 or 3), and the top two bits of byte 8 are set to the RFC variant.
  4. The result is written in the 8-4-4-4-12 hex form.

The standard namespaces are DNS 6ba7b810-9dad-11d1-80b4-00c04fd430c8, URL …b811…, OID …b812… and X.500 …b814…, with the rest of the UUID the same. Everything runs in your browser.

Worked examples

DNS namespace, name python.org. These are the values in Python’s own documentation:

v5: 886313e1-3b8a-5372-9b90-0c9aee199e5d
v3: 6fa459ea-ee8a-3ca4-894e-db77e160355e

The third group starts with the version digit (5372, 3ca4).

URL namespace, name https://example.com/products/42:

34adb0ec-5647-5afd-9b6d-76be74ef5892

An invalid custom namespace such as nope gives: A UUID is 32 hexadecimal digits, usually written 8-4-4-4-12 with hyphens.

Limits and tips

  • Not secret, not random. Anyone who knows the namespace and name can recompute the UUID. Never use one as a token or password-reset key.
  • Not sortable by time. Use v7 if insert order matters for your database index.

Frequently asked questions

When should I use v5 instead of a random v4 UUID?
Use v5 when the same input must always map to the same ID, for example to de-duplicate imports or give every URL a stable ID without a lookup table. Use random v4 (or time-ordered v7) when IDs must not be guessable from their input.
Do the results match other languages?
Yes, as long as the namespace and the exact bytes of the name match. Python's uuid.uuid5(uuid.NAMESPACE_DNS, "python.org") gives 886313e1-3b8a-5372-9b90-0c9aee199e5d, the same as this tool. The name is encoded as UTF-8.
Why does "Python.org" give a different UUID from "python.org"?
The name is hashed byte for byte, so case and spaces matter. Each line is used exactly as typed, including trailing spaces. Normalise names (for example, lowercase domains) before hashing in both your code and here.
Should I use v3 or v5?
Prefer v5. RFC 9562 recommends SHA-1-based v5 over MD5-based v3. v3 is here for matching IDs in older systems that already use it.
Does the DNS namespace check that my name is a real domain?
No. Any text is accepted under any namespace. The namespace only adds a fixed prefix to the hash, so pick the one whose meaning fits your names, or use your own namespace UUID.

Written by the ToolsRift team · Last updated

Pages are drafted with AI assistance and checked by automated tests. How we write and check pages.

Was this tool useful?

Report a problem

Start typing to search every tool.

↑ ↓ to moveEnter to openEsc to close