Generate Random GUID

random
Loading feedback…

Generate random version 4 GUIDs for .NET, C#, SQL Server, Windows, tests, and application data. Choose a Microsoft GUID format, set the letter case, and create up to 100 identifiers at once.

Last updated: August 2, 2026Author: Mateo DíazReviewed by: Riley Williams
Generate Random GUID
In-browser
Generate random GUIDs in standard Microsoft formats

Options

1
Characters: 0Words: 0Sentences: 0Lines: 0

A pair of curly braces can be enough to break a paste into a strict form field. Pick the shape your software expects, choose the letter case, then generate one GUID or a clean batch of 100.

When you generate a random GUID here, everything runs in your browser. The values do not need to travel to a server first.

Pick the GUID format your code expects

Microsoft's Guid.ToString() recognizes five format specifiers. D is the familiar default, while N works well in compact fields where hyphens are unwanted. B and P add wrappers that appear in Windows tooling and configuration files.

And X is the odd one. It expands the same 128-bit value into a hexadecimal structure that resembles a C initializer (useful when an older API asks for that exact representation).

FormatExampleCommon fit
D6f9619ff-8b86-d011-b42d-00c04fc964ff.NET, C#, SQL Server
N6f9619ff8b86d011b42d00c04fc964ffCompact text fields
B{6f9619ff-8b86-d011-b42d-00c04fc964ff}Windows tools and config
P(6f9619ff-8b86-d011-b42d-00c04fc964ff)Systems expecting parentheses
X{0x6f9619ff,0x8b86,0xd011,{...}}C-style GUID structures

Microsoft documents all five in its GUID formatting reference.

How to generate random GUIDs

  1. Set Number of GUIDs. One is enough for a new record; a batch can seed fixtures or test imports.
  2. Choose D, N, B, P, or X under GUID format.
  3. Pick lowercase or uppercase hexadecimal letters.
  4. Press Generate, then copy the output or download the text file.

Fresh values are created every time you press the button. So if you change a format after generating, press it again rather than expecting the old list to be reformatted.

What the generator creates

These are random version 4 identifiers. Under the hood, the browser supplies 16 random bytes, then the generator sets the version field to 4 and the RFC variant bits to 10. That leaves 122 random bits in each value, following the layout defined by RFC 9562.

Short version. The output is suitable for identifiers in application data, distributed jobs, fixtures, filenames, and API request tracing. A GUID still should not stand in for a password, session secret, or authorization check.

GUID examples in C# and SQL Server

For C#, the normal D output can be parsed directly.

Guid orderId = Guid.Parse("6f9619ff-8b86-d011-b42d-00c04fc964ff");

SQL Server's uniqueidentifier type accepts the same hyphenated form.

DECLARE @OrderId uniqueidentifier = '6f9619ff-8b86-d011-b42d-00c04fc964ff';

Use the native database type when it fits your schema. Storing the display string in varchar(36) takes more space, and case-sensitive text comparisons can create a strange duplicate-looking mess later (I have seen this surface in a CSV import with one uppercase row buried around line 18,400).

When UUID is the better search

GUID is the name you'll meet throughout Microsoft platforms. UUID is the standards term used across languages and operating systems, and both names often describe the same 128-bit value when written as text.

But the workflows drift. Use the UUID generator when you want the standard UUIDv4 form without Microsoft-specific wrappers. This page is built for GUID formatting and the copy-paste details surrounding .NET, SQL Server, COM, and Windows.

Common snags

  • Braces. The B format includes them on purpose, and some parsers require plain D output instead.
  • A rejected SQL value can come from pasting quotes or a trailing comma along with the GUID. Copy only the identifier unless your query template expects those characters.
  • Uppercase hexadecimal is valid for the same value. Your database collation or a string comparison may still treat upper- and lowercase text differently.
  • X output is long. That is expected; it represents the same value as a structure rather than as one compact string.

Related tools

Privacy and limits

Generation happens locally through the Web Crypto API, and the page does not need to send generated GUIDs to Textavia. Extensions, managed browser policies, clipboard managers, or anything else installed on your device may still observe what you copy.

The tool generates random version 4 values only. It does not check your database for existing IDs, create sequential GUIDs, or produce UUIDv7 values.

Frequently Asked Questions
It generates random version 4 GUIDs. The version and variant bits follow the UUIDv4 layout in RFC 9562, while the output can use Microsoft GUID string formats.
Choose D for the familiar hyphenated value used by default in .NET. N removes hyphens, B adds braces, P adds parentheses, and X produces the hexadecimal structure form accepted by Microsoft GUID parsers.
Yes. The D format works well with SQL Server uniqueidentifier values. Keep the value as a native uniqueidentifier when possible instead of storing the 36-character string in a general text column.
No. Generation runs in your browser with the Web Crypto API. Textavia does not need to upload the generated values to create them.
Do not rely on a GUID alone as a secret or authentication credential. Use a purpose-built session or authentication token for access control.