Blazor Lab

GUID Generator

Generate unique identifiers (GUIDs) in various formats.

GUID Format

D (Default) - xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx N - xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx B - {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx} P - (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx) X - {0x00000000,0x0000,0x0000,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}}

Case

Lowercase UPPERCASE
Generate GUID

Overview

The GUID Generator is a lightweight online tool built with Blazor (C#) that allows users to generate one or multiple GUIDs (Globally Unique Identifiers) instantly. It is designed for developers who need quick, correctly formatted identifiers for databases, APIs, configuration files, or application development.

The tool supports custom quantity, letter casing, and multiple output formats, making it flexible for different technical requirements.


What the Tool Does

The GUID Generator enables users to:

  • Generate one or many GUIDs at once
  • Choose between lowercase or uppercase output
  • Select from multiple GUID formats
  • Instantly copy the generated GUIDs for use in code or configuration

All GUIDs are generated using the standard .NET GUID generation mechanism, ensuring uniqueness and reliability.


How to Use the Tool

  1. Enter the Number of GUIDs

    • Specify how many GUIDs you want to generate (e.g. 1, 10, 100)
  2. Select Letter Casing

    • Choose Lowercase or Uppercase
  3. Choose Output Format

    • Pick the desired GUID format (see formats below)
  4. Generate

    • Click the Generate button
    • The GUIDs will appear in the output area, ready to copy

GUID Formats Explained

A GUID (Globally Unique Identifier) is a 128-bit value typically displayed as a hexadecimal string.

Common GUID Formats in .NET

Format Example Description
D 6f9619ff-8b86-d011-b42d-00cf4fc964ff Default format with hyphens
N 6f9619ff8b86d011b42d00cf4fc964ff Digits only, no separators
B {6f9619ff-8b86-d011-b42d-00cf4fc964ff} Enclosed in braces
P (6f9619ff-8b86-d011-b42d-00cf4fc964ff) Enclosed in parentheses
X {0x6f9619ff,0x8b86,0xd011,{0xb4,0x2d,0x00,0xcf,0x4f,0xc9,0x64,0xff}} Hexadecimal format (C-style)

Example: Generating GUIDs in C#

Below is an example showing how to implement your own GUID generator in C# with support for count, format, and letter casing.

1. GUID Generation Function

using System;
using System.Collections.Generic;

public static class GuidGenerator
{
    public static IEnumerable<string> Generate(
        int count,
        string format = "D",
        bool uppercase = false)
    {
        if (count <= 0)
            yield break;

        for (int i = 0; i < count; i++)
        {
            var guid = Guid.NewGuid().ToString(format);
            yield return uppercase
                ? guid.ToUpperInvariant()
                : guid.ToLowerInvariant();
        }
    }
}

2. Usage Example

var guids = GuidGenerator.Generate(
    count: 5,
    format: "N",
    uppercase: true
);

foreach (var guid in guids)
{
    Console.WriteLine(guid);
}

Output example:

E2C56DB5DFFB48D2B060D0F5A71096E0
A4F1E1C0E9C746D2A3C9A7E3A8F7D512
...

Why Use a GUID Generator?

  • Guarantees global uniqueness
  • Prevents key collisions in distributed systems
  • Ideal for database primary keys
  • Commonly used in APIs, microservices, and cloud applications
  • Fully supported and optimized in .NET

Common Use Cases

  • Database identifiers
  • API keys and request IDs
  • Correlation IDs for logging
  • Configuration and environment values
  • Test data generation

Conclusion

The GUID Generator provides a fast, flexible, and developer-friendly way to generate unique identifiers with precise control over format and casing. Whether you use the online Blazor tool or implement the logic yourself in C#, itโ€™s a reliable solution for everyday development needs.


An unhandled error has occurred. Reload ๐Ÿ—™