UUID Generator
128 Bits of Near-Certain Uniqueness
A UUID (Universally Unique Identifier) is a 128-bit value formatted as 32 hexadecimal digits split into five groups, designed so that independent systems can generate identifiers without coordinating with each other and still avoid collisions. Database primary keys, distributed system trace IDs, and session tokens all lean on UUIDs specifically because no central authority needs to hand them out.
The Standard
(M = version digit, N's leading bits = variant)
Version 4 UUIDs are generated from 122 bits of randomness (the remaining 6 bits are fixed to identify the version and variant), making accidental collisions astronomically unlikely even across billions of generated values. Version 1 UUIDs instead derive from the current timestamp and the generating machine's network identifier, which makes them sortable by creation time but reveals the generating host — a trade-off most modern systems avoid in favor of version 4.
Version Comparison
| Version | Basis | Notable property |
|---|---|---|
| Version 1 | Timestamp + node (MAC-derived) identifier | Roughly time-sortable; can leak host information |
| Version 4 | Cryptographically random | No information leakage; the most widely used version today |
Where This Matters
- Database primary keys — UUIDs let multiple services or database shards generate new record IDs independently without needing a central counter, which is essential for horizontally scaled systems.
- Distributed tracing — assigning a unique request or trace ID at the entry point of a system lets you follow that request through logs across many microservices.
- Avoiding enumeration attacks — unlike sequential integer IDs, random UUIDs in a public-facing URL don't let someone guess adjacent record IDs by incrementing a number.
How to Use This Calculator
- Select a UUID Version: Version 4 (random) or Version 1 (timestamp + node).
- Enter How Many UUIDs to generate (1–50, defaults to 1).
- Select Calculate to generate the UUID(s).
Related Calculations
Encode identifiers or payloads for text-safe transmission with the Base64 Encoder/Decoder, or convert timestamps tied to your records with the Unix Timestamp Converter.