UUID Generator
Generate cryptographically secure RFC 9562 UUIDs (v1, v4, v6, and time-ordered v7) individually or in batches up to 10,000, with instant validation, custom formatting, and language snippets.
Generate 1 UUID v4Ready locally via WebAssembly & JavaScript
123e4567-e89b-12d3-a456-426614174000100% Client-Side • Zero Server Upload
Distributed systems cannot rely on a single database sequence without introducing a coordination bottleneck, and exposing sequential integers (/orders/4019) leaks business volume while inviting Insecure Direct Object Reference (IDOR) scraping. Universally Unique Identifiers (UUIDs)—called GUIDs in Microsoft .NET and Win32 ecosystems—solve both problems by packing globally collision-resistant identity into a fixed 128-bit structure standardized under IETF RFC 9562 (which obsoleted RFC 4122 in May 2024). This workspace generates, formats, and validates v1, v4, v6, and v7 UUIDs locally inside your browser using native Web Crypto entropy, keeping production identifiers private and off the wire.
Canonical 128-Bit Layout and Variant Encoding
Every canonical UUID prints as 32 hexadecimal nibbles separated into five hyphenated groups (8-4-4-4-12, 36 ASCII characters total):
xxxxxxxx-xxxx-Mxxx-Nxxx-xxxxxxxxxxxx
^ ^
| └── Variant nibble: 8, 9, a, or b (binary 10xx = RFC 9562)
└─────── Version nibble: 1, 4, 6, or 7
Six bits are reserved as structural metadata across standard RFC versions: the 4-bit ver field at octet 6 high nibble, and the 2-bit var field (10 in binary) at octet 8 high bits. That leaves 122 variable bits whose internal allocation differs sharply between versions.
| UUID Version | Time Representation | Random / Node Bits | Lexicographically Sortable | Privacy / MAC Exposure | Primary Engineering Fit |
|---|---|---|---|---|---|
| UUID v1 | 60-bit 100ns ticks since 1582-10-15 (low bits first) | 14-bit clock_seq + 48-bit MAC/node | No (time fields split) | High if real MAC used | Legacy distributed systems and audit compatibility |
| UUID v4 | None | 122 CSPRNG random bits | No (uniformly scattered) | None | Public API URLs, correlation IDs, opaque tokens |
| UUID v6 | 60-bit Gregorian 100ns ticks (big-endian reordered) | 14-bit clock_seq + 48-bit node | Yes | Moderate (use random node) | Drop-in sortable migration path from legacy v1 |
| UUID v7 | 48-bit big-endian Unix Epoch milliseconds (1970-01-01) | 12-bit rand_a (or counter) + 62-bit rand_b | Yes (native chronological) | None (timestamp only) | Modern relational/NoSQL primary keys, event logs |
Why UUID v7 Fixes B-Tree Index Fragmentation
In relational storage engines such as PostgreSQL heap/B-Tree indexes and MySQL InnoDB clustered primary keys, key ordering dictates physical disk I/O. Inserting millions of random UUID v4 primary keys forces the database to locate and mutate seemingly random leaf pages across the entire index tree:
- Page Splits & Write Amplification: Half-filled B-Tree pages split continuously, inflating index size by 30%–50% and doubling PostgreSQL Write-Ahead Log (WAL) full-page image writes.
- Buffer-Pool Thrashing: Because active writes hit cold pages scattered across gigabytes of index data rather than only the rightmost leaf page, cache hit ratios plummet once the index outgrows RAM.
UUID v7 resolves this cleanly. Its top 48 bits encode Unix epoch milliseconds in big-endian byte order (valid through the year 10889 AD), followed by 74 random or monotonic counter bits. Consecutive records append cleanly to the trailing edge of the B-Tree—delivering insert throughput close to 64-bit BIGINT sequences while remaining stateless and globally unique across multi-region writers. Keep one security nuance in mind: because v7 reveals record creation time down to the millisecond, prefer UUID v4 for security-sensitive bearer identifiers or URLs where creation timestamps must stay hidden.
Birthday-Paradox Collision Math
Collision probability for uniformly random -bit identifiers follows the birthday approximation:
For UUID v4 (, ), generating (one trillion) identifiers produces a collision probability below . Reaching a 50% collision chance requires IDs—equivalent to minting 1 billion UUIDs every second for more than 85 years. For UUID v7, the 74 random bits per millisecond yield distinct states inside every single millisecond window, and RFC 9562 §6.2 permits using the 12-bit rand_a field as a monotonic counter for deterministic same-millisecond ordering.
Database Storage, Validation Regex, and Endianness Gotchas
Never store UUIDs as VARCHAR(36) in production tables; binary storage halves memory footprint and accelerates index comparisons dramatically:
-- PostgreSQL: native 16-byte uuid type (v4 built-in; v7 native in PG 18 / extensions)
CREATE TABLE events (
id UUID PRIMARY KEY,
payload JSONB NOT NULL
);
-- MySQL 8: compact 16-byte storage (pass swap_flag=1 only for v1, NOT v7)
CREATE TABLE events (
id BINARY(16) PRIMARY KEY,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
INSERT INTO events (id) VALUES (UUID_TO_BIN('019345a2-8c1d-7f2e-9a41-3b7e2f8c1d09', 0));
Watch out for two subtle cross-platform pitfalls:
- MySQL
UUID_TO_BIN(uuid, 1)trap: The second argument1rearranges UUID v1 time octets for sorting. Never pass1for UUID v7, which is already big-endian sorted—doing so scrambles its timestamp prefix! - Microsoft
.NETGUID Byte Order:Guid.ToByteArray()in C# encodes the first three groups (Data1,Data2,Data3) in little-endian order while leaving the final two groups big-endian. When exchanging raw 16-byte blobs between C# and PostgreSQL or Go, useGuid.ToByteArray(bigEndian: true)(.NET 8+) or serialize via canonical strings.
For strict RFC 9562 input validation (matching versions 1, 4, 6, or 7 and variant 8/9/a/b), use:
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1467][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$
Handling Nil, Max, and Clock-Drift Edge Cases
RFC 9562 also reserves two sentinel values that developers should recognize in schema migrations and boundary tests: the Nil UUID (00000000-0000-0000-0000-000000000000), commonly used to represent an unset foreign key without nullable columns, and the Max UUID (ffffffff-ffff-ffff-ffff-ffffffffffff), useful as an exclusive upper range bound in partitioned B-Tree queries. When deploying UUID v7 across fleet nodes synchronized via NTP, ensure your library implements RFC 9562 monotonic counter handling so backward clock adjustments or burst writes within the same millisecond never invert sort order or collide across threads.
Pairing UUIDs Across Your Development Pipeline
After exporting a bulk JSON array of up to 10,000 IDs, you can pretty-print or merge them into larger API payloads with our JSON Formatter or build realistic multi-field test fixtures in the API Mock Data Generator. If your schema requires URL-compact NanoID-style keys shorter than 36 characters or custom prefix patterns like usr_..., switch to the Random String Generator.
How to Use UUID Generator
Choose your target specification on the Generator tab: v4 for pure unpredictability, v7 for chronological database indexing, or v1/v6 for legacy time-based pipelines.
Pick a single ID or configure a bulk count up to 10,000 identifiers using the quick presets or custom numeric input.
Toggle formatting modifiers as needed—Uppercase, Remove Hyphens, Add Braces, or Add Quotes—to match your target language or SQL syntax.
Click Generate to mint fresh identifiers locally, then copy individual rows or download the full batch as TXT, CSV, or JSON.
Switch to the Validator tab to verify external UUID strings, or open Developer Snippets to copy native library code for your backend stack.
Real Examples
Standard UUID v4
The default format for a randomly generated UUID v4.
Generate 1 UUID v4123e4567-e89b-12d3-a456-426614174000No Hyphens (Uppercase)
UUID formatted without hyphens and converted to uppercase.
Generate UUID (No Hyphens, Uppercase)123E4567E89B12D3A456426614174000JSON Array Format
Generating a bulk list of UUIDs formatted as a JSON array.
Generate 3 UUIDs -> Copy as JSON Array[
"550e8400-e29b-41d4-a716-446655440000",
"6ba7b810-9dad-11d1-80b4-00c04fd430c8",
"6ba7b811-9dad-11d1-80b4-00c04fd430c8"
]Frequently Asked Questions
Why does UUID v7 outperform UUID v4 as a PostgreSQL or MySQL primary key?
What changed when RFC 9562 replaced the older RFC 4122 UUID specification?
How should I store UUIDs in SQL databases to save disk space and RAM?
Does the built-in UUID Validator accept uppercase, braced, or hyphenless GUIDs?
How likely is a UUID v4 or v7 collision in a high-throughput distributed system?
Key Features
- Full RFC 9562 generation across four versions: v1 (Gregorian/MAC), v4 (CSPRNG random), v6 (reordered time), and v7 (Unix epoch time-sorted)
- High-speed bulk batch engine producing up to 10,000 formatted UUIDs in a single client-side pass
- Granular string formatters for uppercase hex, hyphen removal (32-char compact), Microsoft {braces}, and double-quote wrapping
- Dedicated Validator tab that normalizes wrapped or unhyphenated strings and checks RFC structural validity
- Copy-ready Developer Snippets tab covering JavaScript/TypeScript, Node.js, Python, Java, C#/.NET, and PostgreSQL
- One-click clipboard export and file downloads in TXT, JSON array, and CSV formats with local 10-batch session history
Common Use Cases
- Designing high-throughput PostgreSQL, MySQL, or CockroachDB schemas with B-Tree-friendly UUID v7 primary keys
- Generating unguessable UUID v4 resource identifiers to eliminate sequential IDOR enumeration vulnerabilities in REST APIs
- Seeding staging tables, integration fixtures, and load-test payloads with up to 10,000 bulk unique IDs
- Creating Microsoft .NET, COM, or SQL Server braced uppercase GUID literals for registry and config migrations
- Assigning distributed trace and correlation IDs across microservices, message queues, and offline-first mobile clients
- Validating incoming third-party webhook identifiers and legacy database keys for RFC compliance
Related Tools
Explore More Tools in This Category
View All Developer & Utility ToolsSEO Slug Generator
Transform headlines, product titles, and international strings into RFC 3986 URL-safe slugs with multi-language Unicode transliteration, bulk conversion, SEO length scoring, and framework code snippets.
Lorem Ipsum & Dummy Text Generator
Generate classic Ciceronian Lorem Ipsum or six domain-themed vocabularies by exact words, sentences, paragraphs, or characters—formatted as plain text, semantic HTML, or Markdown.
Fake User Data Generator
Generate deterministic, privacy-safe synthetic user records localized across 8 regions for database seeding, UI layout testing, and API fixtures. Export directly to JSON, CSV, PostgreSQL, MySQL, XML, and YAML.
Random Number Generator Tool & Simulator
Generate Web Crypto random integers, fixed-precision decimals, polyhedral RPG dice rolls, numeric OTP tokens, and custom list picks with live descriptive statistics and JSON/CSV export.
API Mock Data Generator
Design nested JSON API schemas with 40+ semantic field types, simulate REST latency and HTTP error codes, and export payloads alongside TypeScript, Zod, GraphQL, and JSON Schema contracts.
HTML Table Generator
Visually design, style, and export accessible, responsive HTML tables right in your browser. Import CSV, TSV, or JSON data, merge cells, test desktop-to-mobile viewports, and compile clean HTML, Tailwind CSS, React JSX, Bootstrap, or Markdown.
Username Generator
Create platform-validated, memorable handles for gaming, social media, software engineering, and brand accounts with leetspeak mutations, heuristic scoring, and TXT, CSV, or JSON bulk exports.
Random String Generator
Generate cryptographically secure API keys, session tokens, JWT signing secrets, compact database IDs, and pattern-masked coupon codes in bulk up to 5,000 deduplicated strings offline.