How to use the UUID generator
- Pick v4 for fully random IDs or v7 for IDs that sort by creation time.
- Enter how many you need, from 1 to 1,000, and press Generate (or Enter in the number box).
- Tick Uppercase, No hyphens or Braces to match the format your code or database expects. The list updates straight away.
- Press Copy all to copy the list, one UUID per line, or Download .txt to save it.
- To check a UUID, paste it into the decoder. It tells you whether it is well formed, which version and variant it is and, for time-based UUIDs, when it was created.
What a UUID is
A UUID (universally unique identifier) is a 128-bit number used to label things without a central authority handing out
numbers. Any computer can create one and be confident nobody else will create the same value. They are written as 32
hexadecimal digits in five groups separated by hyphens, 8-4-4-4-12, for example
f47ac10b-58cc-4372-a567-0e02b2c3d479. The current standard is
RFC 9562 (May 2024), which replaced RFC 4122
and added versions 6, 7 and 8.
Two fields are fixed in every standard UUID. The first hex digit of the third group is the version (the 4 in
4372 above), and the first hex digit of the fourth group is the variant, which is
8, 9, a or b for RFC 9562 UUIDs. That is how the decoder can tell what kind of UUID you have.
| Version | How it is made | Use it when |
|---|---|---|
| v1 | Time (100 ns steps since 1582) plus a node ID, often the MAC address | Legacy systems only; it can reveal the machine |
| v3 / v5 | MD5 / SHA-1 hash of a namespace and a name | The same input must always give the same UUID |
| v4 | 122 random bits | General-purpose IDs where order does not matter |
| v6 | v1 rearranged so it sorts by time | Upgrading v1 systems |
| v7 | 48-bit Unix time in milliseconds plus 74 random bits | Database keys, logs, anything that benefits from time order |
| v8 | Layout defined by the application | Custom or experimental schemes |
Version 4: random
A v4 UUID sets the version and variant bits and fills the other 122 bits with random data. This page uses
crypto.randomUUID() where the browser supports it and otherwise builds the UUID from
crypto.getRandomValues(). Both draw from the operating system's cryptographically secure
generator, never from Math.random().
Version 7: time-ordered
A v7 UUID puts the current Unix time in milliseconds in its first 48 bits, then the version, 12 bits called
rand_a, the variant and 62 random bits called rand_b:
0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | unix_ts_ms | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | unix_ts_ms | ver | rand_a | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |var| rand_b | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | rand_b | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Because the time comes first, v7 UUIDs sort in creation order as text and as bytes. That matters for databases: inserting
random v4 keys scatters writes across a B-tree index, while v7 keys are appended near the end, much like an
auto-increment number. When you generate many in the same millisecond, this page follows the RFC's "fixed-length
dedicated counter" method: rand_a starts at a random value each millisecond and goes up by one for
each extra UUID, so a bulk list is strictly increasing. If the counter would overflow, the timestamp moves forward by one
millisecond, as the RFC allows, and if your computer's clock steps backwards the last timestamp is reused so the order
never breaks.
Formats: uppercase, no hyphens and braces
The original standard, RFC 4122, says UUIDs are output in lowercase and are case insensitive on input. Some systems want other forms: Microsoft tools and the Windows registry show GUIDs in uppercase in braces, and some databases store the 32 hex digits without hyphens. These options change only how the value is written, not the value itself.
Tips and troubleshooting
- Storing UUIDs. Use a native UUID column where your database has one (PostgreSQL
uuid, SQL Serveruniqueidentifier) or 16 bytes of binary. As text a UUID takes 36 characters. - SQL Server sort order. SQL Server compares
uniqueidentifiervalues starting from the last group of bytes, so v7 values do not sort by time there the way they do in PostgreSQL or as strings. - "Not a valid UUID". Check the length: there must be exactly 32 hex digits (0-9, a-f). Copying from a PDF or chat sometimes adds spaces or swaps hyphens for dashes; the decoder ignores spaces and common dash characters.
- Privacy of v7. Anyone who sees a v7 UUID can read when it was created. If that matters, for example in a public URL, use v4.
- Copy does not work. Some browsers block clipboard access on pages opened from certain apps. Select the text in the box and press Ctrl+C (Cmd+C on a Mac) instead.
Related tools
Working with an API? Check payloads with the JSON formatter, and turn the millisecond time inside a v7 UUID into other formats with the Unix timestamp converter. For renaming identifiers between camelCase and snake_case, try the case converter.