UUID UUID Generator

Free · No signup · No install

GUID vs UUID

Short answer: nothing. A GUID and a UUID are the same 128-bit value, byte for byte. “GUID” is Microsoft's name for it, “UUID” is the name used by RFC 9562 and everyone else — the difference is convention and spelling, not substance.

  • Same 128 bits
  • Two names, one format
  • One real difference

GUID Generator

GUID
Between 1 and 1000.
Formatting

Result 0

    Generated locally with the Web Crypto API — nothing leaves your browser. Shortcut: Ctrl + Enter — Regenerated

    What is a GUID vs UUID

    The story is one of timing. When Microsoft added globally unique identifiers to COM in the early 1990s, the term GUID was already in use internally, and it stuck through OLE, Active Directory, the Windows registry and .NET. The RFC line of documents standardised the same structure as a UUID. Both describe a 128-bit number, and both are written as 32 hex digits in the 8-4-4-4-12 grouping. Convert one to the other and not a single bit changes.

    What differs is presentation. Microsoft's ecosystem tends to write GUIDs in upper case and inside braces{4C6E0549-82B1-47B0-9479-211A64583258} — because that is the format the .NET Guid.ToString("B") format specifier produces and the format SQL Server's management tools display. The RFC format is lower case with no braces. Parsers are case-insensitive and almost all accept the braced form, so this is cosmetic; but it is the reason two people can compare the same value and think they are looking at different things.

    The one place the distinction is real is sort order. SQL Server's uniqueidentifier type compares the last six bytes before the rest, so ordering a column of GUIDs does not give you insertion order or alphabetical order — it gives you an order that looks random until you know the rule. This is a property of that column type, not of the GUID itself, and it is why a v7 GUID (or a BINARY(16) with your own comparison) matters when insertion order has to match index order.

    How to

    1. Need a value for a .NET Guid, a SQL Server column or a COM interface? Generate it here and paste it — braces and upper case are one checkbox away.
    2. Comparing two identifiers that look different, one braced and one not? Strip the braces and hyphens and lower-case both before comparing; if the 32 hex digits match, the values are identical.
    3. Storing GUIDs in SQL Server and ordering by them? Do not assume the order means anything. Add an explicit creation column, or use v7 values generated in the application.

    Use cases

    • .NET and Windows development, where the API surface says Guid and the tooling displays braces.
    • SQL Server tables, where the column type is called uniqueidentifier and accepts either spelling.
    • Cross-platform APIs, where the value leaves Microsoft's world and becomes a UUID again — the same bytes, a different label.

    Compare GUID vs UUID with other formats

    OptionWhen to use
    GUIDMicrosoft's name. Typically written {UPPER-CASE} with braces.
    UUIDRFC 9562's name. Written lower case with hyphens and no braces.
    The valueIdentical. 128 bits, 16 bytes, 32 hex digits.
    SQL Server uniqueidentifierSorts by its last six bytes first — not insertion order.
    ParsingCase-insensitive; both braced and unbraced forms are accepted.

    Code examples

    C# / .NET

    // random, equivalent to UUID v4
    Guid a = Guid.NewGuid();
    
    // time-ordered (v7), .NET 9+
    Guid b = Guid.CreateVersion7();
    
    // the three common string shapes
    a.ToString("D");   // 4c6e0549-82b1-47b0-9479-211a64583258
    a.ToString("B");   // {4c6e0549-82b1-47b0-9479-211a64583258}
    a.ToString("N");   // 4c6e054982b147b09479211a64583258
    
    // all three parse back to the same value
    Guid.Parse(a.ToString("N")) == a;   // true

    Python / anywhere else

    import uuid
    
    # This is what .NET calls a GUID.
    u = uuid.uuid4()
    print(u)         # 4c6e0549-82b1-47b0-9479-211a64583258
    print(u.hex)     # 4c6e054982b147b09479211a64583258
    print(u.bytes)   # b'Ln\x05I\x82\xb1G\xb0\x94y!\x1aeX2X'  (16 bytes)
    
    # A braced string from .NET parses unchanged.
    uuid.UUID('{4C6E0549-82B1-47B0-9479-211A64583258}')

    SQL Server

    -- generate
    SELECT NEWID();                        -- random, equivalent to v4
    SELECT NEWSEQUENTIALID();              -- ordered, only valid as a column default
    
    -- compare without worrying about braces, case or hyphens
    SELECT *
    FROM   dbo.orders
    WHERE  CONVERT(uniqueidentifier, @id) = order_id;
    
    -- and remember: ORDER BY a uniqueidentifier column is not creation order

    Frequently asked questions

    Is a GUID exactly the same as a UUID?

    Yes. The two terms describe the same 128-bit identifier. A GUID produced by Guid.NewGuid() is a valid UUID v4, and a UUID v4 produced anywhere else is a valid .NET Guid. The only reason both names survive is that Microsoft had already shipped the acronym before the RFC vocabulary spread.

    Why are GUIDs written in upper case with braces?

    It is the .NET "B" format and what SQL Server's tooling shows. Nothing in the format requires it — comparison is case-insensitive — and the same value round-trips through the unbraced lower-case form without loss.

    Are GUIDs less unique than UUIDs?

    No. Versions and entropy are properties of the format, not the name: a v4 GUID has the same 122 random bits as a v4 UUID, and would collide with it at exactly the same rate. If a system produces weak identifiers, the problem is in how it generates them, not in what it calls them.