Skip to content
100% in your browser. Nothing you paste is uploaded — all processing runs locally. Read more →

Nil UUID

The all-zero UUID. RFC-defined sentinel, not a generated value.

The literal value

00000000-0000-0000-0000-000000000000

What's special about it

The nil UUID is reserved by RFC 4122. No legitimate generator will ever produce it (the version and variant bits are required to be non-zero), which makes it a safe sentinel — you can be sure that a value of all zeros was deliberately set, not accidentally generated.

The max UUID (FF…FF)

RFC 9562 added a counterpart, the max UUID, all bits set: ffffffff-ffff-ffff-ffff-ffffffffffff. It's useful as an upper bound in range queries when you want "everything up to (but not including) any real UUID."

Common pitfalls

Real-world use cases

The nil UUID shows up in a handful of legitimate places:

Generating nil in code

// JavaScript
import { NIL } from "uuid";
NIL; // "00000000-0000-0000-0000-000000000000"

// Python
import uuid
str(uuid.UUID(int=0))

// C#
Guid.Empty.ToString()

// Go
import "github.com/google/uuid"
uuid.Nil.String()

// PostgreSQL
SELECT '00000000-0000-0000-0000-000000000000'::uuid;

RFC reference

RFC 4122 §4.1.7 reserves the nil UUID. RFC 9562 (2024) §5.9 reaffirms it and adds the max UUID (§5.10). Both are exempt from version and variant bit checks — a parser that strictly validates those bits should still accept nil and max as special cases.

FAQ

What is the nil UUID?

The nil UUID is the all-zero UUID: 00000000-0000-0000-0000-000000000000. RFC 4122 reserves it as a special value, distinct from any generated UUID.

What about the max UUID?

RFC 9562 (2024) also defines a max UUID: ffffffff-ffff-ffff-ffff-ffffffffffff, all bits set. Useful as an upper sentinel in range queries.

When would I actually use nil?

As a sentinel in databases that have a NOT NULL UUID column but need a 'no value' marker. As a placeholder during construction. As a comparison value in tests. Don't use it for real records — many libraries treat it specially.