UUID / GUID Generator (Version 4)

Generate cryptographically secure RFC 4122 v4 UUIDs individually or in bulk. Free, instant, and private.

c2ca73ed-3938-47e9-95c1-ed2c7cb09988
02bf36a7-03d8-49b0-bc45-9d39e54dab3e
74b816f0-f144-4aa2-982f-43165e6f97ec
94a8809e-0115-4b0c-93c4-794688aefb6c
98cdcdb1-b1c4-4354-a5bf-581892ff633d
Database Systems & Cloud Backend Services
Abbolo Insight: Modern web utilities can be safely executed in-browser without sending sensitive payload data to external servers.

Technical Anatomy of RFC 4122 Version 4 UUIDs

A Universally Unique Identifier (UUID)—also known as a Globally Unique Identifier (GUID) in Microsoft software ecosystems—is a 128-bit value standardized under RFC 4122 (and updated under RFC 9562). Its primary engineering purpose is to enable distributed systems to generate unique identifiers autonomously, eliminating the requirement for a central coordinating database authority.

Structure and Bit-Level Representation

A standard textual UUID is formatted as 32 hexadecimal characters grouped into five segments separated by four hyphens:

xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx

While many assume that a Version 4 UUID is entirely random, the specification mandates fixed bits for versioning and variant conformance:

  • Total Bit Length: 128 bits (16 bytes).
  • Version Digits (4xxx): The 13th hexadecimal character is fixed to 4, signifying that this identifier was produced using Version 4 pseudo-random generation rules.
  • Variant Bits (yxxx): The 17th character is constrained by the two most significant variant bits (10xx₂). Consequently, the character y in a compliant RFC 4122 UUID must always be one of four hexadecimal characters: 8, 9, a, or b.
  • Random Entropy Space: Because 4 bits are reserved for the version and 2 bits for the variant, exactly 122 bits are generated from cryptographically secure pseudo-random entropy (2¹²² ≈ 5.3169 × 10³⁶ possible values).

Collision Probability & the Birthday Paradox

With 122 bits of entropy, the probability of accidental collisions in production environments is practically negligible. However, claiming that collisions are “mathematically impossible” is factually inaccurate.

Under the mathematical principles of the birthday paradox, the number of generated values required before reaching a given collision probability follows the approximation:

n ≈ √(2 × 2¹²² × ln(1 / (1 - p)))

For a 50% probability (p = 0.5) of encountering a single collision across a generated set, an application would need to generate approximately 2.71 × 10¹⁸ (2.71 quintillion) UUIDs. Even if a globally distributed system generated 1 billion UUIDs per second, it would take roughly 85 years of continuous generation to reach that 50% probability threshold.

UUIDs vs. Auto-Incrementing Numeric IDs

Selecting the optimal primary key format requires balancing indexing efficiency with architectural flexibility:

Architectural MetricVersion 4 UUID (Random 128-Bit)Sequential Integer (BIGINT 64-Bit)
Generation AuthorityDecentralized (generated client-side, in lambdas, or offline)Centralized (requires database sequence lock)
Enumeration SecurityNon-guessable; protects business metrics from ID scrapingPredictable (e.g., /order/1001 reveals volume)
Storage Overhead16 bytes binary (36 bytes formatted string)8 bytes binary
Index Write LocalityHigh B-tree fragmentation due to scattered random insertsSequential append; high cache locality and fast page packing
Multi-Region MergingSeamless database replication with zero collision riskRequires complex offset sharding or multi-master coordination

Identifier Privacy & Security Considerations

A crucial security distinction must be observed: UUIDs are unique identifiers, not secret credentials.

Because UUIDs frequently appear in public URL parameters, client-side DOM elements, analytics reports, and network headers, possessing a UUID should never be treated as authorization to access protected resources. Cryptographically random tokens intended for authentication (such as session cookies, reset tokens, or API secrets) require dedicated cryptographic secret generators, secure transmission, and constant-time comparison.

Explore Related Developer & Cryptography Tools

Enhance your distributed system development and data encoding with our companion tools in the Developer Tools Hub:

Frequently Asked Questions

A version 4 UUID allocates 122 bits to random entropy (with 4 bits dedicated to version specification and 2 bits to variant classification). This yields 2^122 (approximately 5.3169 × 10^36) potential combinations. While mathematical collision is not absolutely impossible, accidental collisions are practically negligible: according to birthday paradox calculations, generating 1 billion UUIDs per second continuously for 85 years would yield only a 50% probability of a single duplicate.