Skip to main content

Free UUID Generator

Generate cryptographically secure UUID v4 (GUID) values instantly. Create single or multiple identifiers for databases, APIs, and systems.

Settings

Generate up to 100 UUIDs at once.

Format Options
Uppercase Mode
Remove Hyphens
Generated Output
UUID Version 4 (Random)
Count: 0 Time: -

Advertisement

Distributed Systems & Cryptography RFC 4122 / 9562 Version 4

UUID v4 Architecture: CSPRNG Entropy, Database Indexing, and GUID Byte Order

Auto incrementing integer primary keys work smoothly inside a single database node until microservices scale horizontally, offline mobile clients mint records prior to syncing, or public URLs start exposing total customer volume through sequential IDs. Universally Unique Identifiers solve decentralized key creation by giving every process 122 bits of local cryptographic randomness. Still, picking UUID Version 4 without understanding B tree page splits, storage sizing, or Microsoft GUID byte order creates real production surprises later.

1. Inside the 128 Bit Layout of a Version 4 UUID

Even though a standard hyphenated string displays 32 hexadecimal digits in an 8-4-4-4-12 pattern (totaling 36 characters with four dashes, or 32 compact hex digits when Remove Hyphens is enabled), not all 128 bits vary freely. RFC 4122 and the updated RFC 9562 specification reserve six structural metadata bits so parsers identify how the ID was created without extra database columns.

Look closely at any output above: the thirteenth hex digit (the start of the third group) is always 4, encoding Version 4 random generation. Immediately after, the seventeenth hex digit (the start of the fourth group) always takes one of four characters: 8, 9, a, or b, because its two most significant bits lock to binary 10 for the standard RFC variant. That leaves 122 random bits (2122, roughly 5.3 undecillion distinct values). To hit even a 50% birthday paradox collision probability, a cluster would need to mint 1 billion UUIDs every second continuously for approximately 85 years.

Crucially, generation quality depends entirely on the underlying randomness source. This generator calls the browser's hardware seeded crypto.randomUUID() API directly (falling back to crypto.getRandomValues() on secure contexts lacking randomUUID), avoiding predictable pseudo random generators such as Math.random(). Look at how the three output toggles change formatting across the same 128 bit structure:

Standard (36 chars): f47ac10b-58cc-4372-a567-0e02b2c3d479
Remove Hyphens (32): f47ac10b58cc4372a5670e02b2c3d479
Uppercase + Compact: F47AC10B58CC4372A5670E02B2C3D479

2. Comparing UUID Versions Across Modern Backends

Version Generation Source Practical Tradeoff
UUID v4 (Generated Here) 122 CSPRNG random bits Zero timestamp or hardware leak; random write scatter in huge B tree indexes
UUID v1 Gregorian timestamp + host MAC address Exposes creation timestamp and network card hardware identity publicly
UUID v5 (and legacy v3) Deterministic SHA-1 (or MD5) over namespace + name Identical inputs reproduce identical IDs without querying a central coordinator
UUID v7 (RFC 9562) 48 bit Unix ms timestamp + 74 random bits Chronological sorting prevents index fragmentation on high write SQL tables

3. SQL Storage Footprint, Index Locality, and String Costs

One common database schema mistake is storing UUIDs inside VARCHAR(36) or CHAR(36) text columns with UTF-8 collation rules. Doing so inflates every primary key and every foreign key index pointer to 36+ bytes instead of 16 native binary bytes, nearly tripling RAM pressure on composite secondary indexes.

Use native 16 byte storage whenever your database supports it: PostgreSQL provides a dedicated uuid data type that stores 16 compact bytes while displaying and accepting standard hyphenated strings automatically. On MySQL 8, either toggle Remove Hyphens to insert raw 32 character hex strings via UNHEX() into BINARY(16), or use UUID_TO_BIN(val, 1) to swap time high bits when working with time ordered identifiers. For tables growing past tens of millions of hot concurrent writes, keep in mind that completely random v4 keys insert into random index leaf pages once the working index outgrows memory cache, triggering extra disk page splits compared to monotonic v7 keys or bigint surrogates.

4. Distributed Offline Sync & Microsoft GUID Byte Order

Because Version 4 minting requires zero shared sequence locks or central database queries, browser sessions, edge workers, and offline mobile clients can preassign primary keys prior to syncing over spotty networks without overwriting records created by concurrent replicas. Unlike sequential IDs, opaque random keys also prevent curious visitors from scraping consecutive API endpoints (such as iterating /orders/1001, /orders/1002) or calculating exact daily signup volume from public invoice links.

Developers frequently treat UUID and Microsoft GUID as identical terms, which holds completely true when exchanged as canonical text strings (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx). However, serializing raw 16 byte binary buffers across mixed stacks hides a notorious byte order snag. Standard PostgreSQL, Linux libuuid, and Python store all 16 bytes sequentially in big endian network byte order. By contrast, Microsoft's Guid.ToByteArray() and SQL Server uniqueidentifier flip the first three groups (4 bytes, 2 bytes, 2 bytes) into little endian layout while leaving the trailing 8 bytes big endian. Always exchange UUIDs across HTTP APIs, Kafka messages, and ETL exports as canonical hex strings rather than unannotated binary blobs.

Advertisement

5. Batch Controls, Validation Regex, and Security Limits

Slide or type any batch size between 1 and 100 to mint database seed fixtures, Stripe style API idempotency keys, OpenTelemetry trace IDs (often formatted without hyphens as 32 lowercase hex digits), or HTTP request correlation headers. Note that toggling Uppercase Mode or Remove Hyphens immediately generates a fresh batch matching your selected output formatting, so click Copy All or Save TXT first whenever you want to preserve an active batch before switching formatting toggles.

When validating incoming UUID parameters in REST routes before running SQL queries (since querying an unvalidated garbage string against a PostgreSQL uuid column throws a database cast error), enforce a strict case insensitive RFC pattern: allow exact 8-4-4-4-12 groups, verify nibble 4 at the version offset, and permit 8, 9, a, or b at the variant nibble. Remember also to normalize external Windows uppercase strings to lowercase before running JavaScript string equality checks or cache key lookups, because F47AC10B... and f47ac10b... represent identical binary bytes yet fail strict string comparison in Redis or JS maps.

Finally, distinguish unique identifiers from authentication secrets: while 122 bits generated by Web Crypto are practically unguessable for resource URLs, password resets or bearer API secrets generally allocate 256 pure entropy bits without fixed RFC version nibbles. Everything on this page runs strictly inside local browser memory with zero telemetry or server logging of generated keys.