Names
UUIDs
UUIDs to check
Result
Paste a UUID to see its version, variant and, for time-based versions, the time written into it.
| Line | UUID | Result | Details |
|---|
Ctrl+Enter run / or Ctrl+K search tools Press Ctrl+D to bookmark this page
How to validate a UUID
- Paste a UUID into the box, or a whole list with one per line. Checking starts as you type.
- For one UUID, the result shows whether it is valid, its version and variant, and the same UUID in its standard, uppercase, no-hyphen, GUID and URN forms. Time-based versions also show the time written into them.
- For a list, you get a count of valid and invalid lines, the duplicates, and a table of every line. Press Details on a line to see it in full.
- If something is wrong, the result names the problem and the column, and marks it in the box. Press Copy in the toolbar to copy every valid UUID in the standard form.
The Generate tab makes new UUIDs of versions 4, 7, 5 and 3. It is the same tool as the UUID Generator.
What makes a UUID valid
- Exactly 32 hex digits:
0–9anda–f, in any case. - Either no hyphens, or four hyphens splitting the digits into groups of 8, 4, 4, 4 and 12.
- Optionally wrapped in braces,
{…}, or starting withurn:uuid:. Spaces, quotes or a trailing comma around it are removed before checking, and the result says so.
That is the format. On top of it, a standard UUID has a known version (the first digit of the third group, 1 to 8) and the standard variant (the first digit of the fourth group is 8, 9, a or b). The validator keeps these apart:
- Not valid means it is not a UUID at all: wrong length, a character that is not a hex digit, hyphens in the wrong places or unbalanced braces.
- Valid, with a warning means it is a well-formed 128-bit UUID whose version is not defined (0, or 9 to f), or whose variant is not the standard one, such as very old Microsoft GUIDs. Many systems store these without trouble; strict validators reject them.
- The Nil UUID (all zeros) and the Max UUID (all
f) are special values defined by the standard. They are named, not flagged.
Examples
| Input | Result |
|---|---|
919108f7-52d1-4320-9bac-f847db4148a8 | Valid: version 4, random |
{919108F7-52D1-4320-9BAC-F847DB4148A8} | Valid: the same UUID, uppercase in braces (GUID style) |
017f22e2-79b0-7cc3-98c4-dc0c0c07398f | Valid: version 7, with the time 2022-02-22 19:22:22 UTC written into it |
00000000-0000-0000-0000-000000000000 | Valid: the Nil UUID |
c232ab00-9414-01ec-b3c8-9f6bdeced846 | Well-formed, with a warning: version 0 is not defined |
919108f7-52d1-4320-9bac-f847db4148a | Not valid: 31 hex digits instead of 32 |
919108f7-52d1-4320-9bac-f847db4148g8 | Not valid: g is not a hex digit (column 35) |
Press Load sample to try a list with all of these and more.
Reading the time from a UUID
Versions 1, 6 and 7 carry a timestamp. For version 7 it is the first 12 hex digits: the Unix time in milliseconds. Versions 1 and 6 count 100-nanosecond steps since 15 October 1582, the start of the Gregorian calendar, and also hold a clock sequence and a node. The decoder shows the time in UTC, in your own time zone and relative to now.
This is the time written into the UUID. It is usually when the UUID was made, but a generator can write any time it likes, and the clock of the machine that made it may have been wrong, so do not use it as proof of when something happened.
For version 1 and 6, the decoder also says whether the node looks like a real network card (MAC) address, which can identify the machine that made the UUID, or a random number, as the standard now recommends.
Your UUIDs stay in your browser
Checking runs on your device. Nothing you paste is uploaded, saved, or put in a shared link, because UUIDs are often real record IDs.
Frequently asked questions
Which forms of a UUID does it accept?
Uppercase, lowercase or mixed case, with or without hyphens, in braces like a Microsoft GUID, or with the urn:uuid: prefix. Spaces, quotes and a trailing comma around it are removed, and the result says what was removed.
What is the difference between not valid and a warning?
Not valid means it is not a UUID at all, for example 31 digits or a letter g. A warning means it is a well-formed 128-bit UUID, but its version digit is not defined or its variant is not the standard one. Many systems accept those; strict validators do not.
Is the Nil UUID valid?
Yes. 00000000-0000-0000-0000-000000000000 is defined by the standard as a special value meaning no UUID. So is the Max UUID, with every digit f. Whether your system allows them in a field is a separate question.
Why does another validator reject my v7 UUID?
Version 7 was standardised in May 2024 (RFC 9562), and some older validators only know versions 1 to 5. The UUID is fine. Update the library or accept version digits 1 to 8.
Is a GUID the same as a UUID?
Yes. GUID is Microsoft's name for the same 128-bit format. GUIDs are often shown in uppercase and in braces, which the validator accepts and converts to the standard lowercase form.
Validating UUIDs in your code
Each snippet makes UUIDs and checks the 8-4-4-4-12 format strictly. Watch out for lenient parsers: Java’s UUID.fromString() accepts 1-2-3-4-5, and Python’s uuid.UUID() accepts braces and missing hyphens.
Java
// Version 4, 5, 3 and 7 UUIDs and a strict format check, with the JDK only.
import java.nio.ByteBuffer;
import java.nio.charset.StandardCharsets;
import java.security.MessageDigest;
import java.security.SecureRandom;
import java.time.Instant;
import java.util.UUID;
public class UuidDemo {
static final UUID NAMESPACE_DNS = UUID.fromString("6ba7b810-9dad-11d1-80b4-00c04fd430c8");
static final SecureRandom RANDOM = new SecureRandom();
// Versions 5 (SHA-1) and 3 (MD5): a hash of the name space bytes followed by the name.
// UUID.nameUUIDFromBytes() makes version 3 too, but hashes only the bytes you pass,
// so the name space must be put in front by hand.
static UUID nameBased(String algorithm, int version, UUID namespace, String name) throws Exception {
MessageDigest md = MessageDigest.getInstance(algorithm);
md.update(toBytes(namespace));
md.update(name.getBytes(StandardCharsets.UTF_8));
byte[] h = md.digest();
h[6] = (byte) ((h[6] & 0x0f) | (version << 4));
h[8] = (byte) ((h[8] & 0x3f) | 0x80); // RFC 9562 variant
ByteBuffer bb = ByteBuffer.wrap(h, 0, 16);
return new UUID(bb.getLong(), bb.getLong());
}
static byte[] toBytes(UUID u) {
return ByteBuffer.allocate(16)
.putLong(u.getMostSignificantBits())
.putLong(u.getLeastSignificantBits())
.array();
}
// Version 7: the Unix time in milliseconds (48 bits), then random bits.
static UUID v7(long millis) {
byte[] b = new byte[16];
RANDOM.nextBytes(b);
for (int i = 0; i < 6; i++) b[i] = (byte) (millis >>> (40 - 8 * i));
b[6] = (byte) ((b[6] & 0x0f) | 0x70);
b[8] = (byte) ((b[8] & 0x3f) | 0x80);
ByteBuffer bb = ByteBuffer.wrap(b);
return new UUID(bb.getLong(), bb.getLong());
}
// UUID.fromString() is lenient: it accepts "1-2-3-4-5". Check the shape first.
static boolean isUuid(String s) {
return s.matches("(?i)[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}");
}
public static void main(String[] args) throws Exception {
UUID v4 = UUID.randomUUID();
System.out.println("v4 version: " + v4.version());
System.out.println("v5: " + nameBased("SHA-1", 5, NAMESPACE_DNS, "www.example.com"));
System.out.println("v3: " + nameBased("MD5", 3, NAMESPACE_DNS, "www.example.com"));
UUID v7 = v7(Instant.parse("2025-03-14T09:30:00Z").toEpochMilli());
System.out.println("v7 starts with: " + v7.toString().substring(0, 15));
System.out.println("v7 time: " + Instant.ofEpochMilli(v7.getMostSignificantBits() >>> 16));
System.out.println("valid: " + isUuid("919108f7-52d1-4320-9bac-f847db4148a8") + " " + isUuid("1-2-3-4-5"));
System.out.println("UUID.fromString(\"1-2-3-4-5\") gives " + UUID.fromString("1-2-3-4-5"));
}
} JDK only. UUID.randomUUID() makes version 4; versions 5 and 7 need the few lines shown. Java 21.
JavaScript
// Version 4, 5 and 7 UUIDs and a strict format check, with Node's built-in crypto.
import { createHash, randomBytes, randomUUID } from 'node:crypto';
const NAMESPACE_DNS = '6ba7b810-9dad-11d1-80b4-00c04fd430c8';
const UUID_PATTERN = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
function format(bytes) {
const hex = Buffer.from(bytes).toString('hex');
return `${hex.slice(0, 8)}-${hex.slice(8, 12)}-${hex.slice(12, 16)}-${hex.slice(16, 20)}-${hex.slice(20)}`;
}
// Version 5: SHA-1 of the name space bytes followed by the name in UTF-8.
function uuidV5(namespace, name) {
const hash = createHash('sha1')
.update(Buffer.from(namespace.replaceAll('-', ''), 'hex'))
.update(name, 'utf8')
.digest();
hash[6] = (hash[6] & 0x0f) | 0x50; // version 5
hash[8] = (hash[8] & 0x3f) | 0x80; // RFC 9562 variant
return format(hash.subarray(0, 16));
}
// Version 7: the Unix time in milliseconds (48 bits), then random bits.
// UUIDs made in the same millisecond are not ordered; add a counter if you need that.
function uuidV7(ms = Date.now()) {
const bytes = randomBytes(16);
bytes.writeUIntBE(ms, 0, 6);
bytes[6] = (bytes[6] & 0x0f) | 0x70; // version 7
bytes[8] = (bytes[8] & 0x3f) | 0x80; // RFC 9562 variant
return format(bytes);
}
const v4 = randomUUID(); // built in: Node 15.6+, and crypto.randomUUID() in browsers
console.log('v4 version:', v4[14], 'valid:', UUID_PATTERN.test(v4));
console.log('v5:', uuidV5(NAMESPACE_DNS, 'www.example.com'));
const v7 = uuidV7(Date.UTC(2025, 2, 14, 9, 30));
console.log('v7 starts with:', v7.slice(0, 15));
console.log('v7 time:', new Date(parseInt(v7.replaceAll('-', '').slice(0, 12), 16)).toISOString());
console.log('valid:', UUID_PATTERN.test('919108f7-52d1-4320-9bac-f847db4148a8'), UUID_PATTERN.test('919108f7-52d1-4320-9bac-f847db4148a')); Node’s built-in crypto module. In browsers, crypto.randomUUID() makes version 4 on secure (https) pages.
Python
# Version 4, 5, 3 and 7 UUIDs and a strict format check, with the standard uuid module.
import os
import time
import uuid
from datetime import datetime, timezone
v4 = uuid.uuid4()
print("v4 version:", v4.version)
print("v5:", uuid.uuid5(uuid.NAMESPACE_DNS, "www.example.com"))
print("v3:", uuid.uuid3(uuid.NAMESPACE_DNS, "www.example.com"))
# Python 3.14 adds uuid.uuid7(). Before that, it takes a few lines:
# the Unix time in milliseconds (48 bits), then random bits.
def uuid7(ms=None):
if ms is None:
ms = time.time_ns() // 1_000_000
b = bytearray(ms.to_bytes(6, "big") + os.urandom(10))
b[6] = (b[6] & 0x0F) | 0x70 # version 7
b[8] = (b[8] & 0x3F) | 0x80 # RFC 9562 variant
return uuid.UUID(bytes=bytes(b))
v7 = uuid7(1741944600000) # 2025-03-14 09:30 UTC
print("v7 starts with:", str(v7)[:15])
written = datetime.fromtimestamp(int(v7.hex[:12], 16) / 1000, tz=timezone.utc)
print("v7 time:", written.isoformat(timespec="milliseconds"))
# uuid.UUID() also accepts braces, urn:uuid: and no hyphens.
# Compare with the standard form to accept only 8-4-4-4-12.
def is_uuid(text):
try:
return str(uuid.UUID(text)) == text.lower()
except ValueError:
return False
print("valid:", is_uuid("919108f7-52d1-4320-9bac-f847db4148a8"), is_uuid("919108f7-52d1-4320-9bac-f847db4148a")) The uuid module in the standard library. Python 3.14 adds uuid.uuid7().
Go
// Version 4, 5 and 7 UUIDs and a strict format check, with the standard library.
// Most projects use github.com/google/uuid instead: uuid.New(), uuid.NewV7(), uuid.NewSHA1().
package main
import (
"crypto/rand"
"crypto/sha1"
"fmt"
"regexp"
"time"
)
var namespaceDNS = [16]byte{0x6b, 0xa7, 0xb8, 0x10, 0x9d, 0xad, 0x11, 0xd1, 0x80, 0xb4, 0x00, 0xc0, 0x4f, 0xd4, 0x30, 0xc8}
var uuidPattern = regexp.MustCompile(`^(?i)[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$`)
func format(b [16]byte) string {
return fmt.Sprintf("%x-%x-%x-%x-%x", b[0:4], b[4:6], b[6:8], b[8:10], b[10:16])
}
// Version 4: 122 random bits.
func newV4() [16]byte {
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
return b
}
// Version 5: SHA-1 of the name space bytes followed by the name.
func newV5(namespace [16]byte, name string) [16]byte {
h := sha1.New()
h.Write(namespace[:])
h.Write([]byte(name))
var b [16]byte
copy(b[:], h.Sum(nil))
b[6] = b[6]&0x0f | 0x50
b[8] = b[8]&0x3f | 0x80
return b
}
// Version 7: the Unix time in milliseconds (48 bits), then random bits.
func newV7(t time.Time) [16]byte {
var b [16]byte
if _, err := rand.Read(b[6:]); err != nil {
panic(err)
}
ms := uint64(t.UnixMilli())
for i := 0; i < 6; i++ {
b[i] = byte(ms >> (40 - 8*i))
}
b[6] = b[6]&0x0f | 0x70
b[8] = b[8]&0x3f | 0x80
return b
}
func main() {
v4 := format(newV4())
fmt.Println("v4 version:", string(v4[14]), "valid:", uuidPattern.MatchString(v4))
fmt.Println("v5:", format(newV5(namespaceDNS, "www.example.com")))
v7 := newV7(time.Date(2025, 3, 14, 9, 30, 0, 0, time.UTC))
fmt.Println("v7 starts with:", format(v7)[:15])
var ms uint64
for i := 0; i < 6; i++ {
ms = ms<<8 | uint64(v7[i])
}
fmt.Println("v7 time:", time.UnixMilli(int64(ms)).UTC().Format(time.RFC3339Nano))
fmt.Println("valid:", uuidPattern.MatchString("919108f7-52d1-4320-9bac-f847db4148a8"), uuidPattern.MatchString("919108f7-52d1-4320-9bac-f847db4148a"))
} Standard library only: Go has no UUID package. Most projects use github.com/google/uuid.
Last verified . Each example is run automatically and its output checked.