Nil and Max UUID
The two special UUIDs are below. ClickTap Copy to use either value.
What are the Nil and Max UUIDs?
The Nil UUID has all 128 bits set to zero. The Max UUID has all 128 bits set to one. Both are fixed values defined in RFC 9562.
The Nil UUID, 00000000-0000-0000-0000-000000000000, means "no UUID". It is the usual stand-in for an empty or missing ID, and it is the default value of a Guid in .NET.
The Max UUID, ffffffff-ffff-ffff-ffff-ffffffffffff, is the highest possible UUID. RFC 9562 added it in 2024 as a sentinel: a marker for "the end of the list" or "the largest value".
Neither has a version, and neither is unique. Never use them as real IDs for records.
When to use the Nil and Max UUID
Good for
- A placeholder for "no ID yet" where a field cannot be empty
- Default values in .NET, where Guid.Empty is the Nil UUID
- An end marker or upper bound in sorted lists and range queries
- Tests that check how your code handles special values
Pick something else when
- You need a real, unique ID: UUID v4
- You need unique IDs that sort by time: UUID v7
- A database column may have no value: NULL is usually clearer than Nil
- You want to check whether a value is a valid UUID: UUID validator
Get the Nil and Max UUID in code
import { NIL, MAX } from 'uuid';
console.log(NIL);
console.log(MAX);Uses the uuid package from npm. MAX needs version 10 or later.
import uuid
print(uuid.NIL)
print(uuid.MAX)Built in from Python 3.14. On older versions, use uuid.UUID(int=0) and uuid.UUID(int=2**128 - 1).
import java.util.UUID;
UUID nil = new UUID(0L, 0L);
UUID max = new UUID(-1L, -1L);
System.out.println(nil);
System.out.println(max);Built into Java. -1L has all 64 bits set, so two of them make the Max UUID.
Guid nil = Guid.Empty;
Guid max = Guid.AllBitsSet;
Console.WriteLine(nil);
Console.WriteLine(max);Guid.Empty works in every .NET version. Guid.AllBitsSet needs .NET 9 or later.
import "github.com/google/uuid"
fmt.Println(uuid.Nil)
fmt.Println(uuid.Max)Uses the google/uuid package. Max needs v1.6.0 or later.
SELECT '00000000-0000-0000-0000-000000000000'::uuid AS nil,
'ffffffff-ffff-ffff-ffff-ffffffffffff'::uuid AS max;PostgreSQL has no named constants for these, but both are valid uuid values.
Nil and Max vs real UUIDs
Questions people ask
Is the Nil UUID a valid UUID?
Yes. RFC 9562 defines it as a special case, so a good validator accepts it. It has no version, though, and it is not unique.
Should I store the Nil UUID instead of NULL?
Usually not. NULL tells the database there is no value, and foreign keys and queries handle it properly. Use Nil only when a field cannot be empty, like a .NET Guid.
What is the Max UUID for?
It is a sentinel: a fixed value that means "the end" or "the largest possible". It was only added in RFC 9562 in 2024, so older validators may reject it.
Is Guid.Empty the same as the Nil UUID?
Yes. In .NET, Guid.Empty is all zeros, the same as the Nil UUID. Guid.AllBitsSet, added in .NET 9, is the Max UUID. See GUID for more.
Does uppercase or the braces change the value?
No. ffffffff-ffff-ffff-ffff-ffffffffffff and {FFFFFFFF-FFFF-FFFF-FFFF-FFFFFFFFFFFF} are the same Max UUID. The standard says to write lowercase and to accept either when reading.


