How to generate UUIDs
- Choose v4 for fully random IDs or v7 for time-ordered IDs.
- Enter how many you need, from 1 to 1000, and press Generate.
- Optionally switch to uppercase, remove hyphens or add braces. The list updates instantly.
- Use Copy all or Download .txt to get one UUID per line.
- To inspect an existing ID, paste it into the validator to see its version, variant and, for v7, its creation time.
How UUID v4 and v7 are built
A UUID is 128 bits written as 32 hexadecimal digits in the pattern 8-4-4-4-12. RFC 9562, published in 2024, replaced RFC 4122 and added versions 6, 7 and 8. In every standard UUID, the first hex digit of the third group is the version, and the first digit of the fourth group encodes the variant, which is 8, 9, a or b for RFC UUIDs.
- Version 4: 122 random bits plus the fixed version and variant bits, for example
xxxxxxxx-xxxx-4xxx-[89ab]xxx-xxxxxxxxxxxx. - Version 7: the first 48 bits are the Unix time in milliseconds (big-endian), followed by the version digit 7, the variant bits and 74 random bits. Sorting v7 UUIDs as text therefore sorts them by creation time.
Practical tips
- Store UUIDs in a native type such as PostgreSQL
uuidor a 16-byteBINARY(16)column instead of a 36-character string. It is less than half the size and faster to compare. - Random v4 keys insert at random positions in an index, which can cause page splits and poor cache use on large tables. Switching to v7 usually keeps inserts close to the end of the index.
- Because a v7 UUID reveals when it was created, avoid exposing it publicly where that timing is sensitive, such as account IDs that would show sign-up dates.
- The Nil UUID (all zeros) and Max UUID (all
f) are valid special values, often used as placeholders or sentinels.