Frequently Asked Questions
Are UUIDs really unique?▼
Technically, no identifier is absolutely unique forever. However, the probability of a collision in UUID v4 is so astronomically low (1 in 2^122) that for all practical purposes, they are unique. You are more likely to be hit by a meteorite than generate a duplicate UUID v4.
Should I use UUIDs or Auto-Increment Integers?▼
Use UUID v7 for Primary Keys in distributed applications, microservices, or public-facing URLs. Use Integers for small, internal lookup tables (like "Status Types" or "Categories") where the count is low and predictable.
Why are UUIDs 36 characters long?▼
The 36 characters are the hexadecimal representation of the 128-bit number (32 hex digits) plus 4 hyphens. The canonical format is 8-4-4-4-12. If you remove hyphens, it is 32 characters.
Can I compress a UUID?▼
Yes. Since a UUID is just a large number (128-bit integer), you can encode it using Base62 or Base64URL. This reduces the string length from 36 characters to 22 characters, making it more URL-friendly.
Is UUID v1 secure?▼
No. UUID v1 contains the MAC address of the computer that generated it. This can be used to track the physical location or identity of the creator. Do not use v1 for public-facing or user-generated content.