How to validate a GUID
- Paste one GUID, or a whole list with one per line (up to 1,000). Press Sample to see examples.
- Each line shows Valid or Invalid with the reason, such as a wrong length or a letter that isn't hex.
- Valid GUIDs also show their version, variant and, for time-based versions 1, 6 and 7, the date and time they were created.
- Press Copy valid, normalised to get every valid GUID in standard lowercase 8-4-4-4-12 form, ready to paste into code or a database.
What makes a GUID valid?
A GUID (or UUID) is 128 bits written as 32 hexadecimal digits (0–9 and a–f) in the pattern
8-4-4-4-12, for example 3f2504e0-4f89-11d3-9a0c-0305e82c3301. This validator accepts:
- Upper or lower case: GUIDs are case-insensitive.
- The 32-digit form without hyphens.
- The wrappers
{…}and(…)used by Windows and .NET, and theurn:uuid:prefix. - The special nil UUID (all zeros) and max UUID (all F), which RFC 9562 defines as valid.
The regular expression most code uses for a standard hyphenated GUID is:
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
That checks the shape only. A stricter check for RFC-compliant IDs also requires the version digit to be 1–8 and the variant digit to be 8, 9, a or b, which is what the Version and Variant columns report.
Reading the version and variant
| Position | Example | Meaning |
|---|---|---|
| 1st digit of group 3 | xxxxxxxx-xxxx-4xxx-… | Version: 1 time + MAC, 3 MD5 name, 4 random, 5 SHA-1 name, 6 reordered time, 7 Unix time + random, 8 custom |
| 1st digit of group 4 | …-axxx-xxxxxxxxxxxx | Variant: 8, 9, a, b = standard (RFC 4122/9562); c, d = legacy Microsoft; 0–7 = legacy NCS |
Old Microsoft COM GUIDs and some hand-made test IDs use other variant digits. They're still well-formed 128-bit values, so they show as valid, but the variant tells you they weren't made by a standard UUID generator.
Finding when a GUID was created
Version 7 UUIDs start with the number of milliseconds since 1 January 1970 (UTC), and versions 1 and 6 contain a count of 100-nanosecond intervals since 15 October 1582, the start of the Gregorian calendar. The validator decodes these into a readable date and time in the Created column. Random v4 and name-based v3 and v5 GUIDs contain no time information. Treat the decoded time as a hint: the system that made the GUID could have had its clock set wrong.
Comments 0
No comments yet.