Your GUID UUID — Click to copy
UUID Anatomy
What is GUID?
GUID Generator — Complete Guide
A GUID (Globally Unique Identifier) is Microsoft's name for UUID. It uses exactly the same 128-bit format, follows the same RFC standard (RFC 9562), and is completely interchangeable with a UUID. Microsoft introduced the term GUID in the context of COM (Component Object Model) and Windows APIs in the early 1990s. In practice, GUIDs are generated as UUID v4 — using cryptographically secure random numbers. They are typically displayed in uppercase, often wrapped in curly braces: {XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}.
RFC 9562 Definition: GUIDs use the same structure as UUID v4: 122 bits of cryptographically random data with 4 bits for the version (0100) and 2 bits for the variant (10). The only practical difference from UUID is that GUIDs are conventionally displayed in uppercase and may be wrapped in curly braces in some Microsoft contexts.
When to Use GUID
Use GUIDs when working with Microsoft technologies: .NET and C# applications using Guid.NewGuid(), Microsoft SQL Server UNIQUEIDENTIFIER columns, COM and Windows API programming, Azure services and Microsoft cloud APIs, and Visual Studio project and solution files. If you are working outside Microsoft technologies, UUID is the standard term and format.
Advantages
- ✅ Identical to UUID — universally compatible
- ✅ Native .NET Guid type
- ✅ SQL Server UNIQUEIDENTIFIER support
- ✅ Multiple display format options in .NET
- ✅ Widely understood in enterprise environments
Considerations
- ⚠️ Microsoft-specific terminology can cause confusion
- ⚠️ Random GUIDs cause SQL Server index fragmentation (use NEWSEQUENTIALID)
- ⚠️ Should use UUID terminology in cross-platform contexts
UUID Structure
| Field | Bits | Description |
|---|---|---|
| Data1 | 32 bits | Random — displayed as 8 hex chars |
| Data2 | 16 bits | Random — displayed as 4 hex chars |
| Data3 | 16 bits | Version (4) + 12 random bits |
| Data4 | 64 bits | Variant (2 bits) + 62 random bits |
| Total | 128 bits | 16 bytes — 36 chars with hyphens |
Code Examples
C# / .NET
// Generate a new GUID Guid myGuid = Guid.NewGuid(); Console.WriteLine(myGuid); // → 3f2504e0-4f89-11d3-9a0c-0305e82c3301 // Format options myGuid.ToString("D"); // Standard: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx myGuid.ToString("N"); // No hyphens: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx myGuid.ToString("B"); // Braces: {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx} myGuid.ToString("P"); // Parens: (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx)
SQL Server
-- UNIQUEIDENTIFIER column CREATE TABLE Users ( Id UNIQUEIDENTIFIER DEFAULT NEWSEQUENTIALID() PRIMARY KEY, Name NVARCHAR(100) ); -- Generate inline SELECT NEWID(); -- random GUID (v4) SELECT NEWSEQUENTIALID(); -- sequential GUID (better for indexes)
PowerShell
# Generate GUID in PowerShell [System.Guid]::NewGuid().ToString() # Or shorter (New-Guid).Guid # Uppercase with braces "{$((New-Guid).Guid.ToUpper())}"
Python
import uuid # GUID is same as UUID v4, just displayed differently guid = uuid.uuid4() # Standard format print(str(guid).upper()) # With braces (Windows-style) print(f"{{str(guid).upper()}}")
Frequently Asked Questions
What is the difference between GUID and UUID? ▾
Nothing — they are identical. GUID is Microsoft's term for UUID. Both use the same 128-bit format and follow RFC 9562. The terms are completely interchangeable. In .NET and Windows environments, "GUID" is the conventional term; in Linux, web, and cross-platform environments, "UUID" is more common.
Should I use NEWID() or NEWSEQUENTIALID() in SQL Server? ▾
Use NEWSEQUENTIALID() for primary keys in SQL Server. NEWID() generates a random GUID (v4) which causes index fragmentation. NEWSEQUENTIALID() generates GUIDs that increase sequentially, avoiding page splits. Note: NEWSEQUENTIALID() can only be used as a DEFAULT constraint, not called directly.
Are GUIDs case-sensitive? ▾
No. GUIDs and UUIDs are hexadecimal and are case-insensitive — A1B2C3D4... and a1b2c3d4... refer to the same identifier. However, when comparing GUIDs as strings, always normalise to the same case first to avoid false mismatches.
Can I use a UUID where a GUID is expected? ▾
Yes. Since they are the same format, any valid UUID v4 can be used as a GUID and vice versa. SQL Server UNIQUEIDENTIFIER columns accept standard UUID/GUID format.
Related Tools