UUID Formats and Encodings
An overview of the various formats and encodings used to store and transmit UUIDs.
Standard String
The standard format is 36 lowercase hexadecimal characters in the 8-4-4-4-12 pattern. The hyphens are only for readability, so the 32-character form without them represents the same value. Case is not significant, but standardizing on lowercase is the safe choice.
Binary Storage (16 bytes)
Storing a UUID as 16 raw bytes instead of a string cuts its size by more than half and improves index efficiency. PostgreSQL's uuid type and MySQL's BINARY(16) are the typical choices.
Other Notations
There are also the brace-wrapped GUID notation, Base64 and Base32 encodings for shorter URLs, and the urn:uuid: URN notation. When exchanging UUIDs between systems, standardize on a single notation to avoid confusion.