What is a GUID?
A GUID (Globally Unique Identifier) is Microsoft's name for a 128-bit UUID: a value used to identify resources uniquely without a central authority. It is defined by the same standard as the UUID, RFC 9562, and its canonical form is 32 hexadecimal digits in five hyphen-separated groups, like
3f2504e0-4f89-41d3-9a0c-0305e82c3301.
A GUID generator online gives you a fresh identifier the moment you need one, whether you are seeding a database, wiring up a COM component, or filling in a [Guid("...")] attribute in C#. Most developers reach for a web tool, copy the value, and move on. That works. But GUIDs carry more nuance than the copy button suggests: casing rules, brace conventions, sequential variants, and a privacy question that most online generators never mention.
This guide covers what a GUID actually is, the format variations you will run into, how to generate one in every major language, and when an offline generator is the safer choice.
Table of contents
- GUID vs UUID: same thing, different name
- GUID formats you will actually encounter
- How to generate a GUID in code
- The empty GUID and sequential GUIDs
- Why an online GUID generator can be a privacy risk
- Generate GUIDs offline with SelfDevKit
- Frequently asked questions
GUID vs UUID: same thing, different name
A GUID and a UUID are the same 128-bit structure. The difference is cultural, not technical. Microsoft coined "GUID" for its COM and Windows platforms in the 1990s, while the rest of the industry standardized on "UUID" through the IETF. If you work in .NET, SQL Server, or the Windows registry, you will see "GUID." If you work in Java, Python, or PostgreSQL, you will see "UUID." The bytes are identical.
Because they share RFC 9562 (published May 2024, replacing RFC 4122), everything true of a UUID is true of a GUID. That includes the version scheme. Most GUIDs you generate today are version 4, meaning they are random. Guid.NewGuid() in .NET produces a v4 value: 122 random bits plus 6 fixed bits for the version and variant.
That randomness is the whole point. Two machines can each mint a GUID with no coordination and the odds of a collision are effectively zero. If you want the full breakdown of versions, alternatives like ULID and NanoID, and the actual collision math, our UUID generator guide goes deep on all of it. This article focuses on the GUID-specific details that Microsoft-stack developers hit every day.
GUID formats you will actually encounter
A GUID is always 128 bits, but it can be printed in several string formats. .NET exposes these through format specifiers on Guid.ToString, and knowing them saves you from writing string manipulation to add or strip braces. The five standard specifiers are documented by Microsoft Learn:
| Specifier | Output |
|---|---|
N |
00000000000000000000000000000000 (32 digits, no separators) |
D |
00000000-0000-0000-0000-000000000000 (hyphenated, the default) |
B |
{00000000-0000-0000-0000-000000000000} (hyphenated, braces) |
P |
(00000000-0000-0000-0000-000000000000) (hyphenated, parentheses) |
X |
{0x00000000,0x0000,0x0000,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}} (hex object) |
A few practical notes. The D format is the default; calling ToString() with no argument gives you the hyphenated value with no braces. The B format with curly braces is what the Windows registry uses, so when you register a COM class or paste into a .reg file, you want braces. The X format is the C/C++ struct initializer form, rarely used in application code but occasionally needed for interop.
Casing matters too. .NET always returns lowercase hexadecimal digits. Visual Studio's Create GUID tool and many registry entries use uppercase. Neither is more correct, but consistency inside a single system prevents string comparison bugs. If a lookup fails and the values "look" identical, check the case before anything else.
A good GUID generator lets you produce the format you need directly, so you are not hand-editing braces or running ToUpper() on copied output.
How to generate a GUID in code
To generate a GUID in code, call your language's built-in UUID function; nearly every runtime ships one, and none require a network call. Here are the idiomatic ways across the stacks where "GUID" is the common term.
C# / .NET:
Guid id = Guid.NewGuid();
Console.WriteLine(id); // 3f2504e0-4f89-41d3-9a0c-0305e82c3301
Console.WriteLine(id.ToString("N")); // no hyphens
Console.WriteLine(id.ToString("B")); // braces for the registry
PowerShell:
[guid]::NewGuid()
# or, to get an uppercase braced string:
"{$([guid]::NewGuid().ToString().ToUpper())}"
SQL Server (T-SQL):
SELECT NEWID(); -- random GUID
SELECT NEWSEQUENTIALID(); -- sequential, only valid as a column default
JavaScript / TypeScript (browser or Node 19+):
const id = crypto.randomUUID();
// '3f2504e0-4f89-41d3-9a0c-0305e82c3301'
Python:
import uuid
print(uuid.uuid4()) # 3f2504e0-4f89-41d3-9a0c-0305e82c3301
Every one of these runs locally and produces an RFC 9562 version 4 value. If you only need one identifier while writing code, generating it in a REPL is fine. The reason developers keep an online GUID generator bookmarked is for the times they are not in a runtime: filling in config files, writing documentation, seeding test fixtures, or grabbing a batch of fifty at once. That is where a dedicated tool wins on speed.
The empty GUID and sequential GUIDs
The empty GUID is 00000000-0000-0000-0000-000000000000, and it is a real, valid value with a specific meaning. In .NET it is Guid.Empty; in code it usually signals "no value assigned yet." Treating the empty GUID as if it were a generated identifier is a classic bug. If you insert a row and the ID comes back as all zeros, your generator did not run and you saved a default.
Sequential GUIDs are the other variant worth understanding, because they solve a genuine performance problem. A purely random GUID (v4) makes a terrible clustered primary key in SQL Server. Because new values land at random positions in the B-tree index, the database constantly splits pages, fragments the index, and thrashes the buffer cache. On a high-insert table this is measurable.
Two fixes exist. SQL Server's NEWSEQUENTIALID() generates GUIDs that increase monotonically, so inserts append to the end of the index instead of scattering. The modern, cross-platform answer is UUID version 7, which embeds a Unix millisecond timestamp in the high bits so the values sort by creation time. If you are choosing an identifier for a new table today, prefer a time-ordered value over random v4. The UUID generator guide covers the v7 layout and the index fragmentation math in detail.
To inspect a GUID you already have, whether to read its version bits or confirm it is not the empty value, the ID analyzer decodes the structure without you counting nibbles by hand.

