UUID reference
A UUID is 128 bits with 6 of them spoken for: 4 say which layout the rest follows, 2 say which standard it belongs to. Everything else on this site is a way of writing those 128 bits down.
This is the reference behind the converter: what each format on the tool actually means, which bits a version spends where, and where RFC 9562 says so. Every example was produced by the same code the converter runs.
Open the converter: UUID textNothing you paste leaves the browser.
On this page (13)
What the 128 bits are#
A UUID carries no meaning of its own beyond its layout. Four bits hold the version, two hold the variant, and the remaining 122 belong to whichever layout the version names: a clock and a node for v1, a hash for v3 and v5, milliseconds and randomness for v7, pure chance for v4.
RFC 9562 § 4.2 · Version FieldWhere the version nibble sits, and why it is the 13th hex digit
RFC 9562 § 4.1 · Variant FieldThe variant bits: 10xx is this standard, other patterns are NCS, Microsoft and reserved
GUID and UUID are the same thing#
GUID is the name Microsoft uses; UUID is the name the RFC uses. The 128 bits are identical. What differs is the byte order some Microsoft APIs use when they turn those bits into a byte array, and that difference is real enough to corrupt data if it is ignored.
The standard moved: RFC 4122 is obsolete#
RFC 9562 replaced RFC 4122 in May 2024. It kept versions 1 through 5 unchanged and added v6, v7 and v8, plus the Max UUID. Pages that still cite RFC 4122 for a v7 layout are citing a document that never described one.
RFC 9562: Universally Unique IDentifiers (UUIDs)The current standard, in full
Start here#
- What is a UUID?The short, exact answer, and what GUID has to do with it
- GUID and UUIDTwo names, one layout, and the byte order that differs
- All versions side by sideWhat each layout is made of and when to pick it
- v4 or v7The choice almost every new project makes
- UUID as a primary keyWhat it costs, and when an integer is the better key
Making and converting in bulk#
Converting a UUID#
- To a 16-byte arrayDecimal, hex or a 0x-prefixed C array
- Without dashesBare hex for a database column or a cache key
- Every way to write oneCanonical, hex, braces, urn:uuid, capitals, N/D/B/P/X
- To Base64, and the short forms22 characters, the URL-safe alphabet, and what base58 buys
- To a high/low 64-bit pairJava, Kotlin, Kafka, Rust — and why the number is negative
- To four 32-bit wordsMinecraft NBT int arrays, Unreal FGuid, protobuf
- Byte order: RFC against mixed-endian GUIDThe bug that survives code review
Reading one#
The versions, in order#
- Version 1A 1582 clock and, often, a real MAC address
- Version 3Deterministic identifiers, via MD5
- Version 4122 random bits, and the collision arithmetic
- Version 5The same contract with SHA-1
- Version 6The v1 clock, reordered so it sorts
- Version 7Time-ordered keys, and what they leak
- Version 8Your own layout inside a valid UUID
- The Nil UUIDAll zeros: placeholder, and the join trap
- The Max UUIDAll ones: the upper bound of a range
- NamespacesDNS, URL, OID, X.500 — and rolling your own
In a database#
ULID and the alternatives#
Running the tool#
Questions people actually ask#
Is a GUID the same as a UUID?
Yes. Same 128 bits, same layouts, different vocabulary. Watch the byte order when a GUID is turned into bytes by a Microsoft API: the first three groups are written little-endian there, the last two big-endian.
Which UUID version should I use?
v4 when you only need uniqueness, v7 when the identifier goes into a database index and you want it to sort by time, v5 when the identifier has to be derived from a name and be the same everywhere.
Related#
Browse the reference
Start here
Making and converting in bulk
Converting a UUID
Reading one
The versions, in order
In a database
ULID and the alternatives
Running the tool