Developer guide
How to generate a version 4 UUID
A version 4 UUID is a 128-bit identifier with fixed version and variant bits and 122 bits generated randomly.
Open the UUID GeneratorWhat a UUID v4 looks like
A UUID is usually displayed as 32 hexadecimal digits in five groups separated by hyphens. Version 4 identifiers follow the pattern below, where the first character of the third group is 4.
xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx
The y position contains the RFC variant bits, so it begins with 8, 9, a, or b.
How to generate a UUID
- Choose the number of identifiers required, up to the tool's batch limit.
- Select Generate UUIDs.
- Copy the one-per-line result.
- Store each value in a field that preserves all 36 displayed characters.
- Generate a fresh batch rather than editing characters manually.
The ToolPixels generator uses browser cryptography and sets the version 4 and RFC variant bits correctly.
UUID v4 is random, not sequential
A UUID v4 does not encode a timestamp, machine identity, or database sequence. It is useful when independent systems need identifiers without asking a central counter for the next number.
Random ordering can be less friendly to some database indexes. If insertion order matters, compare the identifier types supported by the database and application architecture.
Uniqueness in practice
Each UUID v4 has 122 random bits after fixed bits are accounted for. Collisions are extremely unlikely with a cryptographically secure generator, but no random scheme offers an absolute mathematical guarantee of global uniqueness.
Applications should still enforce a unique constraint where duplicates would be harmful. The generator does not register, reserve, or remember identifiers.
UUID handling tips
- Do not use
Math.random()to implement security-sensitive UUID generation. - Treat uppercase and lowercase forms consistently when comparing text.
- Do not use an identifier itself as proof of authorization.
- Keep the canonical hyphenated form unless a protocol specifies another representation.
- Validate external UUID text before storing it.
Open the ToolPixels tool
Generate up to 1,000 random version 4 UUIDs per batch locally with browser cryptography.