What is a UUID (Universally Unique Identifier)?
A UUID (Universally Unique Identifier) is a 128-bit (16-byte) identifier standardized by RFC 4122 and updated by RFC 9562 in 2024. UUIDs provide statistical uniqueness across distributed computing environments without relying on a central database coordinator or auto-incrementing serial sequences.
In canonical text form, a UUID is represented as a 36-character hexadecimal string: xxxxxxxx-xxxx-Mxxx-Nxxx-xxxxxxxxxxxx where M indicates the version and N indicates the variant.
Understanding UUID Versions: v4 vs v7 vs v1
UUID Version 4 (Pure Random)
UUID v4 is the most widely used format. It uses 122 bits of cryptographically secure random data generated via the browser's native crypto.randomUUID() API. The collision probability is approximately 1 in 5.3 x 1036 unique identifiers.
- Collision Probability: Generating 1 billion UUIDs per second for 85 years yields a 50% chance of one collision.
- Use Cases: Session tokens, API keys, file upload identifiers, transient request tracking.
UUID Version 7 (Time-Ordered Modern Standard - RFC 9562)
UUID v7 embeds a 48-bit Unix epoch millisecond timestamp into the most significant bits (MSB), followed by 62 random bits. This makes UUID v7 values chronologically sortable, ideal for database primary keys.
- Database B-Tree Locality: UUID v7 values increase monotonically with time, preventing expensive random disk I/O page splits in PostgreSQL, MySQL (InnoDB), and SQLite B-tree indexes.
- Use Cases: Primary key columns, distributed event logs, transactional order IDs.
UUID Version 1 (Timestamp + Node)
UUID v1 uses a 60-bit timestamp measured in 100-nanosecond intervals since October 15, 1582 (Gregorian epoch), combined with a clock sequence and a 48-bit node identifier. While it provides temporal ordering, the timestamp is split across non-contiguous bit positions, making it less suitable for database indexing than UUID v7.
Minecraft Player UUIDs (Offline Mode MD5)
Minecraft offline mode servers generate player UUIDs using an MD5 hash of "OfflinePlayer:" + username formatted as a Version 3 UUID. Our tool implements this exact algorithm for server administrators, modders, and plugin developers.
UUID vs GUID: Is There Any Difference?
GUID (Globally Unique Identifier) is Microsoft's implementation of the UUID standard. Every valid GUID is a UUID. GUIDs are conventionally displayed in uppercase with curly braces: {C02A8400-E29B-41D4-A716-446655440000}.
Comparison Matrix of Identifier Formats
| Format | Length | Sortable? | Basis | Best Use |
|---|---|---|---|---|
| UUID v4 | 36 chars | No | 122-bit Random | API Keys, Tokens |
| UUID v7 | 36 chars | Yes | Time + Random | Database PKs |
| ULID | 26 chars | Yes | Crockford Base32 | Short Sortable IDs |
| NanoID | 21 chars | No | URL-Safe Random | Short Public URLs |