UUID
Also known as: Universally Unique Identifier, GUID, RFC 4122 UUID
A UUID (Universally Unique Identifier) is a 128-bit value, usually written as 32 hex digits in the canonical 8-4-4-4-12 grouping (e.g. '550e8400-e29b-41d4-a716-446655440000'), used as a globally unique ID that any computer can generate without coordination.
Overview
UUIDs are defined in RFC 4122. Version 4 — fully random — is the version most code generates today, sourced from a cryptographically secure random number generator. With 122 bits of entropy, the probability of two version-4 UUIDs colliding is negligible at any realistic scale: generating a billion UUIDs per second for a hundred years gives roughly a 50% chance of one collision.
UUIDs solve the distributed-ID problem (any service can mint one without coordinating with a registry) at the cost of being large (128 bits, 36 ASCII chars with hyphens) and non-sortable (random UUIDs are scattered across an index, hurting B-tree insertion performance). ULIDs solve the sortability problem while preserving the no-coordination property.
Common questions about UUID
Is UUID v4 secure enough for production?
What are the differences between UUID versions?
Why use ULID instead of UUID?
Tools that work with UUID
Related concepts
ULID
A ULID (Universally Unique Lexicographically Sortable Identifier) is a 128-bit identifier encoded as 26 Crockford base32 characters that is sorted by time when generated, making it a drop-in replacement for UUID v4 with much better database insert performance.
Cryptographic Hash
A cryptographic hash function takes any input and produces a fixed-length pseudo-random output (the 'digest') that uniquely identifies the input — and is computationally infeasible to reverse, making hashes the foundation of integrity checks, content addressing, and password storage.