UUID generator: create and validate UUID v4 and v7
Generates UUIDs (GUIDs) right in your browser – random version 4 or time-sortable version 7 (RFC 9562). In “Validate” mode the tool tells you whether a UUID is valid, which version it is and when it was created.
How it is calculated
A UUID (Universally Unique Identifier, called GUID by Microsoft) is a 128-bit identifier that is unique worldwide without any central registry. It is written as 32 hexadecimal digits in five groups: xxxxxxxx-xxxx-Mxxx-Nxxx-xxxxxxxxxxxx. The digit M is the version; the top bits of N are the variant (8, 9, a or b for today’s UUIDs). The current standard is RFC 9562 (2024), which obsoletes RFC 4122.
Version 4 or version 7?
- Version 4 consists of 122 random bits. It reveals nothing about time or machine – the right choice for tokens, file names and anything that doesn’t need ordering.
- Version 7 starts with the Unix time in milliseconds (48 bits), followed by 74 random bits. New UUIDs therefore sort in creation order – ideal as database primary keys, because new rows are appended to the end of the index instead of scattered across it. The trade-off: anyone can read the creation time.
When you generate many v7 UUIDs at once, most fall into the same millisecond. The tool then increments the random part by one (RFC 9562 § 6.2, method 2), so the list stays strictly ascending.
How good is the randomness?
The random bits come from crypto.getRandomValues() – your browser’s cryptographically secure generator, the same one behind crypto.randomUUID(). Nothing is sent to a server or stored. With 122 random bits you would need about 2.7 quintillion (2.7 × 1018) UUIDs before the chance of a single duplicate reaches 50%.
Validating and decoding a UUID
In “Validate” mode the tool takes an existing UUID apart: it checks length and characters, reads the version and variant and, for versions 1, 6 and 7, converts the embedded timestamp to UTC and your local time. Versions 1 and 6 count 100-nanosecond intervals since 15 October 1582 (the start of the Gregorian calendar); version 7 counts milliseconds since 1 January 1970. Special values are the Nil UUID (all zeros) and the Max UUID (all f).
Frequently asked questions
What is the difference between a UUID and a GUID?
None in substance: GUID (Globally Unique Identifier) is Microsoft’s name for the same 128-bit format. A GUID from Windows or .NET is usually a version 4 UUID.
Can a UUID ever be duplicated?
In theory yes, in practice no: version 4 has 2122 possible values. Even at one billion UUIDs per second it would take about 86 years for a duplicate to become 50% likely – provided the random generator is good, like crypto.getRandomValues() used here.
Which UUID version should I use for a database?
Version 7. Because it starts with a timestamp, new records are inserted in order, which keeps B-tree indexes compact and fast. PostgreSQL 18 ships a built-in uuidv7() function for this.
Can I tell when a UUID was created?
For versions 1, 6 and 7, yes – choose “Validate / decode a UUID”. Version 4 contains only randomness and reveals neither time nor machine.
Uppercase or lowercase?
Both are valid. RFC 9562 specifies lowercase for output and requires case-insensitive handling on input. Some Microsoft tools display GUIDs in uppercase inside curly braces.
Sources and legal basis
- § 4 (Format, Variante, Version), § 5.4 (v4), § 5.7 (v7), § 6.2 (Monotonie), Anhang A (Testvektoren): RFC 9562 – Universally Unique IDentifiers (UUIDs), IETF 2024
- W3C Web Cryptography API – Crypto.getRandomValues()
- MDN Web Docs – Crypto.randomUUID()
As of:
Related tools
- Unix timestamp converterConvert a Unix timestamp to a date and back. Seconds, milliseconds, micro- and nanoseconds detected automatically; UTC, local time, ISO 8601 and more.
- DNS lookupLook up the DNS records of any domain: A, AAAA, MX, TXT, CNAME, NS, SOA, CAA, SRV and PTR – with TTL, DNSSEC status and explained error codes. Free.
- Hash Generator: SHA-256, SHA-512, SHA-1, MD5Calculate SHA-256, SHA-384, SHA-512, SHA-1 and MD5 hashes of text or files and verify checksums – locally in your browser, no upload, free.
- Base64 Encode and DecodeEncode and decode Base64 and Base64url with proper UTF-8, plus URL encode/decode (percent-encoding). Clear error messages, runs locally in your browser.
- JSON formatter, validator and minifierValidate JSON against RFC 8259 with the exact line, column and a plain-English explanation. Beautify or minify, sort keys, copy. Runs locally in your browser.
- Regex TesterTest JavaScript regular expressions live: matches highlighted, capture groups in a table, every part of the pattern explained. Free, nothing uploaded.