Validate UUID

Check a hyphenated UUID’s hexadecimal shape, variant bits, and version.

freeworks offlinenothing uploaded
ToolUUID Validator
Input
Output
Put this on your own site

The frame below runs the same code as this page, in the reader's own browser. Nothing is sent to us, and nothing is sent to you.

Pick a dark background and the text and panels follow it, so the frame stays readable on a dark page.

Preview

How it works

The value is lowercased and matched against the 8-4-4-4-12 layout, with version one through seven and variant 8, 9, a, or b accepted. The all-zero nil identifier is handled as a special valid sentinel.

  • The canonical hyphenated text form is interoperable.
  • Version and variant are checked separately from length.

Worked example

Valid UUID v4
Validate a UUID version 4 (random)
Input
											550e8400-e29b-41d4-a716-446655440000
										
Output
												Valid UUID v4: 550e8400-e29b-41d4-a716-446655440000
											

When to use this

Database keys, request correlation IDs, and test fixtures validate UUIDs.

Edge cases

  • The nil UUID has zero version and variant bits but is accepted as a sentinel.
  • A 36-character value with the wrong variant nibble is invalid.
  • Uppercase input is normalized to lowercase in the result.

References