UUID Validator

Paste any UUID to instantly check whether it's valid, identify its version and variant, and understand what those bits mean.

What is a UUID?

A UUID (Universally Unique Identifier) is a 128-bit number used to uniquely identify objects in computer systems - without needing a central authority to hand out IDs. Any application on any machine can generate a UUID and be virtually guaranteed it has never been generated before.

They appear as 32 hexadecimal digits in 5 groups separated by hyphens: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx. That pattern gives you 36 characters total (32 hex + 4 hyphens).

UUIDs are used everywhere: database primary keys, session tokens, file names, API request IDs, and distributed systems where you need uniqueness without a central coordinator. You may also see them called GUIDs (Globally Unique Identifiers) - Microsoft's name for the exact same thing.

UUID Format Explained

Every UUID is split into five groups. The layout encodes both the UUID's randomness and metadata like the version number and variant.

550e8400-e29b-41d4-a716-446655440000
Group 1 - 8 hex digits (32 bits) Time-low in v1; random in v4/v7
Group 2 - 4 hex digits (16 bits) Time-mid in v1; random in v4/v7
Group 3 - 4 hex digits (16 bits) First digit = version number (4 in this example). Remaining bits are random (v4) or timestamp (v1/v7).
Group 4 - 4 hex digits (16 bits) First hex digit encodes the variant (8, 9, a, or b = RFC 4122 standard). Remaining bits are random or clock sequence.
Group 5 - 12 hex digits (48 bits) Node ID - a MAC address in v1, or random bits in v4/v7.

UUID v4 vs v1 vs v7 - Which Should You Use?

Choose based on whether you need random IDs, time-sortable IDs, or broad compatibility.

v4

Random

122 bits of cryptographically secure randomness. The safe default for almost any use case - database IDs, tokens, filenames.

  • ✓ Globally unique (overwhelming probability)
  • ✓ No privacy leak - no timestamp, no MAC
  • ✓ Supported everywhere, native in browsers
  • ✗ Not sortable by creation time
  • ✗ Causes B-tree index fragmentation in databases

Use when: you need unique IDs and don't care about ordering.

v1

Timestamp-based

Encodes the current timestamp (100‑ns intervals since Oct 1582) plus a node identifier - usually a MAC address.

  • ✓ Embeds creation timestamp
  • ✓ Useful for time-series lookups
  • ✗ Leaks MAC address (privacy risk)
  • ✗ Poor B-tree index locality
  • ✗ Largely superseded by v7

Use when: maintaining compatibility with legacy systems that require v1.

Code Examples

How to generate a UUID in your preferred language:

JavaScript (Browser & Node.js)
// Browser (modern) - built-in, zero dependencies
const id = crypto.randomUUID();
console.log(id);
// → "550e8400-e29b-41d4-a716-446655440000"

// Node.js 14.17+
import { randomUUID } from 'crypto';
const id = randomUUID();

// npm install uuid  →  v4, v7 support
import { v4 as uuidv4, v7 as uuidv7 } from 'uuid';

const randomId  = uuidv4(); // v4 - random
const sortableId = uuidv7(); // v7 - time-ordered (great for DB keys)
Python
import uuid  # Built-in standard library, no install needed

# UUID v4 (random) - most common choice
unique_id = str(uuid.uuid4())
print(unique_id)
# → "550e8400-e29b-41d4-a716-446655440000"

# UUID v1 (timestamp-based)
time_id = str(uuid.uuid1())

# No hyphens (e.g. for a database column or filename)
compact = uuid.uuid4().hex  # "550e8400e29b41d4a716446655440000"

# Django model field:
#   id = models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True)
Go
// go get github.com/google/uuid
package main

import (
    "fmt"
    "github.com/google/uuid"
)

func main() {
    // UUID v4 (random)
    id := uuid.New()
    fmt.Println(id.String())
    // → "550e8400-e29b-41d4-a716-446655440000"

    // UUID v7 (time-ordered) - requires google/uuid v1.6+
    v7id, err := uuid.NewV7()
    if err != nil {
        panic(err)
    }
    fmt.Println(v7id.String())
}
Java
import java.util.UUID;  // Built-in since Java 1.5

public class UUIDExample {
    public static void main(String[] args) {

        // UUID v4 (random)
        UUID id = UUID.randomUUID();
        System.out.println(id.toString());
        // → "550e8400-e29b-41d4-a716-446655440000"

        // As a plain string
        String uuid = UUID.randomUUID().toString();

        // Spring Boot / JPA entity:
        // @Id
        // @GeneratedValue(strategy = GenerationType.UUID)
        // private UUID id;
    }
}
PHP
<?php
// composer require ramsey/uuid
use Ramsey\Uuid\Uuid;

// UUID v4 (random)
$id = Uuid::uuid4()->toString();
echo $id;
// → "550e8400-e29b-41d4-a716-446655440000"

// UUID v7 (time-ordered)
$sortableId = Uuid::uuid7()->toString();

// Laravel helper (uses ramsey/uuid under the hood)
// $id = (string) Str::uuid();         // v4
// $id = (string) Str::orderedUuid();  // time-ordered

Frequently Asked Questions

Are UUIDs truly unique? Could two systems ever generate the same one?

In practice, yes - UUIDs are universally unique. A v4 UUID contains 122 bits of randomness, meaning there are roughly 5.3 × 10³⁶ possible values. To have a 50% chance of a single collision, you would need to generate about 2.7 × 10¹⁸ UUIDs (that's 2.7 quintillion). At one billion per second, that would take over 85 years. For all real-world purposes, treat UUIDs as globally unique.

What's the difference between UUID and GUID?

Nothing, in practice. GUID (Globally Unique Identifier) is Microsoft's term for the same concept. Both follow the RFC 4122 standard, produce the same 128-bit format, and are fully interchangeable. If you see "GUID" in .NET or Windows documentation and "UUID" everywhere else, they describe the same thing.

Why should I use UUID v7 instead of v4 for database primary keys?

UUID v7 encodes a Unix millisecond timestamp in its first 48 bits, making it lexicographically sortable by creation time. This matters for databases: when you use v4 UUIDs as primary keys, new rows insert at random positions in the B-tree index, causing costly page splits and fragmentation. With v7, every new row inserts at the end of the index - just like an auto-increment integer - keeping the index compact and fast. For new projects, v7 is almost always the better choice for primary keys.

Is it safe to generate UUIDs in the browser?

Yes. This tool uses crypto.randomUUID(), part of the Web Crypto API built into all modern browsers. It draws randomness from the operating system's CSPRNG (Cryptographically Secure Pseudo-Random Number Generator) - the same source used for TLS keys. Everything happens locally in your browser; nothing is sent to our servers.

What is the Nil UUID?

The Nil UUID is a special case where all 128 bits are zero: 00000000-0000-0000-0000-000000000000. It's defined in RFC 4122 and used as a "null" or "not assigned" sentinel value - similar to null in programming. You'll see it in APIs and databases where a field must hold a UUID but has no meaningful value assigned yet.

Can I use a UUID as a password or secret token?

Technically yes, but purpose-built functions are better for security-sensitive secrets. A v4 UUID has 122 bits of entropy - which is strong - but tokens are better generated with crypto.getRandomValues() (browser), secrets.token_urlsafe(32) (Python), or similar, which give you full control over length and character set. For non-critical tokens like anonymous session IDs or invitation codes, a UUID is perfectly fine.

Recently Generated

Your last 10 generations are saved locally in your browser. Nothing is sent to our servers.