Max UUID (All Ones)

Discover the Max UUID (ffffffff-ffff-ffff-ffff-ffffffffffff) introduced in RFC 9562: a new sentinel value with all 128 bits set to one. Learn its purpose.

Format

Detailed Explanation

The Max UUID is a new special UUID introduced in RFC 9562 (May 2024) where all 128 bits are set to one: ffffffff-ffff-ffff-ffff-ffffffffffff. It serves as the upper-bound counterpart to the Nil UUID, providing a sentinel value at the maximum end of the UUID range.

Binary representation:

11111111 11111111 11111111 11111111
11111111 11111111 11111111 11111111
11111111 11111111 11111111 11111111
11111111 11111111 11111111 11111111

Version and variant: Like the Nil UUID, the Max UUID does not conform to standard version or variant encoding. Its version bits (bits 48-51) are 1111 and its variant bits are 11, which falls outside the RFC 4122 variant space. UUID parsers updated for RFC 9562 should recognize it as a special case.

Why the Max UUID was needed: Before RFC 9562, there was no standardized "maximum" UUID. Developers who needed an upper-bound sentinel (for range queries, pagination cursors, or boundary markers) had to invent their own convention. The Max UUID standardizes this pattern.

Practical applications:

  • Range queries: Use Nil UUID as the lower bound and Max UUID as the upper bound to select all records: WHERE id >= '00000000-...' AND id <= 'ffffffff-...'
  • Pagination: Use as an "end of results" marker in cursor-based pagination
  • Sorting boundary: Acts as a guaranteed-last value when UUIDs are sorted lexicographically
  • Testing: Useful as a boundary value in unit tests that validate UUID handling

Code examples:

const MAX_UUID = 'ffffffff-ffff-ffff-ffff-ffffffffffff';
const NIL_UUID = '00000000-0000-0000-0000-000000000000';

// Range check
function isWithinRange(uuid) {
  return uuid >= NIL_UUID && uuid <= MAX_UUID;
}
import uuid
max_uuid = uuid.UUID(int=(1 << 128) - 1)
# or uuid.UUID('ffffffff-ffff-ffff-ffff-ffffffffffff')

Compatibility note: Older UUID libraries written before RFC 9562 may reject the Max UUID as invalid because its version and variant bits do not match any known version. If you encounter this, check for library updates or add special-case handling. Most major libraries have been updated as of 2025.

Use Case

The Max UUID serves as a standardized upper-bound sentinel in cursor-based pagination systems, allowing APIs to signal 'end of results' without using null or a custom marker.

Try It — UUID Generator

Open full tool