TFT

Nil UUID & Custom Pattern Generator

Generate the special nil UUID (all zeros) or create a UUID from any hex pattern you define. Useful for representing empty values, placeholders in system design, or creating specific identifier patterns for testing.

Enter any hexadecimal pattern. Will be padded/truncated to 32 characters.

About Nil and Custom UUIDs

The Nil UUID (all zeros) is a special UUID value defined in RFC 4122. It's used to represent the absence of a UUID or as a default/placeholder value.

  • Nil UUID: Used for uninitialized values, default parameters
  • Max UUID: Sometimes used as a sentinel value
  • Custom Patterns: Useful for testing, mocking, and special identifiers

Note: Custom pattern UUIDs may not be valid according to RFC 4122 if they don't have proper version and variant bits set.

How the Nil UUID Generator Works

This tool generates special-purpose UUIDs: the Nil UUID (all zeros), the Max UUID (all F's), and custom pattern UUIDs for testing scenarios. These aren't standard RFC 4122 UUIDs but are useful placeholders and sentinel values.

The Nil UUID (00000000-0000-0000-0000-000000000000) is defined in RFC 4122 as a special value representing "no UUID." The Max UUID is sometimes used as a sentinel or boundary marker. Custom patterns let you create predictable UUIDs for testing.

Special UUID values:

Nil UUID

00000000-0000-0000-0000-000000000000

Represents absence of a UUID, used for default/null values

Max UUID

ffffffff-ffff-ffff-ffff-ffffffffffff

Sometimes used as a sentinel or upper boundary value

Real Use Cases

Default parameter values

A developer needs a sentinel value to represent "no UUID provided" in function parameters, distinct from null or undefined.

Database default constraints

Setting a default UUID value for a column where NULL isn't allowed but you need to distinguish uninitialized records.

Unit test fixtures

Writing tests that need predictable UUID values. Using the Nil UUID or a custom pattern makes test output reproducible and readable.

API mocking

Creating mock API responses with valid-looking UUIDs that are clearly test data, not production identifiers.

Placeholder in templates

A template system needs a UUID placeholder that will be replaced later. The Nil UUID signals "to be generated" clearly.

Boundary testing

Testing UUID comparison logic by using the lexicographically smallest (Nil) and largest (Max) possible values.

What to Know Before Using

Not RFC 4122 compliant: The Nil UUID is defined in RFC 4122 as a special case, but custom pattern UUIDs don't have valid version or variant bits. Don't use them in production systems that validate UUID structure.

Nil UUID purpose: The Nil UUID (00000000-0000-0000-0000-000000000000) is reserved by RFC 4122 to represent "no such UUID." It's useful as a default value but shouldn't be used as an actual identifier.

Custom patterns for testing only: Pattern UUIDs like deadbeef-dead-beef-dead-beefdeadbeef are memorable for debugging but lack proper version/variant bits. Use only in test environments.

Padding behavior: If you enter a custom pattern shorter than 32 hex characters, it's padded with zeros. Longer patterns are truncated. This ensures valid 128-bit output.

FAQ

What is a Nil UUID used for?

The Nil UUID represents the absence of a UUID value. It's used as a default or placeholder when a UUID field is required but no actual identifier exists yet. Think of it like zero for numbers—it's a valid value that means "nothing here."

Is the Nil UUID valid according to RFC 4122?

Yes, RFC 4122 Section 4.1.7 explicitly defines the Nil UUID as a special case. It's the only all-zero UUID that's considered valid. However, it should never be used as an actual identifier—only as a sentinel value.

Can I use custom pattern UUIDs in production?

No. Custom patterns like deadbeef-... don't have valid version or variant bits. Some UUID libraries will reject them. Use only for testing, mocking, or debugging where you control both ends of the system.

What's the Max UUID for?

The Max UUID (all F's) is sometimes used as a sentinel value representing the upper bound of the UUID space. It's useful for testing comparison logic or as a marker for "end of list" in sorted UUID sequences.

Why would I need a predictable UUID?

Predictable UUIDs are essential for testing. If your tests use random UUIDs, debugging failures is harder because IDs change every run. Pattern UUIDs like 12345678-1234-1234-1234-123456789abc make test output consistent and readable.

Will databases accept Nil UUIDs?

Most databases will accept the Nil UUID as a valid value since it's proper hexadecimal format. However, whether you should store it depends on your schema design. Consider using NULL instead if your database allows it.