GUID and UUID

UUID text7 sectionsUpdated

They are the same 128 bits under two names. GUID is Microsoft vocabulary, UUID is the RFC's. The only difference that can bite you is the byte order in which some Microsoft APIs write them.

The two words are used interchangeably, and for the text form that is correct. The moment either becomes a byte array, the vocabulary stops being the interesting part.

UUID textcomputed by the converter itself
inf81d4fae-7dec-11d0-a765-00a0c91e6bf6out{f81d4fae-7dec-11d0-a765-00a0c91e6bf6}

.NET calls this format B

in01890a5d-ac96-774b-bcce-b302099a8057out{01890a5d-ac96-774b-bcce-b302099a8057}

A v7, in the same clothes

Open the converter: UUID textNothing you paste leaves the browser.
On this page (7)

Where the two names come from#

The IETF standardised the identifier and called it a UUID; RFC 9562 is the current text. Microsoft shipped the same thing in COM and called it a GUID, a Globally Unique Identifier, and the name stuck across Windows, .NET and SQL Server. ITU-T X.667 and ISO/IEC 9834-8 describe it again for their own audiences, and RFC 9562 notes that both sets of specifications have been aligned and are fully technically compatible.

RFC 9562 § 4 · UUID FormatThe format the word UUID refers to

Where they differ#

RFC 9562 worldMicrosoft world
Text formf81d4fae-7dec-11d0-…identical, often in capitals
Punctuation habitsplain, or urn:uuid:braces, and the N/D/B/P/X format letters
Byte order of the first three groupsbig-endianlittle-endian in memory and in ToByteArray()
Database columnuuiduniqueidentifier
Generatorv4, v7 and the restNEWID, NEWSEQUENTIALID, Guid.NewGuid

The byte order is the only row that can corrupt data. Everything else is spelling.

The one that bites#

Guid.ToByteArray() reverses the bytes of the first three groups. Java, Go, Python's uuid.bytes and every RFC-conforming implementation do not. Feed one to the other and you get a valid-looking identifier that belongs to a different row, with no error anywhere. .NET 8 added ToByteArray(bigEndian: true) and a matching constructor, which is the fix when you control both ends.

So which word should I use?#

Say GUID inside a Microsoft codebase, UUID everywhere else, and neither in a schema comment: write down the version and the byte order instead. Those are the two facts the next person actually needs.

Questions people actually ask#

Is a GUID the same as a UUID?

Yes. The same 128 bits and the same layouts. Only the byte order used by some Microsoft APIs differs, and only when the value becomes bytes.

Can I store a GUID in a PostgreSQL uuid column?

Yes, as long as you move it as text or in RFC byte order. The mixed-endian byte array is a different value.

Does Microsoft follow RFC 9562?

Modern .NET does: it generates v4 and, since .NET 9, v7, and it can read and write big-endian bytes. The older APIs keep the mixed-endian habit.

Browse the reference