A UUID without hyphens contains the same 32 hexadecimal digits as the canonical 36-character form. Use the compact representation only when a protocol or storage boundary requires it, and reinsert separators predictably when displaying it.
Key takeaways
- Removing four hyphens preserves all 128 UUID bits.
- A compact UUID must still contain exactly 32 hexadecimal characters.
- Prefer native UUID database types over manually compacted text where available.
For implementation context, continue with UUID Converter, UUID Regex, and UUID Validator. These pages cover the closest generator, comparison, validation or storage decisions without repeating this guide.
Canonical and compact UUID text
The standard display form has 36 characters: 32 hexadecimal digits and four separators. The compact form removes only those separators. Version and variant information remains in the same hexadecimal positions.
Compact UUIDs can be useful in fixed-width exports, legacy fields and systems that reject punctuation, but the canonical form is easier for people and tooling to recognize.
Add hyphens back safely
Validate that the input contains exactly 32 hexadecimal characters, then split it into groups of 8, 4, 4, 4 and 12. Avoid guessing where separators belong when extra characters or a truncated value are present.
Storage and API notes
A native UUID column stores the value as 16 bytes regardless of how it is displayed. For JSON APIs, canonical hyphenated strings are widely understood and usually worth the four extra characters.