UUID Generator – Generate UUID v4 & v7 Online
Generate secure UUID v4 and UUID v7 identifiers online. Create single or bulk UUIDs, customize formatting, validate UUIDs, inspect UUID structure, and download results as TXT, JSON, CSV, or SQL.
Executive Summary: Online UUID v4 & v7 Generator
Direct AnswerWhat is a UUID Generator? A UUID Generator is a developer utility that produces 128-bit Universally Unique Identifiers formatted into 32 hexadecimal digits and four hyphens (8-4-4-4-12). It supports both purely random UUID v4 (RFC 4122) and modern time-ordered UUID v7 (RFC 9562) with zero server latency or data tracking.
UUID Validator & Decoder Inspector
Validate UUID syntax, identify version and variant, extract embedded timestamps (for v7, v1, v6), and view segment structures.
| Field Name | Bit Range | Hex Value | Purpose & Description |
|---|---|---|---|
time_low / unix_ts_ms | 32 bits (0–31) | — | High 32 bits of Unix millisecond timestamp (v7) or low timestamp (v1) |
time_mid / ts_low | 16 bits (32–47) | — | Low 16 bits of Unix millisecond timestamp (v7) or middle timestamp (v1) |
time_hi_and_version | 16 bits (48–63) | — | 4-bit version indicator nibble followed by 12 random/sub-ms bits |
clock_seq_and_variant | 16 bits (64–79) | — | 2-bit variant indicator (10xx) and 14 random sequence bits |
node / rand_b | 48 bits (80–127) | — | Final 48 bits of cryptographic entropy (v4/v7) or MAC node ID (v1) |
Generate UUIDs in Modern Programming Languages
Code examples for UUID v4 (random) and UUID v7 (time-ordered) across popular backend frameworks.
// Native JavaScript / Node.js (Web Crypto API)
const uuidV4 = crypto.randomUUID(); // Native Version 4 UUID
console.log(uuidV4); // e.g. "550e8400-e29b-41d4-a716-446655440000"
// Using npm 'uuid' package for UUID v7 (RFC 9562)
// npm install uuid
import { v4 as uuidv4, v7 as uuidv7 } from 'uuid';
const randomId = uuidv4();
const timeOrderedId = uuidv7(); // Automatically ordered by timestampWhat is a UUID and How Does It Work?
Direct Answer: A UUID (Universally Unique Identifier)—standardized under IETF RFC 9562 and RFC 4122—is a 128-bit mathematical identifier designed to enable distributed computing systems to generate globally unique IDs without central database coordination.
A UUID is represented as 32 hexadecimal characters divided by four hyphens into five distinct groups: 8-4-4-4-12 (e.g. 550e8400-e29b-41d4-a716-446655440000). In this canonical representation, the 13th character specifies the UUID Version (e.g., 4 for random, 7 for time-ordered), and the 17th character indicates the RFC Variant (8, 9, a, or b).
UUID Versions Explained: Complete Comparison of v1, v2, v3, v4, v5, v6, v7, and v8
Direct Answer: Standardized across IETF RFC 9562 (which superseded RFC 4122 in 2024), UUIDs are divided into eight official numbered versions plus Nil and Max sentinels, each designed for specific architectural requirements:
| Version | Type / Mechanism | Timestamp | Sortable | Primary Use Case & Status |
|---|---|---|---|---|
| UUID v1 | Time + MAC node address | ✅ Yes | ❌ No | Legacy: 100ns Gregorian intervals + MAC address. Deprecated due to hardware privacy leakage. |
| UUID v2 | DCE Security (POSIX UID/GID) | ✅ Yes | ❌ No | Legacy: Embeds local POSIX user/group IDs. Rarely used due to 7-minute domain collision limits. |
| UUID v3 | MD5 namespace hash | ❌ No | ❌ No | Deterministic: MD5-based name hashing. Superseded by v5 due to cryptographic weaknesses in MD5. |
| UUID v4 | Cryptographic random (CSPRNG) | ❌ No | ❌ No | General Purpose: Universal standard for security tokens, session keys, and unpredictable entity IDs. |
| UUID v5 | SHA-1 namespace hash | ❌ No | ❌ No | Deterministic: Recommended standard for reproducible IDs generated from URLs, domain names, or strings. |
| UUID v6 | Reordered Gregorian time + random | ✅ Yes | ✅ Yes | Sortable Legacy: Reorders v1 timestamp fields into big-endian order for improved database B-Tree index locality. |
| UUID v7 | Unix milliseconds + random | ✅ Yes | ✅ Yes | Modern Systems: Recommended modern standard (RFC 9562) for database primary keys and event streaming. |
| UUID v8 | Custom / vendor payload | Depends | Depends | Custom Applications: Reserved for proprietary, experimental, or domain-specific 128-bit identifier layouts. |
| Nil / Max | All zeros (Nil) or all ones (Max) | ❌ No | — | Sentinel Limits: Used as unassigned default foreign keys (Nil) or theoretical maximum search limits (Max). |
v1 uses 100ns Gregorian intervals + MAC address, creating privacy concerns. v2 embeds POSIX UIDs for DCE security domains. Both are superseded in modern cloud architectures.
Deterministic name-based identifiers. Given the same namespace and string, they always output identical bytes. v5 (SHA-1) is strongly recommended over v3 (MD5).
Generates 122 cryptographically secure random bits. Ideal when total unpredictability and privacy are needed without revealing generation timestamps.
RFC 9562 standard. v6 reorders v1 fields; v7 utilizes 48-bit Unix epoch ms for optimal DB index clustering; v8 allows vendor-defined custom 128-bit payload structures.
UUID v4 vs. UUID v7: Which Should You Use?
Direct Answer: Use UUID v4 when complete randomness is required and you do not want to leak generation times (e.g. security tokens, password resets, public correlation IDs). Use UUID v7 for database primary keys and event logs where time-based sorting and B-Tree index performance are essential.
UUID v4 (Random)
- Pure Randomness: 122 bits of CSPRNG entropy.
- Privacy: Zero timestamp or sequence information exposed.
- Database Impact: Causes random page splits in B-Tree indices when used as auto-indexing primary keys.
UUID v7 (Time-Ordered)
- Chronological Sorting: Starts with Unix millisecond timestamp.
- Database Locality: Sequential inserts append cleanly to B-Tree leaf pages without fragmentation.
- Timestamp Extractable: Easily inspect creation time using our Unix Timestamp Converter.
UUID vs. GUID, ULID, Snowflake ID & NanoID
Direct Answer: While UUIDs and GUIDs are 128-bit hexadecimal identifiers, modern alternatives like ULID, Snowflake IDs, and NanoID offer different tradeoffs in length, base encoding, and URL friendliness:
| Identifier Type | Bit Size | String Length | Sortable | Encoding | Ideal Workflow |
|---|---|---|---|---|---|
| UUID v4 / GUID | 128 bits | 36 chars | No | Hexadecimal | Universal standard, public APIs, session tokens. |
| UUID v7 | 128 bits | 36 chars | Yes | Hexadecimal | Modern relational & NoSQL primary keys. |
| ULID | 128 bits | 26 chars | Yes | Crockford's Base32 | Compact, case-insensitive, URL-safe identifiers. |
| Snowflake ID | 64 bits | 19 chars | Yes | Decimal int64 | High-scale distributed systems (Twitter, Discord). |
| NanoID | Variable | 21 chars | No | Custom Base64 | Short, compact URL-safe keys in web applications. |
Using UUIDs as Database Primary Keys: PostgreSQL, MySQL & SQL Server
Direct Answer: When using UUIDs as primary keys, store them in native binary formats (such as PostgreSQL's UUID type or MySQL's BINARY(16)) rather than text strings (CHAR(36)) to cut storage overhead by 55% and improve index cache utilization.
Native 16-byte UUID data type with indexing support:
CREATE TABLE users (
id UUID PRIMARY KEY DEFAULT gen_random_uuid()
);Use BINARY(16) with UUID_TO_BIN() for compact storage:
CREATE TABLE users (
id BINARY(16) PRIMARY KEY,
name VARCHAR(100)
);Use native uniqueidentifier with sequential IDs:
CREATE TABLE Users (
Id UNIQUEIDENTIFIER DEFAULT NEWSEQUENTIALID() PRIMARY KEY
);100% Client-Side Privacy & Cryptographic Security
Direct Answer: OperateTools UUID Generator executes 100% inside your web browser's local sandbox using the W3C Web Cryptography API (crypto.getRandomValues). Your generated UUIDs, seed data, and decoded payloads are never sent to external servers or logged in any database.
Collision Probability Analysis: Version 4 provides 122 bits of random data (2122 or 5.3 × 1036 possible combinations), making accidental collisions extraordinarily unlikely when generated correctly. According to the Birthday Paradox, generating 1 billion UUIDs every second for approximately 85 continuous years yields roughly a 50% probability of a single duplicate.
Related Developer Utilities & Encoding Tools
Explore our connected suite of developer utilities for timestamp conversion, data formatting, encryption, and token handling.
Frequently Asked Questions
Answers to common questions about UUID v4 vs v7, generation standards, collision rates, and database primary keys.
What is the difference between UUID v4 and UUID v7?
Direct Answer:
UUID v4 is entirely pseudo-random (122 random bits), providing maximum entropy but resulting in random B-Tree index insertion in databases. UUID v7 (RFC 9562) begins with a 48-bit Unix millisecond timestamp followed by 74 random bits, creating time-ordered sortable identifiers that optimize database clustering, index locality, and write performance.
What is the difference between a UUID and a GUID?
Direct Answer:
UUID (Universally Unique Identifier) and GUID (Globally Unique Identifier) refer to the exact same 128-bit mathematical identifier standard (RFC 9562 / RFC 4122). "GUID" is the terminology historically established by Microsoft and the .NET ecosystem, while "UUID" is the universal Unix, Linux, and IETF standard terminology.
How can I extract the creation timestamp from a UUID v7?
Direct Answer:
In UUID v7, the first 48 bits (the first 12 hexadecimal characters, spanning the first 8-character and 4-character blocks) store a big-endian Unix epoch timestamp in milliseconds. By taking these 12 hex digits and converting them to a decimal integer, you obtain the exact Unix timestamp in milliseconds when the UUID was generated.
Are UUIDs generated on this website secure and private?
Direct Answer:
Yes, 100%. All UUIDs are generated directly inside your web browser using the native Web Cryptography API (crypto.getRandomValues and crypto.randomUUID). No generated UUIDs, IP addresses, or payloads are ever sent to or stored on any server.
What are the chances of a UUID v4 collision?
Direct Answer:
The collision probability of UUID v4 is extraordinarily low. Version 4 provides 122 bits of random data (2^122 or 5.3 x 10^36 possible combinations), making accidental collisions extraordinarily unlikely when generated correctly. You would need to generate 1 billion UUIDs per second for approximately 85 years to reach a 50% probability of generating a single duplicate.
What are Nil and Max UUIDs?
Direct Answer:
A Nil UUID (00000000-0000-0000-0000-000000000000) is a special-case UUID with all 128 bits set to zero, commonly used as a default placeholder or unassigned foreign key. A Max UUID (ffffffff-ffff-ffff-ffff-ffffffffffff) has all 128 bits set to one, defined in RFC 9562 as the theoretical maximum identifier.