UUID vs GUID: What's the Difference?

Developers constantly run into both terms and wonder whether they are interchangeable. The short answer is almost always, yes — but there are enough subtle differences in byte layout, formatting conventions, and ecosystem usage that the question is worth a careful answer. This guide walks through exactly where UUIDs and GUIDs are the same, where they differ, and when the difference actually matters.

The Short Answer

A UUID (Universally Unique Identifier) and a GUID (Globally Unique Identifier) are two names for the same underlying concept: a 128-bit value used to uniquely identify information without central coordination. Both use the familiar hyphenated 36-character format:

6f9619ff-8b86-d011-b42d-00c04fc964ff

The two terms come from different standards bodies and ecosystems:

  • UUID was defined by the Open Software Foundation in the 1980s, then formalised by the IETF in RFC 4122. It is the term used by Linux, macOS, Java, Python, JavaScript, Go, Rust, PostgreSQL, MySQL, MongoDB, and most of the wider software world.
  • GUID is Microsoft's implementation of the same idea, introduced in Windows and used throughout COM, .NET, SQL Server, Visual Studio, and the Windows Registry.

For the overwhelmingly common version-4 (random) case, UUIDs and GUIDs are functionally identical. You can generate a GUID in C#, ship the string to a Linux backend, store it in a PostgreSQL uuid column, and never see a problem.

Where They Actually Differ

There are three concrete differences worth knowing about.

1. Byte Order (Endianness) in v1 Values

This is the only real technical difference. RFC 4122 specifies that all fields of a UUID are stored in big-endian byte order when serialized to a byte array. Microsoft's Guid.ToByteArray() method, however, stores the first three fields in little-endian order. This only matters if you are comparing raw bytes across systems.

Take this v1 UUID: 6F9619FF-8B86-D011-B42D-00C04FC964FF

Serialized per RFC 4122 (big-endian):

6F 96 19 FF 8B 86 D0 11 B4 2D 00 C0 4F C9 64 FF

Serialized by Guid.ToByteArray() in .NET (little-endian first three fields):

FF 19 96 6F 86 8B 11 D0 B4 2D 00 C0 4F C9 64 FF

The string form is identical; only the raw byte layout is swapped. If you store a SQL Server uniqueidentifier value into another database byte-for-byte, you can end up with an apparently different UUID. Guid.ToString() and new Guid(byte[]) both apply the swap internally, so it is invisible unless you reach for the bytes directly.

2. Curly Braces

Microsoft tooling frequently wraps GUIDs in curly braces — {6f9619ff-8b86-d011-b42d-00c04fc964ff} — in the Registry, COM class IDs, Visual Studio project files, and PowerShell output. The braces are a display convention, not part of the identifier. RFC 4122 does not use them. When parsing, strip the braces first (.NET, Guid.Parse(), and most parsers accept either form).

3. Ecosystem Vocabulary

This is less a technical difference and more a cultural one, but it causes confusion. Naming conventions by ecosystem:

C# / .NET          → Guid
SQL Server         → uniqueidentifier
PowerShell         → [guid]::NewGuid()

Java               → UUID (java.util.UUID)
Python             → uuid (uuid module)
JavaScript / Node  → crypto.randomUUID()
Go                 → uuid.UUID
Rust               → Uuid (uuid crate)
PostgreSQL         → uuid
MySQL 8+           → UUID()
MongoDB            → UUID BSON type

If a .NET codebase calls it a GUID and a JVM codebase calls it a UUID, they can still exchange values freely as strings. Pick the name your platform uses and move on.

What's the Same: The Structure

Both UUIDs and GUIDs share the same 128-bit layout, split into five groups separated by hyphens:

xxxxxxxx-xxxx-Mxxx-Nxxx-xxxxxxxxxxxx
└─time-low┘ └tm┘ └tm┘ └cs┘ └─node/random──┘
                 ^    ^
                 |    variant bits (N)
                 version (M)

