What is uuid format

Last updated: April 1, 2026

Quick Answer: UUID format is a standardized 128-bit identifier represented as a 36-character hexadecimal string with hyphens in the pattern 8-4-4-4-12 digits, defined by RFC 4122 for universally unique identification.

Key Facts

UUID Format Specification

The UUID (Universally Unique Identifier) format is a standardized method for creating globally unique identifiers defined by RFC 4122. A UUID consists of 128 bits (16 bytes) of data, typically represented as a 36-character hexadecimal string. The standard format uses lowercase or uppercase letters (a-f or A-F) combined with digits (0-9), separated by four hyphens into five groups following the pattern: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.

UUID Structure and Components

The 36-character UUID format breaks down into five components:

UUID Versions and Variants

RFC 4122 defines five UUID versions, each with distinct generation methods and use cases. Version 1 uses timestamp and MAC address for uniqueness, providing sortability but potentially revealing system information. Version 3 generates UUIDs from MD5 hashes of namespaces and names, useful for deterministic generation. Version 4 creates random UUIDs, the most commonly used version in modern applications due to its simplicity and privacy. Version 5 uses SHA-1 hashing for better security than version 3. Version 6, a newer addition, improves upon version 1 with better sortability and privacy characteristics.

UUID Representation and Variants

While the hyphenated 36-character format is standard, UUIDs can be represented in multiple ways. The hex format removes hyphens (32 hexadecimal characters), the URN format adds the prefix "urn:uuid:", and some systems use binary format for storage optimization. The UUID specification includes a 2-bit variant field that indicates the UUID structure type, with the variant bits typically set to 10 in RFC 4122 compliant UUIDs.

UUID Format in Practice

Across programming languages and databases, UUID format remains consistent. A typical UUID looks like: 550e8400-e29b-41d4-a716-446655440000. Databases like PostgreSQL, MySQL, and others support native UUID data types that automatically handle validation and storage. APIs and web services commonly transmit UUIDs as JSON strings in this standard format. The format's simplicity and universality have made it the de facto standard for unique identification across distributed systems, microservices architectures, and modern application development.

Related Questions

What are UUID versions and which should I use?

UUID versions 1-5 use different generation methods. Version 4 (random) is most common in modern applications. Version 5 offers better security through SHA-1 hashing, while version 1 provides sortability but reveals system info.

Are two UUIDs ever the same?

With version 4 (random), collision probability is virtually zero in practical applications. With version 5 (deterministic), identical inputs always produce identical UUIDs, which is sometimes desirable.

Why are UUIDs better than sequential numbers for databases?

UUIDs eliminate the need for centralized ID generation, supporting distributed systems and database replication without coordination. They work seamlessly in microservices and multi-server environments.

Sources

  1. RFC 4122 - A Universally Unique Identifier (UUID) URN Namespace IETF
  2. Wikipedia - Universally Unique Identifier CC-BY-SA-3.0