UUID v3 Generator

Generate deterministic name-based UUID v3 using MD5

Namespace

6ba7b810-9dad-11d1-80b4-00c04fd430c8

Name

Generated UUID v3

Enter a name and click Generate
Same namespace + name always produces the same UUID
Note:UUID v3 is a legacy format using MD5 hashing. For new development requiring deterministic UUIDs, prefer UUID v5 (SHA-1). For general-purpose unique IDs, use UUID v4.

What is UUID v3?

UUID v3 is a name-based UUID version defined in RFC 4122. Instead of random data or a timestamp, it derives the UUID deterministically from two inputs: a namespace UUID and a name string. The namespace + name pair is hashed using MD5, and the resulting hash is formatted as a UUID.

The key property of UUID v3 is determinism: the same namespace and name will always produce the identical UUID, on any machine, at any time. This makes it suitable for content-addressing β€” generating stable identifiers for resources that are identified by a meaningful name.

UUID v3 uses MD5 as its hash function. MD5 is considered cryptographically broken for security purposes, which is why UUID v5 (which uses SHA-1) is generally preferred for new development. Neither v3 nor v5 provides any randomness β€” they are purely deterministic.

Standard Namespaces

RFC 4122 defines four pre-assigned namespace UUIDs. Using a standard namespace ensures interoperability β€” two independent implementations will produce the same UUID v3 for the same name within the same namespace:

NamespaceUUIDUse for
DNS6ba7b810-9dad-11d1-80b4-00c04fd430c8Fully qualified domain names (e.g. 'example.com')
URL6ba7b811-9dad-11d1-80b4-00c04fd430c8URLs and URIs (e.g. 'https://example.com/resource')
OID6ba7b812-9dad-11d1-80b4-00c04fd430c8ISO Object Identifiers (e.g. '1.2.840.113556')
X.5006ba7b814-9dad-11d1-80b4-00c04fd430c8X.500 Distinguished Names (e.g. 'cn=John,dc=example,dc=com')

You can also use any arbitrary UUID as a custom namespace β€” for example, a UUID v4 you generate once and embed in your application as a constant. This lets you create a private namespace for your own name-to-UUID mappings.

UUID v3 vs UUID v5

UUID v3 and UUID v5 are structurally identical β€” both are deterministic, name-based UUIDs. The only difference is the hash function:

UUID v3
  • Uses MD5 hashing
  • 128-bit output (UUID-sized)
  • Defined in RFC 4122
  • MD5 is cryptographically broken
  • Supported by all UUID libraries
UUID v5
  • Uses SHA-1 hashing
  • 160-bit hash truncated to 128 bits
  • Defined in RFC 4122
  • SHA-1 is deprecated for security use but stronger than MD5
  • Supported by all UUID libraries

Prefer UUID v5 over UUID v3 for all new development. The SHA-1 hash is stronger than MD5, and the performance difference is negligible. Use UUID v3 only when you need to reproduce UUIDs from a system that already uses it.

When to Use UUID v3

UUID v3 (and v5) are appropriate when you need a stable, reproducible identifier derived from a meaningful name β€” rather than a random ID that must be stored and looked up:

URL canonicalization
Generate a deterministic UUID for any URL to use as a compact, fixed-length key in a database or cache β€” without storing a mapping table.
DNS-based identifiers
Assign stable UUIDs to hostnames or domain names that remain consistent across deployments and databases.
Content addressing
Create reproducible IDs for content items identified by their canonical name β€” articles, products, or configuration keys.
Idempotent resource creation
Generate the same UUID for the same resource name, so that repeated creation attempts are naturally idempotent without a lookup.
Test fixtures
Produce stable, predictable UUIDs in test data so that test assertions do not need to be updated when tests are re-run.
Cross-system deduplication
Two independent systems can derive the same UUID for the same name without communication, enabling deduplication without a shared ID registry.

Understanding Determinism

The determinism of UUID v3 is both its greatest strength and its most important constraint. Given any namespace UUID and any name string, the output UUID is completely fixed β€” no randomness is involved. This means:

Example (DNS namespace, name = 'example.com'):9073926b-929f-31c2-abc9-fad77ae3e8eb

Always produces: 9073926b-929f-31c2-abc9-fad77ae3e8eb

If an attacker knows the namespace and can guess the name, they can compute the UUID in advance. UUID v3 values should never be used as unpredictable tokens, session IDs, or secrets. Use UUID v4 for any security-sensitive identifier.

