Home / Developer tools / GUID generator

GUID Generator

Generate GUIDs the way Windows and .NET write them: uppercase, with braces or without. One click gives a new random GUID, and you can make up to 1,000.

Try:

Made in your browser with the secure random generator. Nothing is sent to our server or stored.

GUID and UUID are the same thing

GUID means Globally Unique Identifier, the name Microsoft uses for what the rest of the industry calls a UUID. Both are 128-bit values written as 32 hex digits. In Windows and .NET, Guid.NewGuid(), PowerShell's New-Guid and SQL Server's NEWID() create random (version 4) values, and the GUID generator here does the same. You can also choose version 7 for GUIDs that sort in time order.

GUID formats in Windows and .NET

.NET formatExampleSetting here
D (default)6F9619FF-8B86-D011-B42D-00C04FC964FFStandard, uppercase on or off
N6F9619FF8B86D011B42D00C04FC964FFNo hyphens
B{6F9619FF-8B86-D011-B42D-00C04FC964FF}In braces
P(6F9619FF-8B86-D011-B42D-00C04FC964FF)Braces, then change to parentheses by hand

Note that .NET's Guid.ToString() writes lowercase by default, while the Windows registry, COM class ids (CLSID), installer product codes and Visual Studio project files traditionally show uppercase in braces. Both mean the same value, but some tools compare them as text, so keep one style.

Use a new GUID in .NET, PowerShell and SQL

// C#
Guid id = Guid.NewGuid();
string s = id.ToString("B").ToUpperInvariant();     // {XXXXXXXX-XXXX-...}
Guid v7 = Guid.CreateVersion7();                     // .NET 9 and later
Guid.TryParse(text, out Guid parsed);

# PowerShell
[guid]::NewGuid()
New-Guid

-- SQL Server
SELECT NEWID();                                      -- random
-- column with a default: id uniqueidentifier DEFAULT NEWSEQUENTIALID()

// Visual Basic
Guid.NewGuid().ToString("B")

Things that surprise people

  • Byte order. .NET stores the first three groups of a GUID in little-endian order. Guid.ToByteArray() therefore returns bytes in a different order from the text. If you move GUIDs between .NET and a system that reads the text form as big-endian bytes (Java, Python, databases), convert them rather than copying bytes.
  • SQL Server sorting. uniqueidentifier columns sort by the last 6 bytes first. A random GUID as a clustered key fragments the table, which is why NEWSEQUENTIALID() exists. It can only be used as a column default, and it is predictable.
  • Empty GUID. Guid.Empty is 00000000-0000-0000-0000-000000000000, the Nil UUID. It often means "not set", so do not generate it by accident.
  • Not a secret. A GUID is an identifier. Use cryptographic tokens for secrets.

Check a GUID

Paste a GUID in braces or without into the UUID validator to see if it is valid and which version it is. For UUIDs in other styles and versions, use the main UUID generator, or read the guide What is a UUID?

Frequently asked questions

What is a GUID?

A Globally Unique Identifier, the Microsoft name for a UUID. It is a 128-bit value written as 32 hex digits.

How do I create a GUID in C#?

Use Guid.NewGuid(). In .NET 9 and later you can use Guid.CreateVersion7() for a time-ordered GUID.

Are GUIDs uppercase or lowercase?

Both are valid and equal. .NET writes lowercase by default, and the Windows registry and COM usually show uppercase in braces.

How do I generate a GUID in SQL Server?

Use NEWID() for a random GUID, or NEWSEQUENTIALID() as a column default for GUIDs that increase.

Is a GUID the same as a UUID?

Yes. The name differs, the format and the versions are the same.