JSON Formatter & Validator
Free online JSON formatter, validator, and minifier: beautify messy JSON, fix errors, and minify code instantly. 100% private in-browser with zero uploads.
Free online UUID and GUID generator: generate random RFC 4122 version 4 UUIDs instantly in bulk or single. 100% private in-browser with zero tracking.
In modern computing, distributed systems require a robust method to generate unique identifiers across independent database nodes, microservices, mobile clients, and cloud instances without central lock synchronization or single points of failure. The solution standardized across the software engineering industry is the Universally Unique Identifier (UUID), formalized by the Internet Engineering Task Force (IETF) in RFC 4122 and later updated in RFC 9562.
Whether you are generating primary keys for a high-throughput PostgreSQL database, designing RESTful API resources, provisioning Microsoft COM components, or issuing session tokens, understanding the architecture, entropy mathematics, and performance trade-offs of UUIDs is critical for software architects and full-stack developers.
A UUID is fundamentally a 128-bit integer (16 octets or bytes). In textual representation, it is displayed as a canonical 36-character string containing 32 hexadecimal digits grouped into five hyphen-separated segments:
xxxxxxxx-xxxx-Mxxx-Nxxx-xxxxxxxxxxxxEach group has specific historical and technical definitions under RFC 4122:
c9a646d3).9c61).4cb7). The first character (M) denotes the UUID Version. For a Version 4 UUID, this character is always 4.bf7d). The first character (N) encodes the UUID Variant. In RFC 4122, the two most significant bits are set to 10, which means N can only be one of four hex digits: 8, 9, a, or b.1f1c9d56). In Version 1, this contained the machine's MAC address; in Version 4, all 48 bits are generated from cryptographic random data.RFC standards define multiple UUID versions, each tailored for different operational constraints:
| Version | Basis / Generation Mechanism | Primary Use Case | Key Drawback |
|---|---|---|---|
| UUID v1 | Gregorian timestamp (100ns intervals) + Node MAC address | Legacy distributed systems requiring time ordering | Leaks machine MAC address and exact creation timestamp (privacy flaw) |
| UUID v3 | MD5 hash of a namespace UUID and arbitrary string | Deterministic identifier generation from text | MD5 is cryptographically broken and vulnerable to collision attacks |
| UUID v4 | Cryptographically secure pseudo-random bytes (CSPRNG) | Modern web APIs, primary keys, session tokens, distributed apps | Random distribution causes B-Tree index fragmentation in large tables |
| UUID v5 | SHA-1 hash of a namespace UUID and input string | Deterministic namespace-based identifiers | Slower to compute; deterministic nature unsuitable for random secret tokens |
| UUID v7 | Unix millisecond timestamp + 74 bits of random entropy | Modern database primary keys (PostgreSQL, MySQL, SQLite) | Recently finalized in RFC 9562; older libraries may lack native parsing |
A Version 4 UUID reserves 4 bits for the version number (0100) and 2 bits for the RFC 4122 variant (10xx). Subtracting these 6 fixed bits from the total 128 bits leaves 122 bits of true entropy.
The total number of possible UUID v4 values is:
To understand this scale in practical terms, calculate the collision probability using the Birthday Problem approximation formula:
Even if your application generates 1 billion UUIDs per second for an entire year (approximately 3.15 × 1016 UUIDs), the probability of generating a single collision is less than 0.0000000000000001 (one in one quadrillion). This statistical guarantee allows distributed systems to generate keys locally without checking a central database.
When architecting database tables in relational engines like PostgreSQL, MySQL, or SQL Server, developers frequently weigh auto-incrementing sequential integers (BIGSERIAL or IDENTITY) against UUIDs:
/orders/1001 to /orders/1002), revealing your total transaction volume and customer count. UUID v4 obscures internal database state completely.VARCHAR), compared to 8 bytes for BIGINT. Furthermore, random UUID v4 values insert randomly across database B-Trees, causing page splits in clustered indexes. For clustered primary keys, consider using sequential UUID v7 or storing UUIDs in native binary types (e.g., PostgreSQL UUID or MySQL BINARY(16)).In early web development, poorly written JavaScript libraries constructed UUIDs using Math.random():
// UNSAFE ANTI-PATTERN: Never use Math.random() for UUIDs
'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, c => ...)Math.random() is not a Cryptographically Secure Pseudo-Random Number Generator (CSPRNG). Browsers implement Math.random() with lightweight algorithms like xoshiro128+ or XorShift, designed for speed in gaming and graphics rather than security. An attacker who observes several consecutive generated values can reconstruct the PRNG's internal state and predict past and future UUIDs, completely compromising API authentication tokens or session IDs.
Toolhast exclusively utilizes native browser CSPRNG APIs:
// SECURE NATIVE BROWSER CSPRNG:
crypto.randomUUID() // Built into modern browsers (RFC 4122 v4)
crypto.getRandomValues(new Uint8Array(16)) // Hardware entropy backedThese native methods tap directly into operating system entropy pools (such as /dev/urandom on Linux/macOS and CryptGenRandom / CNG on Windows), guaranteeing non-deterministic, cryptographically resilient identifiers for production software systems.
Select your generation mode: Instant Single UUID, Bulk Generator (up to 1,000 UUIDs), or UUID Validator & Inspector.
Customize your formatting options: toggle uppercase or lowercase, standard hyphens (36 chars) vs compact hex (32 chars), or Microsoft GUID curly braces.
Choose your bulk delimiter: newline, comma, semicolon, or JSON array format for direct inclusion in code or SQL scripts.
Click 'Copy UUID' or 'Copy All' to copy immediately to your clipboard, or click 'Download' to save as a .txt or .json file.
Contains 32 hexadecimal digits separated by four hyphens with version 4 (nibble '4') and variant 10xx (nibble 'b').
Commonly required in C#, .NET Entity Framework, Windows Registry keys, and COM interfaces.
A Universally Unique Identifier (UUID) is a 128-bit label used to uniquely identify resources across distributed systems without central coordination. Version 4 UUIDs rely purely on cryptographic pseudo-random number generation. Out of 128 bits, 6 bits designate version and variant, leaving 122 bits of pure entropy for virtually zero collision risk.
UUID (Universally Unique Identifier) and GUID (Globally Unique Identifier) refer to the exact same 128-bit identification standard defined in RFC 4122. Microsoft coined the term GUID for its Component Object Model (COM) and .NET architectures, typically formatting them with uppercase letters and surrounding curly braces, while UUID is the open IETF standard.
The probability of generating duplicate UUID v4 values is astronomically tiny due to 122 bits of true entropy. You would need to generate one billion UUIDs every second for approximately 36 years to achieve a 50% chance of a single collision, making duplicate keys statistically impossible in real-world database architectures.
Standard `Math.random()` relies on pseudo-random number generators (PRNG) like xoshiro128+, which are deterministic, seed-dependent, and predictable by attackers. Toolhast exclusively uses the Web Crypto API (`crypto.getRandomValues` and `crypto.randomUUID`), which interfaces directly with your operating system hardware entropy pool to supply cryptographically secure randomness essential for security tokens and primary keys.
Auto-incrementing integers provide compact indexing and natural temporal sorting, but expose business metrics to scrapers and fail across distributed multi-master databases. UUID v4 prevents enumeration attacks and allows client-side ID generation before database writes, though random inserts can cause B-tree index fragmentation compared to sequential identifiers like UUID v7.
No. Toolhast executes all UUID generation and validation entirely within your browser sandbox via native Web Crypto APIs. None of your generated UUIDs, configuration options, or validated keys are transmitted over the internet, sent to analytics, or stored in remote database records, ensuring total developer privacy and confidentiality.
Free online JSON formatter, validator, and minifier: beautify messy JSON, fix errors, and minify code instantly. 100% private in-browser with zero uploads.
Free online Base64 encoder and decoder: encode and decode text or files to Base64 with UTF-8 support. 100% private in-browser with zero server uploads.
Free online URL encoder and decoder: encode and decode URLs and URI query parameters with UTF-8 percent-encoding. 100% private in-browser with zero uploads.
Private: this tool runs in your browser. Nothing you type is uploaded.
Last updated