Code Examples

UUID v3 requires a namespace UUID and a name string. Use the standard uuid package:

JavaScript / Node.js
// Browser / Node.js β€” UUID v3 without dependencies
function uuidV3(namespace, name) {
  // namespace must be a UUID string like '6ba7b810-9dad-11d1-80b4-00c04fd430c8'
  const nsBytes = namespace.replace(/-/g, '').match(/../g).map(h => parseInt(h, 16))
  const nameBytes = [...new TextEncoder().encode(name)]
  const combined = new Uint8Array([...nsBytes, ...nameBytes])

  // md5(combined) β€” use your preferred MD5 library or the inline implementation
  const hash = md5(combined) // returns Uint8Array(16)
  hash[6] = (hash[6] & 0x0f) | 0x30 // version 3
  hash[8] = (hash[8] & 0x3f) | 0x80 // variant

  const h = [...hash].map(b => b.toString(16).padStart(2, '0')).join('')
  return `${h.slice(0,8)}-${h.slice(8,12)}-${h.slice(12,16)}-${h.slice(16,20)}-${h.slice(20)}`
}

// Using the 'uuid' npm package
import { v3 as uuidv3 } from 'uuid'
const DNS = '6ba7b810-9dad-11d1-80b4-00c04fd430c8'
console.log(uuidv3('example.com', uuidv3.DNS))
// β†’ '9073926b-929f-31c2-abc9-fad77ae3e8eb' (always the same)
Python
import uuid

# Using the standard library
dns_uuid = uuid.uuid3(uuid.NAMESPACE_DNS, 'example.com')
print(dns_uuid)
# β†’ 9073926b-929f-31c2-abc9-fad77ae3e8eb

url_uuid = uuid.uuid3(uuid.NAMESPACE_URL, 'https://example.com/page')
print(url_uuid)

# Custom namespace
MY_NS = uuid.UUID('a1b2c3d4-e5f6-7890-abcd-ef1234567890')
custom = uuid.uuid3(MY_NS, 'my-entity-name')
print(custom)
Go
package main

import (
    "fmt"
    "github.com/google/uuid"
)

func main() {
    // Standard DNS namespace
    ns := uuid.MustParse("6ba7b810-9dad-11d1-80b4-00c04fd430c8")
    id := uuid.NewMD5(ns, []byte("example.com"))
    fmt.Println(id)
    // β†’ 9073926b-929f-31c2-abc9-fad77ae3e8eb

    // URL namespace
    urlNS := uuid.MustParse("6ba7b811-9dad-11d1-80b4-00c04fd430c8")
    idURL := uuid.NewMD5(urlNS, []byte("https://example.com/page"))
    fmt.Println(idURL)
}

Frequently Asked Questions

Are UUID v3 and UUID v5 interchangeable?
No β€” they produce different outputs for the same inputs because they use different hash functions (MD5 vs SHA-1). A UUID v3 and a UUID v5 generated from the same namespace + name will be different UUIDs. They are not interchangeable, but they are functionally equivalent in structure and use cases.
Is UUID v3 collision-resistant?
Within a given namespace, two different names will produce different UUID v3 values as long as MD5 does not produce a collision for those specific inputs. MD5 collision attacks exist, but they require carefully crafted inputs β€” in practice, naturally occurring names (URLs, domain names, product IDs) will not collide. For higher assurance, use UUID v5.
Can I use UUID v3 as a primary key in a database?
Yes, if you understand the trade-offs. UUID v3 is deterministic, so the same key will be generated for the same name β€” this provides natural idempotency. However, UUID v3 is not sortable by generation order, and index fragmentation applies just as with UUID v4. For time-ordered, sortable primary keys, use UUID v7.
What encoding should I use for the name input?
RFC 4122 specifies that the name should be converted to bytes using the canonical form of the namespace. For the DNS namespace, use the domain name as a UTF-8 string without trailing dot. For the URL namespace, use the full URL as a UTF-8 string. Always use the same encoding consistently β€” different encodings of the same logical name will produce different UUIDs.
Does UUID v3 hide the original name?
MD5 is a one-way function β€” you cannot reverse a UUID v3 to recover the original name. However, if an attacker knows the namespace and suspects a small set of possible names, they can precompute UUID v3 values for each candidate and compare. For names from a small or predictable space, UUID v3 provides no confidentiality. Use UUID v4 if you need an opaque, non-guessable identifier.