Fast, Cryptographically Random GUIDs and UUIDs in Your Browser
Whether you are seeding a PostgreSQL database, creating unique correlation IDs for microservices, configuring Windows Registry keys, or mocking API payloads, a reliable GUID generator saves you from opening a terminal just to mint a few identifiers. This tool runs entirely in your browser using the native Web Crypto API (crypto.getRandomValues) to produce RFC-compliant 128-bit identifiers with zero server logging.
GUID vs. UUID: Are They the Same Thing?
In practice, GUID (Globally Unique Identifier) and UUID (Universally Unique Identifier) refer to the exact same 128-bit data structure defined in RFC 9562 (which obsoleted RFC 4122). Microsoft ecosystems—such as .NET, C#, SQL Server (uniqueidentifier), and COM—traditionally call them GUIDs and often wrap them in curly braces ({...}) with uppercase hex letters. Linux, PostgreSQL, Java, Python, and JavaScript ecosystems typically call them UUIDs and prefer lowercase hyphenated strings.
Choosing Between UUID v4, UUID v7, and Nil GUID
Selecting the right version depends on whether you prioritize unpredictability or database index performance:
- UUID v4 (Random): Uses 122 cryptographically random bits (with 6 bits reserved for version
4and variant bits). Because v4 values have no timestamp or sequential pattern, they are ideal for public share links, session identifiers, API keys, and distributed request IDs where callers should never infer creation time or volume. - UUID v7 (Time-Ordered): Places a 48-bit Unix millisecond timestamp at the front of the 128-bit value, followed by version
7bits and 74 random bits. Because new IDs increase monotonically over time, database B-tree indexes append sequentially instead of triggering random page splits—cutting write amplification dramatically in PostgreSQL, MySQL InnoDB, and SQL Server. - Nil GUID (
00000000-0000-0000-0000-000000000000): The official all-zero sentinel value used in schemas, unit tests, and default placeholders when an optional identifier is unset.
Bulk Export Options for Developers and QA
Generating one ID at a time slows down test fixture setup. Set Quantity anywhere from 1 to 200 and pick the output wrapper that matches your workflow:
- Plain Lines: Copy and paste straight into spreadsheets,
.envfiles, or Postman collections. - JSON String Array: Drop valid JSON arrays directly into mock payloads, seed scripts, or TypeScript unit tests.
- SQL
IN (...)Values: Paste formatted single-quoted lists directly into SQLWHERE id IN (...)queries orINSERTseed scripts.
Collision Probability and Security Guarantees
A properly generated UUID v4 contains 122 random bits, yielding (over ) possible values. Even if an application generated one billion UUIDs every second for 85 years, the probability of a single duplicate would remain negligible. Because this generator draws entropy directly from your browser's crypto.getRandomValues interface rather than Math.random(), you get true cryptographic unpredictability with zero network transmission.
Common GUID Formatting Pitfalls in Production Systems
Even though UUIDs are standardized, subtle formatting mismatches between services can break lookups, migrations, and API integrations:
- Case Sensitivity in String Comparisons: Some legacy systems emit uppercase hex (
550E8400-...), while PostgreSQLuuidand JavaScriptcrypto.randomUUID()emit lowercase. If you store UUIDs asVARCHARinstead of a nativeUUIDcolumn type, always normalize case at the API boundary or use the Uppercase (A-F) toggle intentionally to match.NETconventions. - Microsoft SQL Server Byte-Order Quirks: In
.NET,Guid.ToByteArray()uses mixed-endian byte ordering for the first three groups (Data1,Data2,Data3), whereas RFC 9562 network byte order is big-endian across all 16 bytes. When converting raw bytes between C# and PostgreSQL or Base64, verify byte-order expectations before persisting binaryBINARY(16)columns. - Hyphen Stripping in URLs: Removing hyphens cuts 4 characters and avoids awkward line breaks, yet standard JSON Schema
"format": "uuid"validators require the8-4-4-4-12hyphenated layout. Keep Include hyphens (-) enabled for REST payloads and use compact 32-character hex or 22-character Base64 only for custom short-token routes. - Never Generate Production IDs with
Math.random(): Standard non-cryptographic PRNGs have small internal states that can produce collisions under concurrent load. Always rely oncrypto.randomUUID()orcrypto.getRandomValues().
Quick Code Snippets for Parsing GUIDs
After generating test IDs above, you can validate or generate them programmatically in your backend stack:
- JavaScript / TypeScript (Node 20+ & Modern Browsers): Call
crypto.randomUUID()for standard v4 strings, or import a lightweight RFC 9562 helper for time-ordered v7 keys. - PostgreSQL 18+ & Extensions: Use
gen_random_uuid()natively for v4, oruuidv7()in PostgreSQL 18+ for sequential B-tree inserts. - C# / .NET 9+: Call
Guid.NewGuid()for v4 orGuid.CreateVersion7()for native time-ordered v7 identifiers.