Skip to content
UUID App
Contact
UUID App
Basics

What is a GUID, and is it a UUID?

A GUID is Microsoft's name for a UUID. The text looks the same, but .NET can store the bytes in a different order. Here is what that means and how to avoid the bug it causes.

By The UUID App teamUpdated 5 min read

Quick answer

Yes. GUID (globally unique identifier) is the name Microsoft uses for a UUID (universally unique identifier). Both are 128-bit values written as 32 hex digits in an 8-4-4-4-12 pattern. The one real difference is in storage: .NET writes the first three groups of bytes in reverse order, which can scramble IDs when they cross between systems.

Same thing, different name

The standard that defines UUIDs, RFC 9562, says it in its opening line: UUIDs are “also known as GUIDs”. There is no separate GUID format.

The word GUID is used in Microsoft’s world: COM, Windows, .NET and SQL Server. Java, Python, Go, PostgreSQL and most web APIs say UUID. If a form or an API asks for a GUID, any valid UUID will work, and the reverse is also true.

Here is a GUID made by .NET’s Guid.NewGuid(). It has exactly the same anatomy as any other version 4 UUID:

  • Random
  • Version, always 4
  • Variant, 8, 9, a or b

How a GUID is written

The same 128-bit value can be printed in several ways. Microsoft tools tend to use uppercase and curly braces, while most other tools use plain lowercase.

Style Example Where you see it
Standard 35918bc9-196d-40ea-9779-889d79b753f0 .NET ToString(), PostgreSQL, JSON APIs
Uppercase 35918BC9-196D-40EA-9779-889D79B753F0 SQL Server, Windows tools
Braces {35918BC9-196D-40EA-9779-889D79B753F0} Windows registry, Visual Studio .sln files
No hyphens 35918bc9196d40ea9779889d79b753f0 .NET ToString("N")

All four are the same ID. RFC 9562 says hex digits are case-insensitive on input, so compare IDs in a case-insensitive way, or normalise them to lowercase without braces before you store them. The UUID converter switches between these styles.

When was this UUID made? Paste it and see the date. Decode a UUID
Need 10,000 UUIDs? Export to CSV, JSON or SQL. Try it free

The byte-order catch

The text is the same everywhere. The bytes are not.

RFC 9562 stores a UUID as 16 bytes in the order you read them, most significant byte first. This is called big-endian. .NET’s Guid type treats the first group as a 32-bit number and the next two groups as 16-bit numbers, and Guid.ToByteArray() writes those three numbers in little-endian order, with the bytes reversed. The last two groups are copied as they are.

GUID string        35918bc9-196d-40ea-9779-889d79b753f0
RFC 9562 bytes     35 91 8b c9  19 6d  40 ea  97 79  88 9d 79 b7 53 f0
Guid.ToByteArray() c9 8b 91 35  6d 19  ea 40  97 79  88 9d 79 b7 53 f0

This causes real bugs. Say a C# service writes ToByteArray() into a binary column, and a Python or Go service reads those 16 bytes as a normal UUID. It gets c98b9135-6d19-ea40-9779-889d79b753f0, a different ID that matches nothing.

The fix is to say which byte order you mean on both sides:

// .NET 8 and later
byte[] bytes = guid.ToByteArray(bigEndian: true);
var back = new Guid(bytes, bigEndian: true);

bigEndian: true gives the same byte order as RFC 9562 and every other platform.

If you pass IDs around as strings, none of this matters. The problem only appears when raw bytes move between systems.

Which version is my GUID?

A GUID carries the same version digit as any UUID: the first digit of the third group.

  • Guid.NewGuid() makes version 4, which is random. Microsoft’s docs say so directly.
  • Guid.CreateVersion7(), added in .NET 9, makes version 7, which starts with a timestamp and sorts by creation time.
  • Guid.Empty is the Nil UUID, all zeros.
  • From .NET 9, the Version and Variant properties read those fields for you.

RFC 9562 also reserves a variant for “Microsoft Corporation backward compatibility”. It shows up as c or d at the start of the fourth group. You will rarely meet one, but strict validators reject it because it is not the standard layout. Paste any ID into the UUID decoder to see its version and variant.

Good to know

Sorting in SQL Server is different

Prefer strings at boundaries

Parsers differ

Something missing or wrong in this guide?Tell us and we will fix it.

Need a GUID right now?

Make one in the uppercase, braced style Windows uses.

Open the GUID generator

Keep reading