How it works
The UUID v4 Generator creates version 4 UUIDs — randomly generated 128-bit universally unique identifiers in the standard 8-4-4-4-12 hexadecimal format: xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx.
UUIDs (Universally Unique Identifiers, also called GUIDs — Globally Unique Identifiers) are used wherever a unique identifier is needed without coordination between systems. Primary keys in distributed databases, session IDs, API resource IDs, file names for uploaded content, idempotency keys for payment requests, and correlation IDs for distributed tracing all commonly use UUIDs.
How to use it: click Generate to create one UUID, or set a quantity to generate up to 1,000 at once. Output formats: standard hyphenated (8-4-4-4-12), no hyphens (32 hex characters), uppercase, and URN format (urn:uuid:...). Batch output can be downloaded as a text file.
Cryptographic randomness: v4 UUIDs use random bytes for all bits except the version (4) and variant bits. This tool uses window.crypto.getRandomValues() for cryptographically secure randomness — the same source used by your browser for TLS. The collision probability for two UUIDs from this source is astronomically small (approximately 1 in 5.3 × 10^36).
UUID v4 vs other versions: v1 uses MAC address + timestamp (privacy risk, predictable), v3/v5 are name-based (deterministic, not random), v4 is fully random (best for most use cases), v7 uses timestamp prefix for sortability (newer standard, useful for database index performance).
Frequently Asked Questions
- UUID v4 has 122 bits of randomness (the remaining 6 bits are version and variant). The probability of two UUIDs colliding is approximately 1 in 5.3 × 10^36 — effectively zero for any practical application. You would need to generate 1 billion UUIDs per second for 86 years to reach a 50% probability of a single collision.
- 8-4-4-4-12 hexadecimal characters separated by hyphens: xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx. The 4 in position 13 is the version. The y in position 17 is the variant bits (8, 9, a, or b — indicating RFC 4122 variant).
- Yes, but with a caveat: random UUIDs cause index fragmentation in B-tree indexes because inserts are randomly distributed rather than sequential. For high-insert-rate tables, UUID v7 (timestamp-prefix) or ULID are better choices as they maintain insertion order.
- They refer to the same thing: a 128-bit unique identifier formatted as 8-4-4-4-12 hex. GUID (Globally Unique Identifier) is Microsoft's term; UUID (Universally Unique Identifier) is the RFC 4122 standard term. They are interchangeable in practice.