What Is a UUID?
A UUID (Universally Unique Identifier) is a 128-bit number used to identify records without a central authority assigning IDs. Its familiar 8-4-4-4-12 hex format — like 550e8400-e29b-41d4-a716-446655440000 — is defined by RFC 4122 and appears in database primary keys, distributed systems, and API resources worldwide.
The One-Line Definition
A UUID is a 128-bit identifier represented as 32 lowercase hex digits in five hyphen-separated groups (8-4-4-4-12). The version digit (position 13) and variant bits (position 17) are embedded in the value itself.
UUID Format
A UUID looks like this:
550e8400-e29b-41d4-a716-446655440000
The 4 at position 13 is the version number (v4 = random). The a at position 17 (binary 10xx) encodes the RFC 4122 variant.
UUID Versions Compared
| Version | Basis | Sortable | Private | When to use |
|---|---|---|---|---|
| v1 | Time + MAC address | Yes | No — embeds MAC | When sortability matters and privacy is not a concern. Deprecated in many systems. |
| v3 | MD5 hash of namespace + name | No | Yes | Deterministic IDs from a name (e.g. always the same ID for the same URL). Avoid — MD5 is broken. |
| v4 | 122 bits of random data | No | Yes | General-purpose unique IDs. The most widely used version. Use this by default. |
| v5 | SHA-1 hash of namespace + name | No | Yes | Deterministic IDs from a name. Prefer over v3 (SHA-1 is stronger than MD5, though still deprecated for security). |
| v7 | Unix timestamp (ms) + random | Yes | Yes | Modern replacement for v1. Sortable, random, no MAC address. Best choice for database primary keys in new systems. |
UUID vs ULID
Generate a UUID Now
UUID Generator → generates v4 UUIDs using crypto.randomUUID() in your browser. No server involved.
Frequently Asked Questions
What is the difference between UUID v1 and UUID v4?
v1 encodes timestamp + MAC address (sortable but reveals host identity). v4 is 122 bits of random data — no embedded info. Use v4 for most purposes; v7 for new systems needing sortability.
What is the difference between a UUID and a ULID?
ULIDs encode a millisecond timestamp in the first 48 bits, making them lexicographically sortable. UUIDs (v4) are fully random and not sortable. ULIDs are better for database primary keys; UUIDs are more universally supported.
How do I generate a UUID online?
Use the UUID Generator on SmartDevBox. It uses the browser's crypto.randomUUID() API — no data is sent to a server.