UUID Generator
Generate universally unique identifiers in version 4 (random) and version 7 (timestamp-based). Copy with one click.
Reference
What is a UUID?
A UUID (Universally Unique Identifier) is a 128-bit identifier standardized by RFC 9562 (formerly RFC 4122). It is represented as a 36-character string in the format xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx, where each x is a hexadecimal digit. They are widely used as primary keys in databases, session identifiers, and correlation tokens in distributed systems.
UUID v4 vs UUID v7
UUID v4 (random) generates 122 random bits using crypto.randomUUID(). It is the most popular format: simple, no external dependencies, and with a practically zero collision probability. Use it when you don't need temporal ordering.
UUID v7 (timestamp-based) places a 48-bit Unix timestamp (milliseconds) in the first bytes, followed by random bits. Generated UUIDs are naturally chronologically sorted. They are ideal as primary keys in databases (PostgreSQL, MySQL) because they improve insertion locality in B-tree indexes and reduce page fragmentation.
UUID Format
All UUIDs follow the pattern 8-4-4-4-12 (32 hexadecimal digits separated by hyphens). The 13th digit indicates the version (4 or 7), and the first two bits of the 8th byte encode the variant (always 10 in standard UUIDs).
When to use each version?
- UUID v4 — Session IDs, temporary tokens, objects without required ordering.
- UUID v7 — Primary keys in databases, logs, events that need chronological ordering.
Privacy
This tool generates UUIDs 100% in your browser using the Web Crypto API. No data is sent to any server.