Last reviewed:
What is a UUID?
A UUID (universally unique identifier, also called a GUID in Microsoft ecosystems) is a 128-bit value written as 32 hexadecimal digits in five groups, for example 56e7d485-b897-45d9-bd3f-ff254ae110d3. The format is defined in RFC 9562, which in 2024 replaced the older RFC 4122. The point of a UUID is that anyone can create one, on any machine, without asking a central service, and still be confident it will not clash with any other UUID.
There are several versions. The first digit of the third group says which: in the example above it is 4. Version 4 UUIDs are 122 random bits plus 6 fixed bits for the version and variant. The first digit of the fourth group is always 8, 9, a or b, which marks the standard variant. Other versions embed a timestamp (v1, v6, v7) or are derived by hashing a name (v3, v5).
This tool generates version 4 UUIDs with crypto.randomUUID(), which draws from the browser's cryptographically secure random number generator. That makes them suitable for real use, not just placeholders. With 122 random bits, the chance of two of them ever colliding is negligible for any realistic workload.
How to use this tool
- A single UUID is shown at the top when the page loads. Click Copy to copy it or New UUID to generate another.
- For several at once, enter a number from 1 to 1000 in How many.
- Choose lowercase or UPPERCASE.
- Choose a wrapper: No wrapping, {braces} (the registry and .NET style), "double quotes" or 'single quotes'.
- Choose One per line or Comma separated (a comma at the end of every line except the last).
- Untick Hyphens to get the 32-character form without dashes.
- Click Generate (any option change also regenerates), then Copy all or Download the list as
uuids.txt.
Examples
Default output
56e7d485-b897-45d9-bd3f-ff254ae110d3
The 4 at the start of the third group marks version 4, and the b at the start of the fourth group marks the RFC variant.
Ready to paste into SQL
Three UUIDs with 'single quotes' and Comma separated give a list you can paste straight into a query (your values will be different, because they are random):
'5290e64a-a411-4718-8ecc-068b9d9a84c4',
'403b42d0-8a94-4964-a2c8-5e708e4f69f8',
'02fa89a5-25c3-4a40-9580-0457665431fa'
SELECT * FROM customers
WHERE id IN (
'5290e64a-a411-4718-8ecc-068b9d9a84c4',
'403b42d0-8a94-4964-a2c8-5e708e4f69f8',
'02fa89a5-25c3-4a40-9580-0457665431fa'
);
Formats side by side
lowercase, hyphens: 53ffaf33-c0e3-4b09-8dd2-98bb7301b316
UPPERCASE, braces: {53FFAF33-C0E3-4B09-8DD2-98BB7301B316}
no hyphens: 53ffaf33c0e34b098dd298bb7301b316
All three represent the same 128-bit value. Choose the one the receiving system expects; comparisons that treat UUIDs as plain strings will see them as different.
Common errors and how to fix them
- "Invalid UUID" from a database or API. Usually the format, not the value: braces, uppercase or a missing hyphen. PostgreSQL's
uuidtype accepts all of these, but many APIs and validation libraries only accept lowercase with hyphens. - String comparison fails for the same ID. One system stored
ABC…and anotherabc…. Normalise to lowercase at your API boundary and use a native UUID column type where possible. - Primary key inserts slow down on a large table. Random v4 keys spread inserts across the whole index. For very large, insert-heavy tables, consider time-ordered UUID v7 keys.
- Storing UUIDs as
VARCHAR(36). That works but uses over twice the space of a nativeuuidorBINARY(16)column and makes indexes larger. Convert when you can. - Using a UUID as a password reset token or API key. UUIDs are identifiers, not secrets. Generate a dedicated random token for anything that grants access, and store only its hash.
When developers use this
- Seeding a database or writing test fixtures that need realistic primary keys.
- Creating an
Idempotency-Keyheader value to test that a payment or order API rejects duplicate requests. - Making correlation or request IDs when testing distributed tracing or log searches.
- Naming uploaded files or objects in storage so names never clash.
- Generating IDs for configuration entries, such as Visual Studio project GUIDs or feature flag keys.
- Producing a quick unique value for a manual test where a timestamp might repeat.
Privacy and how it works
UUIDs are generated in your browser with crypto.randomUUID(), part of the Web Crypto API, which uses the operating system's secure random source. No IDs are sent to or logged by our servers, so values you use as real database keys are known only to you. Version 4 UUIDs contain no information about your machine or the time they were created, unlike version 1 UUIDs, which embed a timestamp and often a MAC address.
Limitations
- Only version 4 (random) UUIDs are generated. If you need time-ordered v7 or name-based v5 UUIDs, use a library in your language.
- A UUID is unique, not secret. Do not rely on one being unguessable for security purposes.
- Up to 1000 UUIDs can be generated per click. For larger batches, generate them in code or in the database, for example with
gen_random_uuid()in PostgreSQL.
FAQ
What is a version 4 UUID?
It is a 128-bit identifier made of 122 random bits plus 6 bits that mark the version and variant. You can recognise it by the 4 at the start of the third group, as in xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx, where y is 8, 9, a or b.
Can two UUIDs ever be the same?
In theory yes, in practice no. You would need to generate around a billion UUIDs per second for about 85 years to reach a 50% chance of a single duplicate. Bugs in random number generation are a far more realistic risk, which is why this tool uses the browser's secure generator.
Are these UUIDs safe to use as database keys?
Yes. They come from a cryptographically secure generator and follow the standard format, so every database and language accepts them. For very large tables with heavy insert rates, time-ordered keys such as UUID v7 can perform better in indexes.
What is the difference between a UUID and a GUID?
They are the same thing. GUID is Microsoft's name, and Windows tools traditionally display GUIDs in uppercase with braces, which you can produce with the case and wrapping options.
Should I use UUIDs or auto-increment integers?
Integers are smaller and naturally ordered but must come from one database and reveal how many records exist. UUIDs can be generated anywhere, including offline clients, and do not expose counts. Many systems use integers internally and UUIDs in public URLs and APIs.
Why are there no UUID v1 or v7 options?
This tool focuses on random v4 UUIDs, which are supported everywhere and reveal nothing about when or where they were made. For time-ordered IDs, most languages now have libraries for UUID v7.