UUID v5 generator

Generate name-based UUID v5 identifiers in your browser with SHA-1 via crypto.subtle.digest. RFC 9562 version 5, locally. Nothing uploaded.

UUID v5 is a name-based identifier computed with SHA-1. This tool implements RFC 9562 §5.5: SHA-1 via crypto.subtle.digest over the 16 namespace octets concatenated with the UTF-8 name, then version nibble 5 and variant 10xx. The same namespace and name always produce the same UUID. The RFC example DNS 6ba7b810-9dad-11d1-80b4-00c04fd430c8 + www.example.com produces 2ed6657d-e927-568b-95e1-2665a8aea6a2 (Appendix A.4). No Unicode normalization is applied — NFC é and NFD é produce different UUIDs. For random v4, see /uuid-generator/. For time-ordered v7, see /uuid-v7-generator/. Nothing is uploaded.

Namespace UUID

RFC 9562 Appendix A.2: DNS 6ba7b810-9dad-11d1-80b4-00c04fd430c8, URL 6ba7b811-9dad-11d1-80b4-00c04fd430c8, OID 6ba7b812-9dad-11d1-80b4-00c04fd430c8, X.500 6ba7b814-9dad-11d1-80b4-00c04fd430c8. Custom accepts any 8-4-4-4-12 UUID.

Name
UUID

How it works

  1. Select a namespace (DNS, URL, OID, X.500, or a custom UUID) and enter the name. Click Generate to run the conversion.
  2. Generate runs RFC 9562 §5.5: crypto.subtle.digest('SHA-1') on the 16 namespace bytes plus TextEncoder UTF-8 name bytes. The first 16 digest bytes become the UUID. Version nibble 5 and variant bits 10 overwrite the matching hash bits. DNS + www.example.com produces 2ed6657d-e927-568b-95e1-2665a8aea6a2 (Appendix A.4). Name bytes are the typed string, not DNS wire format. No Unicode normalization is applied — NFC é and NFD é produce different UUIDs. For normalization, see /unicode-normalize/.
  3. Uppercase and Remove hyphens reformat the formatted string without changing the value. SHA-1 is collision-broken and should not be used for passwords. SHA-256 name-based IDs require UUIDv8.

UUID v5 in Python and Node

The snippets below hash the RFC 9562 Appendix A.2 DNS namespace with name www.example.com. CPython uuid.uuid5 is the named stdlib API. Node has no uuid.uuid5; crypto.randomUUID() is v4 only. The Node snippet uses crypto.createHash('sha1') — the same FIPS 180-4 SHA-1 this page runs through crypto.subtle.digest('SHA-1'). Both print 2ed6657d-e927-568b-95e1-2665a8aea6a2 (Appendix A.4). CPython 3.12+ python -m uuid -u uuid5 -n @dns -N www.example.com is that same uuid.uuid5() call — see UUID v5 in the shell. For how v5 compares to v4 and v7, see UUID Versions Explained: v4 vs v1, v5, v7 and v8 (Format & Length).

Node.js with crypto.createHash

SHA-1 the 16 namespace octets plus UTF-8 name bytes, keep the first 16 digest bytes, then write version nibble 5 and variant 10xx. Also import { createHash } from 'node:crypto'. This is not crypto.randomUUID():

const { createHash } = require('crypto');

const ns = Buffer.from('6ba7b8109dad11d180b400c04fd430c8', 'hex');
const digest = createHash('sha1')
  .update(ns)
  .update('www.example.com', 'utf8')
  .digest();
digest[6] = (digest[6] & 0x0f) | 0x50;
digest[8] = (digest[8] & 0x3f) | 0x80;
const hex = digest.subarray(0, 16).toString('hex');
hex.slice(0, 8) + '-' + hex.slice(8, 12) + '-' + hex.slice(12, 16) + '-' + hex.slice(16, 20) + '-' + hex.slice(20)
// "2ed6657d-e927-568b-95e1-2665a8aea6a2"

Python with uuid.uuid5

