What is a UUID?
A UUID (Universally Unique Identifier), also called a GUID in the Microsoft world, is a 128-bit number written as 32 hexadecimal digits in five groups: 8-4-4-4-12, for example a23b7706-3f26-4081-96cc-18b0d3cf4c30. It lets any computer create an identifier on its own, with no central counter and no database round trip, and still be practically certain that nobody else will ever create the same one. That is why UUIDs are everywhere: primary keys, file names, message ids, correlation ids in logs.
The format is defined by RFC 9562 (which replaced RFC 4122 in 2024). The 13th digit tells you the version, that is, how the value was built. Version 4 is pure randomness: 122 random bits, so the chance of a collision is negligible even if you create billions. Version 7 starts with a timestamp in milliseconds, so new ids sort after older ones, which keeps database indexes compact. Versions 3 and 5 are not random at all: they hash a namespace and a name, so the same input always gives the same UUID. Versions 1 and 6 carry a time with 100-nanosecond precision.
This generator creates any of those versions, up to 100 at a time, entirely in your browser with the operating system's cryptographic random generator. Nothing is sent to a server. It also has an inspector: paste any UUID and it tells you its version, its variant and, for versions 1, 6 and 7, the moment it was created.
How to generate a UUID online
- Pick the version in the UUID version row:
v4is selected the first time you open the page. Choosev7for database keys that should sort by time, orv3/v5for a reproducible id. - For
v3orv5, choose a namespace (DNS, URL, OID or X500, or type your own namespace UUID) and type the Name to hash. - Set the Quantity (1 to 100). Each UUID goes on its own line.
- Adjust the format with the switches: Uppercase, Hyphens (turn off for 32 plain digits) and Braces (the style of .NET and the Windows registry).
- Press Copy to copy the whole list, or Refresh to draw new random ids. The tool remembers the version, quantity and format for your next visit.
- To check an existing id, paste it in Inspect a UUID. It accepts uppercase, missing hyphens, braces and the
urn:uuid:prefix, and shows the four common spellings with a copy button each.
Examples
A random version 4 UUID
With v4 selected and quantity 1, one click gave:
a23b7706-3f26-4081-96cc-18b0d3cf4c30The 4 at the start of the third group is the version; the 9 that opens the fourth group marks the RFC 9562 variant (it is always 8, 9, a or b).
Time-ordered version 7 UUIDs
Three v7 ids created in the same millisecond, 2026-11-21 12:00:00 UTC:
01a1fdfa-4600-72e0-a1f5-0a6be72334bd
01a1fdfa-4600-72e1-8724-b6b0b2401fb4
01a1fdfa-4600-72e2-8267-7927237306a5The first 12 hex digits, 01a1fdfa4600, are the Unix time in milliseconds (1 795 262 400 000). The tool uses the next field as a counter, so ids made in one batch still sort in creation order. Pasting the first one in the inspector shows: version 7, variant RFC 9562, created at 2026-11-21T12:00:00.000Z.
The same name always gives the same v5 UUID
Version v5, namespace DNS, name example.com:
cfbff0d1-9375-5685-968c-48ce8b15ae17With v3 (MD5 instead of SHA-1) and the same input you get 9073926b-929f-31c2-abc9-fad77ae3e8eb. Any library that follows the RFC returns exactly these values.
Changing the spelling
The v4 id above with Uppercase on and Hyphens off, and then with Braces on:
A23B77063F26408196CC18B0D3CF4C30
{a23b7706-3f26-4081-96cc-18b0d3cf4c30}Normalizing an id found in a config file
Inspecting urn:uuid:{C9BF9E57-1685-4C89-BAFB-FF5AF830BE8A} gives the canonical c9bf9e57-1685-4c89-bafb-ff5af830be8a, version 4, variant RFC 9562.
Common errors and how to fix them
- "This is not a valid UUID. Expected 8-4-4-4-12 hexadecimal digits": a digit is missing or a character outside 0–9 and a–f slipped in.
123e4567-e89b-12d3-a456-42661417400fails because the last group has 11 digits instead of 12. Copy the id again from its source. - "The namespace is not a valid UUID": in v3/v5 the namespace field must itself be a UUID. Press DNS or URL to restore a standard one.
- The v5 UUID does not match the one from my code: check that both sides use the same namespace and exactly the same name, including case and trailing spaces;
Example.comandexample.comgive different ids. - The creation time looks absurd: only v1, v6 and v7 store a time. Some "example" UUIDs found online, such as
123e4567-e89b-12d3-a456-426614174000, claim to be v1 but were typed by hand, so their date lands in the year 2228. - Random UUIDs make my index slow: v4 values are scattered, so inserts land all over a B-tree. Switch to
v7(or a ULID) for keys that are inserted often.
Frequently asked questions
Can two UUIDs ever be the same?
In theory yes, in practice no. A v4 UUID has 122 random bits; you would need to generate about 2.7 quintillion ids to reach a 50% chance of a single collision. The real risk is a broken random generator, which is why this tool uses the browser's cryptographic one.
What is the difference between UUID v4 and v7?
Both are unique, but v7 starts with a millisecond timestamp, so ids sort by creation time and reveal roughly when they were made. Use v4 when the id must not leak any time information, v7 for database primary keys. See the dedicated pages for UUID v4 and UUID v7.
Is a GUID the same as a UUID?
Yes. GUID is Microsoft's name for the same 128-bit format. Windows tools often print it in uppercase and with braces, which you can reproduce with the switches.
Is it safe to use UUIDs generated online?
Here, yes: the ids are created on your device and never transmitted. They are not secret tokens, though. For session tokens or API keys use a token generator with enough entropy instead.
Should I store UUIDs as text or binary?
Binary (16 bytes) is more compact than the 36-character text and indexes faster. PostgreSQL has a native uuid type; in MySQL use BINARY(16).
How to generate a UUID in code
JavaScript
Browsers and Node.js 19+ have crypto.randomUUID() for v4. For v5 and v7 use the uuid package (version 10 or newer for v7).
import { v5, v7 } from 'uuid';
const id = crypto.randomUUID(); // v4
console.log(v5('example.com', v5.DNS)); // cfbff0d1-9375-5685-968c-48ce8b15ae17
console.log(v7()); // sortable by timePython
The standard library covers v4 and v5; uuid7() arrived in Python 3.14.
import uuid
print(uuid.uuid4())
print(uuid.uuid5(uuid.NAMESPACE_DNS, "example.com")) # cfbff0d1-9375-5685-968c-48ce8b15ae17
print(uuid.uuid7()) # Python 3.14+Go
The standard library has no UUID package; this builds a v4 from crypto/rand (most projects use github.com/google/uuid).
package main
import (
"crypto/rand"
"fmt"
)
func main() {
var b [16]byte
if _, err := rand.Read(b[:]); err != nil {
panic(err)
}
b[6] = (b[6] & 0x0f) | 0x40 // version 4
b[8] = (b[8] & 0x3f) | 0x80 // RFC 9562 variant
fmt.Printf("%x-%x-%x-%x-%x\n", b[0:4], b[4:6], b[6:8], b[8:10], b[10:16])
}Bash
uuidgen ships with macOS and most Linux distributions; on Linux the kernel also hands out v4 ids.
uuidgen | tr 'A-Z' 'a-z'
cat /proc/sys/kernel/random/uuid # Linux only