UUID · 128 bits (16 bytes)
UUID format
128 bits written as 32 hex digits in five hyphenated groups.
Key facts
| Size | 128 bits (16 bytes) |
|---|---|
| Text form | 36 characters with hyphens |
| Groups | 8-4-4-4-12 hex digits |
| Version bits | 4 bits in the high nibble of the third group |
| Variant bits | 2 bits at the top of the fourth group |
| Case | Case-insensitive in practice |
Reading the string
123e4567-e89b-12d3-a456-426614174000 is 8-4-4-4-12. The 1 at the start of the third group is the version; the a at the start of the fourth group encodes the variant. Everything else is payload generated according to the version's rules.
Parsing and storage
Store UUIDs in a native 16-byte type when the database has one; it halves the space of a 36-character string and sorts consistently. Compare case-insensitively and accept braces when importing from Windows tools, but emit the canonical lowercase form.
Frequently asked questions
Are UUIDs case-sensitive?
No. Hex digits are case-insensitive; canonical output is lowercase.
Why 36 characters?
32 hex digits plus four hyphens. The hyphens are presentation only and carry no data.
Can I strip the hyphens?
Yes for storage or compact URLs, as long as both sides agree. The 32-digit form is still a UUID.