Why an online GUID generator can be a privacy risk
Most online GUID generators run entirely in your browser using JavaScript, which means the value never leaves your machine. That is genuinely fine, and reputable tools advertise it. The risk is that you cannot verify the claim, and not every site behaves the same way.
Consider what actually happens when you open a random generator tab:
- The page loads third-party analytics and ad scripts that can read anything on the page.
- Some "generator" tools call a backend API to produce the value, which sends your context to their server.
- Batch generators sometimes log requests for rate limiting or abuse prevention.
- You have no way to audit whether a future version of the site changes any of this.
For a throwaway GUID this is harmless. The concern grows when the identifier is meaningful: a namespace GUID that maps to a customer, a license key seed, a value you are pasting alongside other sensitive fixture data. In regulated environments, a policy may simply forbid pasting internal identifiers into external websites at all, regardless of how the tool claims to work.
A local tool sidesteps the entire question. There is no page to trust, no script to audit, no request to intercept. This is the same reasoning behind keeping any generator offline, whether for secrets and API keys or passwords, where the cost of a leak is far higher than a convenience tab is worth. We wrote about the broader trade-off in why offline developer tools matter.
Generate GUIDs offline with SelfDevKit
SelfDevKit's ID Generator creates GUIDs, UUIDs (v1, v4, v7), ULIDs, NanoIDs, and KSUIDs entirely on your device. Nothing is transmitted, so it works on an air-gapped machine and leaves no trace on any server. You pick the type and the quantity, and copy the result with one click.
For everyday GUID work it covers the cases an online tool does:
- Batch generation. Need fifty GUIDs for a seed script? Generate them all at once instead of clicking refresh fifty times.
- One-click copy. Grab a single value or the whole batch.
- Format-ready output. Produce the canonical hyphenated form and adjust for your target, whether that is a C# attribute, a
.regfile, or a database default. - Related tooling in the same app. The ID analyzer decodes any GUID you paste in, and the hash generator covers the adjacent job of deriving deterministic values.
It is part of a single desktop app with 50+ tools, a one-time purchase with no subscription, running natively on macOS, Windows, and Linux.
Frequently asked questions
Is a GUID the same as a UUID?
Yes. GUID (Globally Unique Identifier) is Microsoft's term and UUID (Universally Unique Identifier) is the industry-standard term, but both describe the same 128-bit value defined by RFC 9562. You will see "GUID" in .NET, SQL Server, and Windows contexts and "UUID" almost everywhere else.
Should GUIDs be uppercase or lowercase?
Neither is more correct. .NET generates lowercase, while Visual Studio's Create GUID tool and the Windows registry often use uppercase. Pick one convention per system and stick to it, because mixed casing causes string comparison bugs when values that are byte-identical fail an equality check.
Are GUIDs guaranteed to be unique?
Not guaranteed, but the collision probability for random (v4) GUIDs is so small it is treated as zero in practice. You would need to generate billions of GUIDs before the odds of a single collision become meaningful. The exact math is covered in our UUID generator guide.
Can I generate a GUID without an internet connection?
Yes. Every major language has a built-in function (Guid.NewGuid(), crypto.randomUUID(), uuid.uuid4()) that runs locally, and a desktop tool like the SelfDevKit ID Generator produces GUIDs fully offline with no data leaving your machine.
Try it yourself
Skip the untrusted tab. Generate GUIDs, inspect them, and grab a batch of fifty without a single network request.
Download SelfDevKit: 50+ developer tools, offline and private.


