GUID vs UUID: What's the Difference?
Meta Description: GUID and UUID are often used interchangeably, but there are subtle differences. Learn what sets them apart and when each term applies.
If you've spent any time in the .NET ecosystem, you've seen GUIDs. If you've worked with databases, APIs, or Unix systems, you've seen UUIDs. They look identical — 32 hex digits with hyphens — but people argue about what to call them. Is there actually a difference?
Short answer: barely. But the "barely" matters in certain contexts. Let's clear this up once and for all.
The Quick Answer
UUID (Universally Unique Identifier) is the standard defined by RFC 9562 (formerly RFC 4122). It's the internationally recognized term used across most programming languages, databases, and protocols.
GUID (Globally Unique Identifier) is Microsoft's name for the same concept. It was introduced in the COM (Component Object Model) era and persists throughout the Windows and .NET ecosystem.
They're the same format. The same 128-bit value. The same hexadecimal representation with hyphens. A UUID generated on Linux is a valid GUID on Windows, and vice versa.
So why do two names exist?
A Brief History
UUID's Origin
The UUID concept originated at Apollo Computer in the 1980s as part of the Network Computing System (NCS). It was later adopted into the DCE (Distributed Computing Environment) by the Open Software Foundation. The formal specification became RFC 4122 in 2005, updated to RFC 9562 in 2024.
The goal was straightforward: create identifiers that any computer could generate independently, without coordinating with a central authority, and be virtually guaranteed unique.
Microsoft's GUID
When Microsoft developed COM and DCOM in the 1990s, they needed unique identifiers for component interfaces, classes, and type libraries. Rather than adopting the UUID terminology directly, they branded the concept as GUID — Globally Unique Identifier.
The implementation was based on the DCE UUID specification, with some Microsoft-specific behavior:
- Windows provided
CoCreateGuid()andUuidCreate()API functions - Visual Studio used GUIDs for project files, interfaces, and COM registration
- The .NET Framework introduced
System.Guidas a first-class type
The branding stuck. Decades later, .NET developers still say "GUID" while the rest of the industry says "UUID."
Technical Differences (There Are a Few)
Byte Order
The most meaningful technical difference is endianness — how multi-byte values are stored in memory.
UUID (RFC standard): Uses big-endian (network byte order) for the first three components:
Byte layout (RFC 4122):
time_low: 4 bytes, big-endian
time_mid: 2 bytes, big-endian
time_hi_and_version: 2 bytes, big-endian
clock_seq: 2 bytes, big-endian
node: 6 bytes
Microsoft GUID: Uses mixed-endian — the first three components are little-endian (native x86), while the last two are big-endian:
Byte layout (Microsoft GUID):
Data1: 4 bytes, little-endian
Data2: 2 bytes, little-endian
Data3: 2 bytes, little-endian
Data4: 8 bytes, big-endian
What This Means in Practice
When you look at the string representation (550e8400-e29b-41d4-a716-446655440000), they're identical. The difference only appears in the binary representation — how the bytes are stored in memory or on disk.
Consider the UUID: 00112233-4455-6677-8899-aabbccddeeff
| Format | Bytes in Memory |
|---|---|
| RFC UUID (big-endian) | 00 11 22 33 44 55 66 77 88 99 aa bb cc dd ee ff |
| Microsoft GUID (mixed-endian) | 33 22 11 00 55 44 77 66 88 99 aa bb cc dd ee ff |
The first 8 bytes are swapped in groups. This can cause bugs when:
- Converting between binary GUID (from SQL Server) and UUID (in a web API)
- Reading GUIDs from Windows registry entries in non-Windows tools
- Interoperating between COM components and non-Microsoft systems
The String Format Is Identical
When serialized as strings, GUIDs and UUIDs are interchangeable:
550e8400-e29b-41d4-a716-446655440000
Both use 32 hex digits, separated into 5 groups by 4 hyphens (8-4-4-4-12). Case is technically insignificant, though conventions differ:
- UUIDs are typically lowercase:
550e8400-e29b-41d4-a716-446655440000 - GUIDs in Microsoft contexts are often uppercase, sometimes with braces:
{550E8400-E29B-41D4-A716-446655440000}
Where You'll See Each Term
UUID Territory
| Context | Example |
|---|---|
| PostgreSQL | UUID data type |
| Python | uuid.uuid4() |
| Java | java.util.UUID |
| JavaScript | crypto.randomUUID() |
| RFC specifications | RFC 9562 |
| Linux/macOS tools | uuidgen command |
| REST APIs | Usually called "UUID" in docs |
GUID Territory
| Context | Example |
|---|---|
| .NET / C# | System.Guid.NewGuid() |
| SQL Server | UNIQUEIDENTIFIER type, NEWID() |
| Visual Studio | Project GUIDs in .sln files |
| COM / DCOM | Interface IDs, Class IDs |
| Windows Registry | Component registration |
| PowerShell | [guid]::NewGuid() |
Both
Some contexts use the terms interchangeably:
- MySQL documentation mentions both "UUID" (the function) and "GUID" in explanations
- Stack Overflow questions often use them synonymously
- API documentation varies by the author's background
Generate either one — they're the same thing — at createuuid.com.
Cross-Platform Gotchas
.NET to PostgreSQL
// C# generates a GUID
var id = Guid.NewGuid();
// When sent to PostgreSQL as a UUID parameter, the driver handles conversion
// But if you manually convert to bytes, watch the endianness!
byte[] bytes = id.ToByteArray(); // Mixed-endian!
// For RFC-compliant byte order:
byte[] rfcBytes = new byte[16];
// Swap first 4 bytes
rfcBytes[0] = bytes[3]; rfcBytes[1] = bytes[2];
rfcBytes[2] = bytes[1]; rfcBytes[3] = bytes[0];
// Swap bytes 4-5
rfcBytes[4] = bytes[5]; rfcBytes[5] = bytes[4];
// Swap bytes 6-7
rfcBytes[6] = bytes[7]; rfcBytes[7] = bytes[6];
// Copy remaining bytes
Array.Copy(bytes, 8, rfcBytes, 8, 8);
SQL Server to Web API
SQL Server's UNIQUEIDENTIFIER stores bytes in Microsoft's mixed-endian format. When exposing these in a JSON API, the string representation is identical to a UUID. No conversion needed for strings — only for binary comparisons.
Java to .NET
Java's java.util.UUID and .NET's System.Guid both work with the string format transparently. Issues only arise when comparing binary representations directly.
Should I Call It GUID or UUID?
Use the term that matches your audience:
- Writing for .NET developers? Say GUID.
- Writing an RFC, API documentation, or cross-platform guide? Say UUID.
- In a database context? Follow the database's terminology — PostgreSQL says UUID, SQL Server says UNIQUEIDENTIFIER (but calls them GUIDs in documentation).
- In casual conversation? Either works. Most developers understand both.
When being precise in technical documentation, UUID is the more correct and universal term since it refers to the actual standard (RFC 9562). GUID is a vendor-specific term for the same specification.
Other Identifier Formats
If you're evaluating unique identifier options, here's how GUIDs/UUIDs compare to alternatives:
| Format | Size | Sortable | Standard | Use Case |
|---|---|---|---|---|
| UUID v4 | 128-bit | No | RFC 9562 | General purpose |
| UUID v7 | 128-bit | Yes | RFC 9562 | Database PKs |
| ULID | 128-bit | Yes | Community spec | Time-sorted IDs |
| Nanoid | Configurable | No | Community | Short URL-safe IDs |
| Snowflake ID | 64-bit | Yes | Twitter/Discord | High-throughput distributed |
| KSUID | 160-bit | Yes | Segment | K-sortable unique IDs |
| CUID2 | Variable | Yes | Community | Secure, collision-resistant |
Each serves a slightly different need. UUIDs have the broadest ecosystem support and standardization. For a deeper dive into UUID versions, see our UUID versions guide.
Frequently Asked Questions
Are GUID and UUID exactly the same thing?
Functionally, yes. Both are 128-bit identifiers with the same string format. The only technical difference is byte ordering in the binary representation — Microsoft uses mixed-endian, while the RFC standard uses big-endian. In string form, they're identical and fully interchangeable.
Can I use a GUID generated in C# as a UUID in PostgreSQL?
Absolutely. When passed as a string ("550e8400-e29b-41d4-a716-446655440000"), a .NET Guid works perfectly as a PostgreSQL UUID. The database driver handles conversion automatically. Just avoid manually converting to binary bytes without accounting for endianness differences.
Why did Microsoft create a different name instead of using UUID?
Microsoft developed the GUID concept around the same time as the UUID specification was being formalized. The COM architecture needed unique identifiers for its own purposes, and Microsoft used its own branding. By the time RFC 4122 standardized the term UUID, GUID was already deeply embedded in the Windows ecosystem.
Does the endianness difference cause real bugs?
It can, but only in specific scenarios: binary comparison between a GUID from SQL Server and a UUID from PostgreSQL, or when reading binary GUID data from Windows registry entries in cross-platform tools. In string form, there is no difference and no risk of bugs. Most modern applications use string representations, so this rarely matters in practice.
Which term should I use in my API documentation?
Use UUID. It's the RFC-standard term recognized across all platforms and languages. Even in .NET-heavy teams, external API documentation should use the universal terminology. Your .NET developers will understand "UUID" — not everyone will know "GUID."
Generate UUIDs (or GUIDs, if you prefer) instantly at createuuid.com — free, no signup, multiple versions supported.