Password Generator

Online GUID Generator

Generate Globally Unique Identifiers for .NET, C# & SQL
{7D4A0762-FE18-4D91-AB00-508D0DF283FA}
Format:

Bulk GUID Generator

What Is a GUID (Globally Unique Identifier)?

A GUID (Globally Unique Identifier) is a 128-bit integer used to uniquely identify components, interfaces, database records, and software objects across distributed systems. The term GUID is popularized by Microsoft and is synonymous with the internet standard UUID (Universally Unique Identifier) specified in RFC 4122 and RFC 9562.

In Microsoft environments (such as C#, VB.NET, PowerShell, the Windows Registry, and SQL Server), GUIDs are commonly rendered in uppercase with enclosing curly braces:

{21EC2020-3AEA-1069-A2DD-08002B30309D}

GUID vs UUID: Are They Identical?

Yes. Technically, GUID is Microsoft's implementation of the distributed computing environment (DCE) UUID specification. Every standard GUID conforms to UUID formats. The default generator above produces Version 4 random GUIDs, which contain 122 cryptographically secure random bits, guaranteeing that accidental duplication is mathematically negligible.

How to Generate a GUID in Code

Here is how to generate GUIDs directly within Microsoft programming environments:

1. C# / .NET

Generate a standard random GUID (Version 4):

// .NET / C#
Guid randomGuid = Guid.NewGuid();
Console.WriteLine(randomGuid.ToString());       // "d3b07384-d113-4311-bf32-f3f26019ceef"
Console.WriteLine(randomGuid.ToString("B"));   // "{D3B07384-D113-4311-BF32-F3F26019CEEF}"
Console.WriteLine(randomGuid.ToString("N"));   // "d3b07384d1134311bf32f3f26019ceef"

// .NET 9+ (RFC 9562 UUID Version 7 - Time-ordered)
Guid v7Guid = Guid.CreateVersion7();

2. PowerShell

Generate a new GUID from PowerShell console or scripting:

# PowerShell 5.1+ / Core
[guid]::NewGuid()

# Formatted with braces
[guid]::NewGuid().ToString("B")

3. Microsoft SQL Server (T-SQL)

Generate a GUID within database queries, tables, or stored procedures:

-- Random GUID (NEWID)
SELECT NEWID() AS RandomGuid;

-- Table definition with auto-generated GUID primary key
CREATE TABLE CustomerAccounts (
    AccountId UNIQUEIDENTIFIER PRIMARY KEY DEFAULT NEWID(),
    AccountName NVARCHAR(100) NOT NULL
);

-- Sequential GUID for optimized index insertion performance
CREATE TABLE Orders (
    OrderId UNIQUEIDENTIFIER PRIMARY KEY DEFAULT NEWSEQUENTIALID(),
    TotalAmount DECIMAL(18,2) NOT NULL
);

Common GUID Formats in Windows & .NET

The .NET Guid.ToString(format) method provides several standard string representations:

  • "D" (Default): 00000000-0000-0000-0000-000000000000 (32 digits separated by hyphens)
  • "B" (Braces): {00000000-0000-0000-0000-000000000000} (Common in COM and Windows Registry)
  • "P" (Parentheses): (00000000-0000-0000-0000-000000000000)
  • "N" (None): 00000000000000000000000000000000 (32 hexadecimal digits without hyphens)
  • "X" (Hex structure): {0x00000000,0x0000,0x0000,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}}