Glossary
Plain English
Cross-linked to tools

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?
Yes for use as an identifier. UUID v4 carries 122 bits of randomness from a CSPRNG — collision probability is negligible. It is not a secret token, though — any system observing a UUID can read it, so do not use UUIDs as authorization tokens.
What are the differences between UUID versions?
v1 is timestamp + MAC address (leaks identifying info). v3 is namespace + name hashed with MD5 (deterministic). v4 is fully random (the default for new systems). v5 is like v3 but with SHA-1. v6/v7/v8 are draft variants for time-ordered UUIDs.
Why use ULID instead of UUID?
ULID is lexicographically sortable because the first 48 bits encode a millisecond timestamp. For database primary keys this means rows inserted close in time stay close on disk, which dramatically improves B-tree write performance compared to random UUID v4.

Tools that work with UUID

UUID Generator

Generate cryptographically random UUIDs (v4) in bulk.

ULID Generator

Generate time-ordered, URL-safe ULIDs in bulk.

External references