UUID v4 — randomly generated using a cryptographically secure random number generator. The most common UUID version. 122 bits of randomness.
UUID versions explained
v4 — Random
Uses cryptographic randomness. The most widely used version. Format: xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx. No sequential ordering.
v1 — Time-based
Combines the current timestamp with the MAC address. Sortable by creation time, but exposes device identity. Avoid in security-sensitive contexts.
v5 — Name-based
Deterministic — the same namespace + name always produces the same UUID. Uses SHA-1. Useful for generating stable IDs from domain names or URLs.
ULID — Sortable
26-character Base32 string. Lexicographically sortable by time. URL-safe and case-insensitive. Good alternative to UUID v4 when sort order matters.
Frequently Asked Questions
What is a UUID?+
A UUID (Universally Unique Identifier) is a 128-bit label formatted as 32 hexadecimal digits in the pattern 8-4-4-4-12, like
550e8400-e29b-41d4-a716-446655440000. It is used to uniquely identify objects in software systems without central coordination.Are UUID v4s truly unique?+
For all practical purposes, yes. UUID v4 has 122 bits of randomness, giving about 5.3×10³⁶ possible values. The probability of generating two identical UUIDs even after generating a billion per second for a year is effectively zero.
What is ULID and when should I use it?+
ULID (Universally Unique Lexicographically Sortable Identifier) encodes a millisecond timestamp in the first 10 characters and 80 bits of randomness in the rest. Use it when you need sortable unique IDs — for example, as database primary keys where chronological ordering matters.
What is UUID v5 used for?+
UUID v5 generates a deterministic UUID from a namespace and a name using SHA-1. It always produces the same UUID for the same inputs, making it useful for generating stable, reproducible IDs from known data like domain names, URLs, or email addresses.
What is the difference between UUID and GUID?+
GUID (Globally Unique Identifier) is Microsoft's implementation of the UUID standard. They are functionally identical — the terms are used interchangeably in most contexts.
Related Tools