Home/Tools/UUID Generator

UUID / GUID Generator

Generate cryptographically secure Version 4 (Random) and Version 7 (Time-Sorted) UUIDs using Web Cryptography.

Your Single UUID:
Advertisement

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

VersionGeneration BasisMonotonic / SortableBest Use Case
UUID v4122 bits of pseudo-randomnessNo (Random distribution)General primary keys, session IDs
UUID v7Unix Epoch MS timestamp + random bitsYes (Sequential by time)Database indexes (PostgreSQL, MySQL B-Trees)
Nil UUIDAll 128 bits set to zeroN/APlaceholder / 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 →