UUID / GUID Generator
Generate cryptographically secure Version 4 (Random) and Version 7 (Time-Sorted) UUIDs using Web Cryptography.
Understanding UUID Versions
A Universally Unique Identifier (UUID), also known as a GUID in Microsoft ecosystems, is a 128-bit label standardized in RFC 4122 and updated in RFC 9562. It is represented as 32 hexadecimal characters in five hyphenated groups (8-4-4-4-12).
Comparison of UUID Versions
| Version | Generation Basis | Monotonic / Sortable | Best Use Case |
|---|---|---|---|
| UUID v4 | 122 bits of pseudo-randomness | No (Random distribution) | General primary keys, session IDs |
| UUID v7 | Unix Epoch MS timestamp + random bits | Yes (Sequential by time) | Database indexes (PostgreSQL, MySQL B-Trees) |
| Nil UUID | All 128 bits set to zero | N/A | Placeholder / default initializations |
Why UUID v7 is replacing UUID v4 for Databases
Random UUIDs (v4) cause severe index fragmentation in B-Tree based database engines (like PostgreSQL, MySQL InnoDB) because new keys insert unpredictably all across the tree. UUID v7 solves this by placing a millisecond-precision Unix timestamp in the high-order bits, providing natural time-sortability and high database write throughput.
Frequently Asked Questions
What's the difference between UUID v4 and v7?
UUID v4 is fully random, offering no inherent ordering. UUID v7 embeds a timestamp in its first bits, so UUIDs generated later sort after earlier ones — making it a better fit for database primary keys where index locality and insert order matter.
How likely is a UUID collision?
For UUID v4, the probability of a collision is astronomically low — generating a billion UUIDs per second for about 85 years would give roughly a 50% chance of a single collision, which is why UUIDs are treated as effectively unique in practice.
What does the "Nil" UUID mean?
The Nil UUID (00000000-0000-0000-0000-000000000000) is a special reserved value representing "no UUID" or an unset ID — it's used as a sentinel value in some systems rather than as a randomly generated identifier.
Are UUIDs generated here cryptographically secure?
Yes — generation uses your browser's window.crypto.getRandomValues() API, the same cryptographically secure source used for passwords and security tokens, rather than the weaker Math.random().
⚡ Related Developer Tools
View All 30+ Tools →JWT Decoder
Decode JSON Web Tokens securely in your browser with header/payload highlighting and expiration check.
Hash Generator
SHA-256, SHA-512, and SHA-1 cryptographic hashing using browser SubtleCrypto API.
Password Generator
Cryptographic high-entropy passwords, API tokens, and secure passphrases.