UUID Generator
Create v4 and v7 identifiers that never leave the tab.
- Local by default
- No signup
- AI is opt-in
Generated locally with the Web Crypto API. Version 7 IDs embed the current millisecond timestamp, so they sort in creation order. Nothing is sent over the network.
Generate RFC 9562 UUIDs in bulk: version 4 for pure randomness, version 7 when you want identifiers that sort by creation time. Choose uppercase or hyphen-free output, copy one value or the whole list. Everything is produced in your browser.
What a UUID actually is
A UUID is a 128-bit identifier written as 32 hexadecimal digits in five groups: xxxxxxxx-xxxx-Mxxx-Nxxx-xxxxxxxxxxxx. The M nibble carries the version and the leading bits of N carry the variant, so only 122 bits of a version 4 UUID are actually random. The canonical string is 36 characters including hyphens, or 32 without them.
The format is defined by RFC 9562, published in 2024, which replaces RFC 4122. The important idea is that a UUID is an identifier, not a secret and not a database row number. It is designed to be generated independently on many machines without coordination, with a collision probability so small that no one checks for duplicates in practice.
Version 4: pure randomness
Version 4 sets the version and variant bits and fills the remaining 122 bits with random data. Collisions are not a practical concern: you would need to generate roughly 2^61 IDs before a 50% chance of any collision, which is far beyond the output of any real system.
The trade-off is locality. Because the bits are random, consecutive IDs land in unrelated parts of a B-tree index. Each insert touches a random page, which is fine at small scale and increasingly expensive as a table grows. This is why databases with clustered primary keys often prefer time-ordered identifiers.
Randomness does not make a UUID a credential. A version 4 value is hard to guess, but it is still an identifier that gets logged, indexed and shared. Do not treat one as a bearer token unless the system was designed for that and you understand the difference.
Version 7: sortable by creation time
Version 7 starts with a 48-bit Unix timestamp in milliseconds, then a version nibble, 12 bits of random data, the variant bits and 62 more random bits. The result is an identifier that increases roughly with wall-clock time, so new rows insert near the end of an index instead of scattering across it. That single change is why v7 has become the default choice for primary keys in new systems.
Two caveats are worth knowing. First, v7 is time-ordered, not strictly monotonic: several IDs created in the same millisecond have random ordering among themselves. If you need strictly increasing values within a millisecond, use a library that adds a counter sequence to the random field. Second, the timestamp is visible. An ID reveals when the row was created, to the millisecond; if that leaks information you would rather not expose, v4 is the safer choice.
The v7 values on this page use the standard 48-bit millisecond prefix. The generator runs in your tab, so the clock it uses is your device clock — an ID generated on a machine with a wrong clock will sort accordingly.
Why only v4 and v7 are offered
- v1 combines a timestamp with the host MAC address and a clock sequence. It leaks hardware identity and is best avoided in anything user-facing.
- v3 and v5 hash a namespace plus a name with MD5 or SHA-1. They are deterministic by design: the same name always yields the same UUID, which is useful for reproducible identifiers and wrong for random IDs. v3 also relies on MD5.
- v6 reorders the v1 fields so the timestamp sorts first. It is a repair for v1 rather than a new design, and tooling support is thinner.
- v8 reserves space for application-defined layouts. It is for teams that need a custom bit layout, not a general-purpose generator.
In practice the choice comes down to whether index locality matters. Use v7 for database keys and request IDs, where creation order is useful. Use v4 when you want no timestamp in the value at all, or when interoperating with systems that assume random UUIDs.
Formatting, case and storage
UUIDs are case-insensitive; A1B2 and a1b2 are the same value. Lowercase is the common convention, while some enterprise systems and older APIs emit uppercase. The hyphen-free 32-character form shows up in URLs, filenames and systems that reject punctuation. All three forms represent the same 128 bits, so pick one convention and normalise on input rather than guessing on output.
In a database, store a UUID as a native uuid or binary(16) column rather than a 36-character string. The difference is 16 bytes versus 36, and it affects every index entry, not just the row. If you must store text, pick a fixed length and be consistent about case, otherwise lookups and unique constraints start missing matches.
Where UUIDs are the wrong tool
- Not for short URLs or anything a person reads aloud. Thirty-two hex characters do not compress well in human memory; use a shorter, non-guessable token instead.
- Not as a substitute for an authorization check. Possession of an ID should never be the only thing granting access.
- Not as a strictly ordered sequence in a high-throughput system unless you add a monotonic counter to v7. Two IDs in the same millisecond can sort either way.
- Not as proof of creation time. The timestamp in v7 is the generator's clock, which can be wrong or deliberately altered.
Frequently asked questions
Should I use UUID v4 or v7?
Use v7 for database primary keys and anything where creation order helps index locality or log reading. Use v4 when you do not want a creation timestamp embedded in the identifier, or when a system expects random UUIDs. Both are safe from collisions at any realistic scale.
Can two generated UUIDs be identical?
In theory yes, in practice no. Version 4 has 122 random bits and version 7 has 74 random bits plus a millisecond timestamp. The chance of a collision in a normal application is far smaller than the chance of a hardware failure corrupting the data first.
Is a UUID a secret or a token?
No. A UUID is an identifier that is designed to be stored, indexed, logged and shared. Even when the value is hard to guess, treating it as a bearer credential couples access control to a value that leaks easily. Use a dedicated token with explicit expiry and revocation.
Why do the v7 IDs I generate not increase strictly?
Version 7 guarantees time ordering at millisecond granularity, not within a millisecond. IDs created in the same millisecond are ordered by their random bits. If you need strict monotonicity, use a library that adds a counter to the random portion.
Is the uppercase or hyphen-free form valid?
Yes. UUIDs are case-insensitive and the hyphens are formatting, not data. The 32-character hyphen-free form represents the same value and is widely accepted. Normalise case on input so your database does not treat two spellings as different identifiers.
Does generating UUIDs here send anything to a server?
No. Both versions are built with crypto.getRandomValues() in your browser. The page makes no network request when generating, so the values and the timestamps never leave your device.