The two key bits are:

  • Version (M) — the first hex digit of the third group indicates the version: 1 for time-based, 3 and 5 for namespace-based hashes, 4 for random, 7 for time-ordered random (the newest, added in RFC 9562).
  • Variant (N) — the first bits of the fourth group identify the layout standard. 8, 9, A, or B means RFC 4122 / RFC 9562 layout. Other variants exist for legacy Microsoft and NCS GUIDs but are rarely encountered today.

Try our UUID generator to see real values with the version bits set.

Practical Tradeoffs

If you are deciding between "UUID" and "GUID" libraries in code, the choice is almost never about the identifier itself — it is about the version of the identifier. The real decisions to make:

v4 vs v7

Use v4 when you want purely random, unguessable IDs. Use v7 (time-ordered UUIDs, standardised in RFC 9562 in 2024) when you are using the ID as a database primary key — the time prefix means new inserts go to the end of the B-tree index, avoiding the fragmentation and cache-thrashing problems that v4 causes at scale.

String vs Binary Storage

Storing UUIDs as 36-character strings is easy but wastes space (36 bytes per row). PostgreSQL's uuid type and SQL Server's uniqueidentifier both store them as 16 bytes. For MySQL, use BINARY(16) with UUID_TO_BIN(uuid_str, swap_flag) — and yes, the swap flag is there specifically because of the big-endian/little-endian difference described above.

Exposing IDs Publicly

Both UUIDs and GUIDs are safe to expose in URLs and APIs — they do not reveal record count or creation order (for v4) and they cannot be enumerated. If you need ordering, prefer v7. If you want something shorter, consider alternatives like ULID or NanoID, which keep most of the uniqueness guarantees but produce more compact strings.

Generate One Now

Need a quick UUID or GUID right now? Our UUID generator produces v4 values using the browser's cryptographic random source — no data ever leaves your device. Drop the generated value into a SQL Server uniqueidentifier column or a PostgreSQL uuid column and it will work without modification.

Frequently Asked Questions

Are UUIDs and GUIDs the same thing?

Practically, yes. Both are 128-bit identifiers with the same overall format: eight-four-four-four-twelve hexadecimal digits. The two terms originated in different ecosystems — UUID is the standard name from the IETF and Open Software Foundation, while GUID is Microsoft's term for the same concept. The byte layout inside the identifier can differ slightly for version-1 values due to endianness, but for the more common version-4 (random) IDs, UUIDs and GUIDs are fully interchangeable.

When do endianness differences between UUIDs and GUIDs matter?

Endianness only matters when you are serializing the 128-bit value as raw bytes, such as storing it in a SQL Server uniqueidentifier column and comparing byte-for-byte with a value stored by a .NET application. Microsoft's Guid.ToByteArray() returns the first three fields in little-endian order, while RFC 4122 big-endian storage is the norm elsewhere. If you only ever work with the hyphenated string form, the difference is invisible.

Should I use UUID or GUID in my code and database?

Use the term your platform uses. In C#, .NET, and SQL Server, call them GUIDs. In Java, PostgreSQL, MongoDB, Python, and JavaScript, call them UUIDs. The stored values and hyphenated string forms are identical, so the choice is purely linguistic. The technical decision that actually matters is picking the right version — v4 for random, unguessable IDs or v7 for time-ordered IDs that index well.

Why does Microsoft use braces around GUIDs?

Curly braces are a display convention in Windows tooling — they appear in the Windows Registry, COM interface IDs, and Visual Studio project files. They are not part of the identifier itself. When parsing a GUID from a string, strip the braces first. The canonical hyphenated form defined by RFC 4122 has no braces.

Can I copy a GUID from SQL Server and paste it as a UUID in PostgreSQL?

Yes. In their string form, a GUID and a UUID are identical. You can copy 6F9619FF-8B86-D011-B42D-00C04FC964FF from SQL Server, paste it into a PostgreSQL UUID column, and it will work. The only time a mismatch occurs is when you export the raw bytes of a v1 GUID from SQL Server and try to interpret them byte-for-byte as an RFC 4122 UUID — the first three fields will appear byte-swapped.