Nil UUID Generator - Create Zero-Value UUIDs

Generate Nil UUIDs online. Create the special all-zeros UUID used as a sentinel value in many systems.

What is Nil UUID?

Nil UUID is a special form of UUID where all 128 bits are set to zero. It is represented as:

00000000-0000-0000-0000-000000000000

The Nil UUID serves as a special reserved value in the UUID ecosystem, defined in RFC 4122. It has specific semantic meaning as an "empty" or "null" identifier when a UUID is required but no actual identifier is appropriate.

How Nil UUID works

  1. It is a predefined constant with all 128 bits set to zero
  2. It technically follows the UUID format of 32 hex digits with hyphens in the 8-4-4-4-12 pattern
  3. It has no version or variant bits because all bits are zeros
  4. It is explicitly identified in RFC 4122 as a special case UUID
  5. It can be used as a sentinel value or placeholder in systems that work with UUIDs

Advantages & Considerations

AdvantagesConsiderations
  • Universally recognized special value
  • Useful as a default/empty state
  • Easy to check for (all zeros)
  • Consistent sentinel value across systems
  • Not globally unique (by design)
  • Should never be used as an actual identifier
  • Could be misinterpreted as an error or uninitialized value
  • May require special handling in systems

Nil UUID Structure

BitsContent
0-127All zeros (0x00000000000000000000000000000000)

Unlike standard UUIDs that have specific version and variant bits set, the Nil UUID has all bits set to zero, including what would normally be the version and variant bits.

Nil UUID vs. other versions

VersionBased onUse caseUniqueness
Nil UUIDConstant (all zeros)Special value, placeholder❌ Not unique (by design)
UUID v1Time + MACTime-ordered IDs✅ Globally unique
UUID v3Namespace + MD5Deterministic IDs✅ Unique per input
UUID v4RandomSecure random IDs✅ Statistically unique
UUID v5Namespace + SHA-1Deterministic IDs✅ Unique per input
UUID v6Time (reordered)Sortable IDs✅ Globally unique
UUID v7Time + randomSortable IDs✅ Globally unique

Common Use Cases

  • Default values: Initial state before a real UUID is assigned
  • Sentinel values: Special marker in systems requiring UUIDs
  • Error detection: Indicator of uninitialized or missing UUID
  • Database placeholders: When a real UUID is pending or not applicable
  • Root objects: Parent-child relationships where the root has no parent
  • Special functions: System operations that need a well-known UUID value
  • Testing: Placeholder value in test environments

Frequently Asked Questions

Is the Nil UUID a valid UUID?

Yes. The Nil UUID is explicitly defined in RFC 4122 as a special case UUID. While it doesn't follow the normal version/variant rules, it is a recognized UUID value with special semantics.

Can I use the Nil UUID as an identifier?

No. You should never use the Nil UUID as an actual identifier. It is a special reserved value meant to represent the absence of a UUID or a default state. Using it as a regular identifier would violate its special purpose.

How do I check if a UUID is the Nil UUID?

Simply compare the UUID to the string "00000000-0000-0000-0000-000000000000" or check if all bits are zero. Most UUID libraries provide a specific function to check for the Nil UUID.

Do all systems recognize the Nil UUID as special?

Not necessarily. While it's defined in the RFC, not all systems may give it special treatment. Some databases might allow it as a valid value, while others might reject it or give it special semantics.

Is there a difference between Nil UUID and an empty UUID?

In properly implemented systems, "Nil UUID" and "empty UUID" should refer to the same concept: the all-zeros UUID. However, some systems might have different representations for "empty" vs. "nil", so it's important to check the specific implementation.

Resources