What is a UUID?
A UUID (Universally Unique Identifier) is a 128-bit value used to identify information in computer systems without requiring a central authority. Defined by RFC 4122, UUIDs are represented as 32 hexadecimal digits grouped into five sections separated by hyphens: 550e8400-e29b-41d4-a716-446655440000.
The most common variant — UUID v4, which this tool generates — uses cryptographically random data for all but 6 of its 128 bits (those 6 bits identify the version and variant). With 2122 possible values, the probability of generating two identical v4 UUIDs is astronomically small, making them safe for use without any coordination between systems.
UUIDs are widely used as database primary keys, API request identifiers, session tokens, distributed system node IDs, message queue deduplication keys, and file or resource identifiers in cloud storage systems.
UUID versions explained
Version 1 combines a timestamp with the machine's MAC address. It guarantees uniqueness but leaks information about when and where it was generated. Rarely used in modern applications due to privacy concerns.
Version 3 generates a deterministic UUID by hashing a namespace and name with MD5. Given the same inputs, it always produces the same UUID. Useful for generating consistent IDs from known data.
Version 4 is the most widely used. It fills 122 bits with cryptographically random data, making each UUID unpredictable and unique. This is what crypto.randomUUID() generates and what this tool produces.
Version 5 is identical to v3 but uses SHA-1 instead of MD5. Preferred over v3 when you need deterministic UUIDs.
Version 7 (RFC 9562) is the newest addition and is gaining rapid adoption. It embeds a Unix timestamp in the first 48 bits, making UUIDs roughly time-ordered. This solves v4's biggest weakness as a database primary key: random UUIDs fragment B-tree indexes, while v7 UUIDs insert in approximate order, maintaining good index performance.
UUIDs vs other ID formats
Auto-increment integers are the simplest option — small, fast to index, and human-readable. But they expose ordering (ID 1000 was created before ID 1001), require a single source of truth, and leak information about your data volume.
ULIDs (Universally Unique Lexicographically Sortable Identifiers) embed a timestamp like UUID v7 but encode in Crockford Base32, producing shorter, sortable strings like 01ARZ3NDEKTSV4RRFFQ69G5FAV.
Nanoids are shorter random IDs with a customisable alphabet. A 21-character nanoid has similar collision resistance to a UUID but takes fewer bytes. Popular in URLs and frontend applications.
Snowflake IDs (used by Twitter/Discord) combine a timestamp, machine ID, and sequence number into a 64-bit integer. They're sortable, compact, and designed for high-throughput distributed systems, but require infrastructure to assign machine IDs.