UUID / GUID Generator

Version 4 UUIDs from your browser's cryptographic RNG — not from a server, and not from Math.random.

    Click any UUID to copy just that one.

    Runs in your browser. Everything you type or load here is processed locally by JavaScript on this page. Nothing is uploaded to Tooltrusty or to any third party.

    What the uUID / GUID Generator does

    A UUID is a 128-bit identifier written as 32 hexadecimal digits in five hyphen-separated groups. Its purpose is to let independent systems create identifiers that will not collide without having to coordinate through a central authority — which is why they show up everywhere from database primary keys to file names to correlation IDs in distributed logs.

    Version 4 is the common one: 122 of the 128 bits are random, with the remaining six fixed to mark the version and variant. The randomness here comes from crypto.getRandomValues (or crypto.randomUUID where available), your browser's cryptographically secure random number generator — not from Math.random, which is predictable and unsuitable for identifiers that must not be guessable.

    Version 7 is newer and solves a real problem with version 4. Random UUIDs arrive in no particular order, which makes them poor database primary keys: every insert lands in a random position in the index, causing page splits and fragmentation. Version 7 puts a millisecond timestamp in the leading 48 bits and fills the rest with randomness, so identifiers generated later sort after ones generated earlier while remaining effectively unique. If you are choosing a key type for a new table today, v7 is usually the better choice.

    The format options cover the conventions different platforms expect: lowercase with hyphens is the RFC standard, uppercase in braces is the Microsoft GUID convention, no hyphens is common in URLs and file names, and the URN form appears in XML and RDF.

    How to use it

    1. Set how many identifiers you need, from 1 to 1,000.
    2. Choose version 4 for general use, or version 7 if these will be database keys.
    3. Pick the format your target platform expects.
    4. Click a single UUID to copy it, or use Copy all or Download .txt for the whole list.

    A worked example

    Three generated identifiers, one of each type:

    v4    9f2c7b1e-4a83-4d6f-b2e1-7c5a9d3f80a4
    v7    0192c4f3-8b21-7e5c-9d04-1a7b3e6f2c80
    nil   00000000-0000-0000-0000-000000000000

    Look at the fourth character of the third group: 4 in the first, 7 in the second. That digit is the version, and it is how you can tell at a glance what kind of UUID you are looking at. The nil UUID is all zeros and is reserved to mean “no value” — useful as a sentinel in a column that cannot be null.

    Generate two v7 UUIDs a second apart and sort them as strings: they come out in the order they were created. Do the same with v4 and the order is arbitrary. That is the whole argument for v7 as a primary key.

    Frequently asked questions

    Can two UUIDs ever be the same?

    In theory yes, in practice no. A version 4 UUID has 122 random bits. To reach a 50% chance of a single collision you would need to generate roughly 2.7 × 1018 of them — about a billion per second for 85 years. The realistic risk is a faulty random source, not the mathematics.

    Are these generated on a server?

    No. They are generated in your browser by the Web Crypto API. Nothing is transmitted, which also means nobody logs which identifiers you generated — worth knowing if they are going to be used as secrets or access tokens.

    Should I use UUIDs as database primary keys?

    It depends. They avoid coordination between services and do not leak row counts, but they are 16 bytes rather than 4 or 8, and random v4 values fragment B-tree indexes. Version 7 fixes the fragmentation by being time-ordered, which makes it a much better default for new tables.

    What is the difference between a UUID and a GUID?

    Nothing substantive. GUID is Microsoft's name for the same 128-bit identifier. The only differences are conventional: Microsoft tooling often writes them in uppercase inside braces, which this tool can produce.