UUID Generator & Decoder

Generate version 4 and 7 UUIDs, or take any UUID apart: its version, its variant, and when a time-based one was made.

Drawing your browser’s random bytes, 16 per UUID…

Runs in your browser. Nothing you enter is sent anywhere.

How to use it

Pick Generate or Decode. Both run in your browser; nothing is uploaded.

  1. In Generate, choose Version 4 (random) or Version 7 (time-ordered).
  2. Set How many, from 1 to 100. Copy all copies the list, one UUID per line.
  3. Switching the version, changing How many or pressing Regenerate draws 16 fresh bytes per UUID from crypto.getRandomValues and rereads your clock.

In Decode, paste a UUID into the UUID box in any case, with or without hyphens, in braces or behind urn:uuid:. The table shows the Canonical form, Version, Variant and, for versions 1, 6 and 7, the Time it was made, in UTC.

Examples

Version 4, How many 1, with these 16 bytes in place of your browser’s random ones:

9b2e61d4c07a1f3e2c5d88e0b4f7a613
9b2e61d4-c07a-4f3e-ac5d-88e0b4f7a613

1f became 4f (the version) and 2c became ac (the variant bits 10). The other 122 bits are as drawn.

Version 7, How many 3, with 2026-10-14T09:30:00.000Z standing in for your clock and these 48 bytes for the random draw:

0998f48c56cf2f4da687ec838075c46e0935b0ea3f03adf014572d4ee24fc765d5bd5eaa61c9d340990522846b77fb45
01a139bf-49c0-7998-a687-ec838075c46e
01a139bf-49c0-7999-9457-2d4ee24fc765
01a139bf-49c0-799a-9905-22846b77fb45

01a139bf49c0 is 1791970200000 Unix milliseconds. All three share it, so a 12-bit counter after the 7 (998, 999, 99a), seeded from random bits, keeps them in order. Past fff, the next UUID takes the following millisecond and the counter restarts at 000.

Decode with the box’s starting value, the example UUID from RFC 4122, f81d4fae-7dec-11d0-a765-00a0c91e6bf6:

Canonical form  f81d4fae-7dec-11d0-a765-00a0c91e6bf6
Version         1 · time-based
Variant         RFC 9562 (0b10)
Time            1997-02-03T17:43:12.216Z

With c765 for a765, f81d4fae-7dec-11d0-c765-00a0c91e6bf6 is Microsoft’s variant: Version reads None: only the RFC 9562 variant (0b10) has one and there’s no Time row.

Spaces for hyphens, 9b2e61d4 c07a 4f3e ac5d 88e0b4f7a613, are rejected with " " at position 9 isn't a hex digit. A missing digit gives A UUID is 32 hex digits, with or without hyphens. This one has 31.

Good to know

  • The variant decides whether there’s a version. In xxxxxxxx-xxxx-Mxxx-Nxxx-xxxxxxxxxxxx, the top bits of N are the variant. Standard UUIDs (RFC 9562, which replaced RFC 4122 in 2024) have N of 8 to b, and only they make M a version; 0 to 7 is the old NCS variant, c and d Microsoft’s, e and f reserved.
  • Version 4 is 122 random bits. A 50% chance of any duplicate takes about 2.7 × 10^18 of them, given a cryptographic source like crypto.getRandomValues, not Math.random().
  • Version 7 is 48 bits of Unix milliseconds, then the version, a 12-bit counter, the variant and 62 random bits (RFC 9562 sections 5.7 and 6.2). As database keys, new ones land at the end of a B-tree index, not on random pages.
  • Time-based UUIDs reveal when they were made. Anyone can read a version 7’s millisecond, and a version 1 often ends in the machine’s MAC address. RFC 9562 also says not to treat UUIDs as hard-to-guess secrets.
  • Versions 1 and 6 count 100-nanosecond ticks from 15 October 1582, shown here to the millisecond, rounded down; version 6 reorders them so it sorts. Version 2 (DCE Security) swaps part of the timestamp for a local user or group ID, so no time is shown.
  • The nil and max UUIDs are named: all zeros shows 0 · the nil UUID, all 128 bits zero and all fs shows 15 · the max UUID, all 128 bits one.
  • A GUID’s bytes may be stored out of order. .NET’s Guid.ToByteArray() and SQL Server’s uniqueidentifier keep the first three groups little-endian; hex read straight from those bytes turns 9b2e61d4-c07a-4f3e-… into d4612e9b-7ac0-3e4f-…, which decodes as 3 · MD5 name-based. Reverse the bytes of each of those groups first.
  • Only hyphens may sit between digits. Input is limited to 100 characters, and output is lowercase, as RFC 9562 says.

Questions

What’s the difference between UUID v4 and v7?

Version 4 is random; version 7 starts with a millisecond timestamp, so later UUIDs sort later. Prefer version 7 for database keys and version 4 when the creation time shouldn’t show.

How do I generate a UUID in code or the terminal?

crypto.randomUUID() returns a version 4 UUID in Node and in browsers on HTTPS pages. Python has uuid.uuid4(), PostgreSQL gen_random_uuid(), and macOS and Linux the uuidgen command. For version 7, PostgreSQL 18 adds uuidv7() and Python 3.14 uuid.uuid7().

How do I get the timestamp out of a UUID?

Paste it into Decode and read the Time row; only versions 1, 6 and 7 have one. A version 7’s first 12 hex digits are the milliseconds, so in JavaScript new Date(parseInt(uuid.slice(0, 8) + uuid.slice(9, 13), 16)) gives the same time.

Is a GUID the same as a UUID?

Yes: GUID is Microsoft’s name for it, with the same 128 bits and text form. .NET’s Guid.NewGuid() makes version 4, and .NET 9 added Guid.CreateVersion7(). Only the stored byte order can differ.