GUID generator

Random GUIDs in every .NET format, ready to paste into C#, SQL Server, config files or C++. Same algorithm as Guid.NewGuid(), run in your browser.

Need time-ordered IDs for a database key? Use UUID v7 on the UUID generator.

GUIDs

Press generate to fill this table.

Generating GUIDs in code

PlatformCall
C# / .NETGuid.NewGuid(); .NET 9+ adds Guid.CreateVersion7()
SQL ServerNEWID() or NEWSEQUENTIALID() as a column default
PowerShell[guid]::NewGuid() or New-Guid
JavaScriptcrypto.randomUUID()
Visual StudioTools → Create GUID

The X format matches the DEFINE_GUID style struct initialiser used in COM and Windows driver code.

Questions people ask

What is a GUID?

A GUID (globally unique identifier) is Microsoft’s name for a 128-bit UUID. The random GUIDs generated here are RFC 9562 version 4 UUIDs, exactly what Guid.NewGuid() returns in .NET and NEWID() returns in SQL Server.

What do the format letters N, D, B and P mean?

They are .NET Guid.ToString format specifiers: N is 32 digits with no hyphens, D is hyphenated (the default), B wraps it in braces, P in parentheses, and X is the hexadecimal struct form used in C and C++ source.

Are GUIDs case-sensitive?

No. The hex digits compare equal in either case. Windows tools often display uppercase, while RFC 9562 recommends lowercase output. Pick whatever your codebase already uses.

Can I use a GUID as a SQL Server primary key?

You can, but random GUIDs fragment clustered indexes. Use NEWSEQUENTIALID() in SQL Server, or time-ordered UUID v7 values, when insert performance matters.

Related generators