CPython's uuid.uuid5 is RFC 4122 / 9562 name-based SHA-1. uuid.NAMESPACE_DNS is 6ba7b810-9dad-11d1-80b4-00c04fd430c8. The name is UTF-8 of the str, not DNS wire format:

import uuid

uuid.uuid5(uuid.NAMESPACE_DNS, 'www.example.com')
# UUID('2ed6657d-e927-568b-95e1-2665a8aea6a2')

Name bytes are the typed UTF-8 string, not a DNS lookup and not X.500 DER. This page and both snippets skip String.prototype.normalize / unicodedata.normalize, so NFC é and NFD é hash to ebfe0af8-3997-5ade-b634-ba92cf69f557 and 39004b7f-2a0b-588c-88f7-aa24552a7636. uuid.uuid3 is MD5 (v3) and is not offered here. crypto.randomUUID() belongs on the UUID v4 generator. SHA-1 is collision-broken; this is not a password hasher. For checksums, see SHA-256 vs SHA-1 vs MD5: Differences and Which to Use. For NFC before hashing, see Unicode normalize.

UUID v5 in the shell

Generate on this page writes lowercase RFC 9562 §5.5 UUIDs with hyphens. SHA-1 via crypto.subtle.digest('SHA-1') runs over the 16 namespace octets plus TextEncoder UTF-8 name bytes. The first 128 bits become the UUID; version nibble 5 and variant 10xx overwrite those hash bits. util-linux uuidgen --sha1 calls uuid_generate_sha1(): the same SHA-1 of those 16 namespace bytes plus the --name C-string (UTF-8 in a UTF-8 locale), then version 5 / variant 10xx. The documented example uuidgen --sha1 --namespace @dns --name www.example.com prints 2ed6657d-e927-568b-95e1-2665a8aea6a2 (RFC 9562 Appendix A.4) — the same DNS + www.example.com pair this page documents. @dns is Appendix A.2 6ba7b810-9dad-11d1-80b4-00c04fd430c8. CPython 3.12+ python -m uuid -u uuid5 -n @dns -N www.example.com calls uuid.uuid5() and prints that same lowercase hyphenated Appendix A.4 UUID. Default python -m uuid is v4. These commands hash a namespace and name — they do not decode a pasted UUID.

util-linux uuidgen (Linux)

--sha1 / -s requires --namespace / -n and --name / -N. Aliases are @dns, @url, @oid, and @x500, or pass the 8-4-4-4-12 UUID. uuid_unparse prints lowercase 8-4-4-4-12. Older uuidgen rejects the flags:

uuidgen --sha1 --namespace @dns --name www.example.com
# 2ed6657d-e927-568b-95e1-2665a8aea6a2

uuidgen --sha1 --namespace 6ba7b810-9dad-11d1-80b4-00c04fd430c8 --name www.example.com
# same UUID; @dns is that Appendix A.2 value

macOS uuidgen

Apple's uuidgen has no --sha1, --namespace, or --name flags. Output is uppercase v4. For v5 on a Mac, use this page, the CPython uuid.uuid5 block above, or python -m uuid -u uuid5 -n @dns -N www.example.com:

uuidgen
# uppercase 8-4-4-4-12; version nibble is 4

uuidgen --sha1 --namespace @dns --name www.example.com
# unrecognized option

CPython python -m uuid

CPython 3.12+ can run the stdlib uuid module as a script. Pass -u uuid5 with -n / --namespace and -N / --name to call uuid.uuid5() — RFC 9562 §5.5 SHA-1. @dns is Appendix A.2 6ba7b810-9dad-11d1-80b4-00c04fd430c8. Default -u uuid4 is random v4, not this page. 3.14 added -C / --count (default 1). 3.12 and 3.13 reject that flag:

# Same DNS + www.example.com pair this page documents (Appendix A.4)
python -m uuid -u uuid5 -n @dns -N www.example.com
# 2ed6657d-e927-568b-95e1-2665a8aea6a2

# Custom namespace UUID; @dns is that Appendix A.2 value
python -m uuid -u uuid5 -n 6ba7b810-9dad-11d1-80b4-00c04fd430c8 -N www.example.com
# same UUID

# Missing -n or -N
python -m uuid -u uuid5
# Incorrect number of arguments. uuid5 requires a namespace and a name.

# 3.12 / 3.13 reject the batch flag
python -m uuid -u uuid5 -n @dns -N www.example.com -C 3
# unrecognized arguments: -C

Default uuidgen and uuidgen --random are UUID v4 — use the UUID v4 generator. uuidgen --time is v1. uuidgen --time-v6 is v6. uuidgen --time-v7 is v7 — use the UUID v7 generator. --md5 / -m is hash-based v3 and is not offered here. --hex / -x treats --name as hex bytes, not UTF-8 text — this page has no hex-name mode. --count is a time-based cache and is exclusive with --sha1 in current util-linux — it is not the CPython -C batch. Name bytes are the shell string / -N value, not a DNS lookup and not X.500 DER; no Unicode normalization is applied. An empty Name on this page hashes empty UTF-8; the CLI rejects a missing or empty -N. CPython 3.14+ python -m uuid -u uuid5 -n @dns -N www.example.com -C 3 reprints that same deterministic v5 three times; this page writes one UUID per Generate. Some 3.14 builds rejected a raw UUID as -n (invalid choice); 3.12 and later 3.14 accept one. This page's Custom field accepts any 8-4-4-4-12 UUID. Default python -m uuid is v4 — use the v4 generator. python -m uuid -u uuid1 is v1. python -m uuid -u uuid3 -n @dns -N www.example.com is MD5 (v3) and is not offered here. -u uuid6, -u uuid7, and -u uuid8 are 3.14+; -u uuid7 belongs on the v7 generator. This page's Uppercase and Remove hyphens options are display-only; neither uuidgen nor python -m uuid has a hyphen-strip flag — use tr -d '-' for 32 hex digits. print() adds a newline after the UUID. PowerShell [guid]::NewGuid().ToString() is lowercase hyphenated v4, not v5. Windows has no uuidgen --sha1 unless WSL. Version details are in UUID Versions Explained: v4 vs v1, v5, v7 and v8 (Format & Length).

FAQ

Does this generator upload the namespace or name?
No. Generate and Copy run in your browser. The page does not send the namespace UUID or the name to a server.
What is the result format?
DNS Namespace ID 6ba7b810-9dad-11d1-80b4-00c04fd430c8 with name www.example.com produces 2ed6657d-e927-568b-95e1-2665a8aea6a2 (RFC 9562 Appendix A.4). The same namespace and name pair always yields that exact UUID.
How is the UUID computed?
RFC 9562 §5.5: SHA-1 (FIPS 180-4) via crypto.subtle.digest over the 16 namespace octets concatenated with the UTF-8 bytes of the name (TextEncoder). The first 128 bits of the 160-bit digest become the UUID; the last 32 bits are discarded. Version nibble 5 and variant 10xx then overwrite those hash bits. Name bytes are whatever you type, not DNS wire format and not X.500 DER. SHA-1 is collision-broken; this is not a password, signature, or uniqueness proof. A SHA-256 name-based ID requires UUIDv8, not v5.
Does Generate normalize Unicode first?
No. Name bytes are TextEncoder UTF-8 of the typed string without calling String.prototype.normalize. Canonically equivalent e + U+0301 and é (U+00E9) are different UTF-8 sequences (65 CC 81 vs C3 A9), so they produce different v5 UUIDs. NFC é under DNS produces ebfe0af8-3997-5ade-b634-ba92cf69f557. NFD e + U+0301 under DNS produces 39004b7f-2a0b-588c-88f7-aa24552a7636. For Unicode normalization, see /unicode-normalize/.
Is this v3, v4, v7, or a UUID decoder?
No. v3 uses MD5 (§5.3) and is not offered. Random v4 is at /uuid-generator/. Time-ordered v7 is at /uuid-v7-generator/. ULID is at /ulid-generator/. The page does not decode a pasted UUID, look up DNS, or generate v1, v2, v6, or v8.

Related