Skip to content

UUID Generator & Decoder

Free UUID generator — create v1, v4, v5, v7 UUIDs instantly. Decode & validate any UUID. Batch generate up to 50. No signup, 100% browser-based.

No Tracking Runs in Browser Free
All UUIDs are generated locally in your browser. Nothing is transmitted or stored.

What Is a UUID?

A UUID (Universally Unique Identifier) is a 128-bit identifier standardized by RFC 9562 (formerly RFC 4122). UUIDs are written as 32 hexadecimal digits in the canonical 8-4-4-4-12 format, such as `550e8400-e29b-41d4-a716-446655440000`. They are designed to be globally unique without requiring a central authority or coordination between systems.

There are five widely used UUID versions. Version 1 (v1) encodes the current timestamp and the generating machine's MAC address, making each UUID unique in both time and space. Version 3 (v3) and version 5 (v5) are deterministic — they hash a namespace and a name using MD5 or SHA-1 respectively, always producing the same UUID for the same inputs. Version 4 (v4) is the most common: it fills 122 bits with cryptographically secure random data, giving over 5.3 x 10^36 possible values. Version 7 (v7), introduced in RFC 9562, combines a Unix timestamp in milliseconds with random data, producing UUIDs that are both unique and naturally sortable by creation time.

UUIDs are essential in distributed systems, databases, APIs, and anywhere unique identifiers are needed without centralized coordination. They eliminate the risk of ID collisions across independent systems, making them ideal for microservices, event sourcing, and multi-tenant architectures.

This tool generates all UUID versions entirely in your browser using the Web Crypto API. No UUIDs are transmitted to any server, ensuring complete privacy. You can also decode and validate existing UUIDs to inspect their version, variant, and embedded data.

// Generate a UUID v4 using the Web Crypto API
const uuid = crypto.randomUUID();
console.log(uuid);
// → '550e8400-e29b-41d4-a716-446655440000'

// Manual v4 generation with crypto.getRandomValues()
function generateUUIDv4() {
  const bytes = new Uint8Array(16);
  crypto.getRandomValues(bytes);
  bytes[6] = (bytes[6] & 0x0f) | 0x40; // version 4
  bytes[8] = (bytes[8] & 0x3f) | 0x80; // variant 10
  const hex = Array.from(bytes, b => b.toString(16).padStart(2, '0')).join('');
  return `${hex.slice(0,8)}-${hex.slice(8,12)}-${hex.slice(12,16)}-${hex.slice(16,20)}-${hex.slice(20)}`;
}

Key Features

UUID v7 Support (RFC 9562)

Generate the latest UUID v7 format with embedded Unix timestamps for time-ordered, database-friendly identifiers. One of the few online tools supporting the RFC 9562 standard.

UUID Decoder & Validator

Parse any UUID to reveal its version, variant, timestamp (v1/v7), clock sequence, and node information. Instantly validate whether a string is a correctly formatted UUID.

Multi-Version Support

Generate UUIDs in five versions — v1 (time-based), v3 (MD5), v4 (random), v5 (SHA-1), and v7 (time-ordered random) — all conforming to RFC 9562.

Batch Generation

Generate up to 50 unique UUIDs at once. Each UUID is independently generated with full cryptographic randomness or correct version-specific encoding.

Multiple Output Formats

Output UUIDs in standard lowercase, UPPERCASE, no hyphens, or braces {GUID} format — matching the exact format required by your system or framework.

Cryptographically Secure

Uses the Web Crypto API (crypto.getRandomValues()) for true random number generation — the same standard used by modern browsers and security tools.

100% Browser-Based

All UUIDs are generated locally in your browser. Nothing is sent to any server — your generated identifiers stay completely private.

UUID Version Comparison

Choose the right UUID version for your use case.

Version Basis Sortable Privacy Best For
v1 Timestamp + MAC address By creation time Exposes MAC & time Legacy systems requiring time-based ordering
v4 122 bits cryptographic random No Fully anonymous General purpose — most widely used version
v5 SHA-1 hash of namespace + name No Deterministic, reproducible Consistent IDs from known inputs (URLs, DNS)
v7 Unix timestamp (ms) + random By creation time Exposes creation time only Modern databases — sortable, index-friendly (RFC 9562)

UUID vs Other ID Formats

ULID

26 chars, Crockford Base32

Lexicographically sortable like UUID v7, but uses Crockford Base32 encoding (26 chars vs 36). UUID v7 is now the IETF-standardized alternative with broader tooling support.

nanoid

21 chars, URL-safe alphabet

Shorter and URL-safe, ideal when compactness matters. Not a formal standard — lacks native database types and cross-platform libraries that UUID has.

CUID2

Variable length, alphanumeric

Designed for horizontal scaling with collision resistance. Less widely adopted than UUID; no native database support. Consider UUID v7 for standardized time-sorted IDs.

UUID Version Examples

UUID v4 (Random)

550e8400-e29b-41d4-a716-446655440000

The most commonly used version. 122 bits of cryptographic randomness provide over 5.3 x 10^36 possible values — suitable for virtually any use case where uniqueness is required without coordination.

UUID v7 (Time-ordered)

01906b5e-4a3e-7234-8f56-b8c12d4e5678

Combines a 48-bit Unix timestamp in milliseconds with random data. UUIDs sort chronologically, making them ideal for database primary keys where index locality matters. Recommended for new projects over v1 and v4.

UUID v1 (Time-based)

6ba7b810-9dad-11d1-80b4-00c04fd430c8

Encodes a 60-bit timestamp and the generating machine's 48-bit MAC address. Guarantees uniqueness in time and space but can leak hardware identity information. Superseded by v6/v7 in RFC 9562.

UUID v5 (SHA-1 Name-based)

886313e1-3b8a-5372-9b90-0c9aee199e5d

Deterministic UUID generated by hashing the DNS namespace with the name 'python.org' using SHA-1. The same namespace and name always produce the same UUID, making v5 ideal for reproducible identifiers.

How to Use

  1. 1

    Select UUID Version

    Choose from v1 (time-based), v3 (MD5 name-based), v4 (random), v5 (SHA-1 name-based), or v7 (time-ordered random). Each version serves a different purpose — v4 is the most common for general use.

  2. 2

    Configure Options

    For v3 and v5, select a namespace (DNS, URL, OID, X.500, or custom) and enter a name to hash. Set the quantity from 1 to 50 and choose an output format: standard lowercase, UPPERCASE, no hyphens, or braces {GUID}.

  3. 3

    Generate UUIDs

    Click the Generate button. Each UUID is created using the Web Crypto API (crypto.getRandomValues()) for cryptographic security. Version-specific fields like timestamps (v1/v7) and hashes (v3/v5) are correctly encoded.

  4. 4

    Copy and Use

    Click the Copy button next to any UUID to copy it to your clipboard, or use Copy All to grab every generated UUID at once. Switch to the Decode tab to analyze an existing UUID's version, variant, timestamp, and other embedded information.

Common Use Cases

Database Primary Keys
Use UUID v4 or v7 as unique primary keys without coordination between database nodes. UUID v7 is especially well-suited because its time-ordered property improves B-tree index performance.
Distributed Systems
Generate unique identifiers independently across microservices, message queues, and event sourcing systems. UUIDs eliminate the need for a centralized ID-generation service.
API Development
Create unique request IDs, correlation IDs, and idempotency keys for RESTful and GraphQL APIs. UUIDs make it easy to trace requests across distributed service boundaries.
Session & Token Management
Generate unique session identifiers and temporary tokens for authentication flows. UUIDs provide sufficient uniqueness to prevent session collisions across large user bases.
Testing & Development
Quickly generate test data, mock identifiers, and unique fixture IDs for automated testing. Batch generation makes it easy to populate development databases and test suites.

Technical Details

UUID Structure
A UUID is 128 bits (16 bytes) represented as 32 hexadecimal characters in the 8-4-4-4-12 format. Bits 48-51 (the 13th hex digit) encode the version number. Bits 64-65 encode the variant field, which identifies the UUID layout. The remaining bits carry version-specific payload: timestamp, random data, or hash output.
Version Bits
Bits 48-51 (the high nibble of the 7th byte) encode the UUID version: 0001 = v1 (time-based), 0011 = v3 (MD5 name-based), 0100 = v4 (random), 0101 = v5 (SHA-1 name-based), 0110 = v6 (reordered time), 0111 = v7 (Unix epoch time). These four bits are always set explicitly during generation.
Variant Field
Bits 64-65 (the two most significant bits of the 9th byte) define the variant. The pattern 10x indicates RFC 4122/9562 UUIDs (the vast majority). Pattern 110 indicates Microsoft GUIDs with mixed-endian byte order. Pattern 0xx indicates NCS backward-compatible UUIDs (legacy). Pattern 111 is reserved for future use.
RFC 9562 Standard
RFC 9562, published in May 2024, supersedes RFC 4122 as the definitive UUID specification. It formally introduces UUID versions 6, 7, and 8. Version 6 reorders v1 fields for sortability. Version 7 uses a 48-bit Unix timestamp in milliseconds plus random data, making it the recommended version for new time-based UUIDs. Version 8 provides a format for custom, implementation-specific UUIDs. RFC 9562 also formally deprecates v1 in favor of v6/v7.

Best Practices

Choose the Right Version
Use v4 for general-purpose unique identifiers where no ordering or determinism is needed. Use v7 for database primary keys — its time-ordered property delivers significantly better index performance. Use v5 when you need deterministic IDs derived from names (prefer v5 over v3 for stronger hashing).
Use UUID v7 for Database Primary Keys
UUID v7's time-ordered structure keeps B-tree inserts sequential, reducing index fragmentation by approximately 90% compared to random v4 UUIDs. This translates to faster writes, smaller indexes, and better cache utilization. Most modern databases (PostgreSQL 17+, MySQL 8.0+) have native UUID support optimized for this pattern.
Never Use UUIDs as Security Tokens
UUIDs are designed for uniqueness, not secrecy. UUID v1 leaks the generation timestamp and MAC address. UUID v4 has only 122 bits of entropy with a predictable structure. For security tokens, API keys, or session secrets, use a dedicated CSPRNG to generate 128 or 256 bits of pure random data without the UUID structure overhead.
Validate Before Parsing
Always validate UUID format with a regular expression before parsing or storing. Reject malformed inputs at system boundaries — API endpoints, form submissions, and database inputs. This prevents injection attacks, data corruption, and hard-to-debug errors from invalid identifiers propagating through your system.

Frequently Asked Questions

What is a UUID?
A UUID (Universally Unique Identifier) is a 128-bit identifier standardized by RFC 9562. It is written as 32 hexadecimal digits displayed in five groups separated by hyphens, following the 8-4-4-4-12 format — for example, 550e8400-e29b-41d4-a716-446655440000. UUIDs are designed to be globally unique without requiring a central registration authority. The term GUID (Globally Unique Identifier) is Microsoft's name for the same concept and uses the identical format. UUIDs are used extensively in databases, distributed systems, APIs, and software development wherever unique identifiers are needed. With over 5.3 x 10^36 possible v4 UUIDs, the probability of generating a duplicate is astronomically small, making them safe for independent generation across uncoordinated systems.
What are the differences between UUID versions?
UUID v1 encodes a 60-bit timestamp and the machine's 48-bit MAC address, guaranteeing uniqueness in time and space but potentially leaking hardware identity. UUID v3 hashes a namespace and name with MD5 to produce a deterministic UUID — the same inputs always yield the same output. UUID v4 fills 122 of its 128 bits with cryptographically secure random data, making it the most widely used version for general-purpose unique identifiers. UUID v5 is identical to v3 but uses SHA-1 instead of MD5, offering stronger hash collision resistance. UUID v7, introduced in RFC 9562 (May 2024), embeds a 48-bit Unix timestamp in milliseconds followed by random bits, producing UUIDs that are both unique and naturally sortable by creation time. Version choice depends on your requirements: v4 for simplicity, v5 for determinism, and v7 for time-sortable database keys.
When should I use UUID v4 vs v7?
UUID v4 is the most popular version and an excellent default choice. It generates 122 bits of pure randomness, requires no configuration, and works everywhere. Use v4 when you simply need a unique identifier and don't care about ordering. UUID v7 is the better choice when UUIDs will be used as database primary keys or need to be sorted by creation time. Because v7 embeds a millisecond-precision timestamp in the most significant bits, v7 UUIDs naturally sort in chronological order. This property dramatically improves B-tree index performance — inserts always go to the end of the index rather than random positions, reducing page splits and fragmentation by up to 90%. For new projects in 2026, the general recommendation is to use v7 for database keys and v4 for everything else. Both versions are equally unique and cryptographically random in their random portions.
What is the probability of UUID collision?
UUID v4 has 122 random bits, giving 2^122 (approximately 5.3 x 10^36) possible values. To have a 50% probability of at least one collision, you would need to generate approximately 2.71 x 10^18 UUIDs — that is 2.71 quintillion. To put this in perspective, if you generated one billion UUIDs per second, it would take about 86 years to reach a 50% collision probability. At more realistic generation rates, the probability is vanishingly small. For example, generating 10 million UUIDs produces a collision probability of roughly 1 in 10^22. In practice, hardware failures, software bugs, and human errors are all billions of times more likely to cause duplicate IDs than UUID v4 collisions. The math is based on the birthday problem formula: p(n) approximately equals n^2 / (2 * 2^122).
What is the difference between UUID and GUID?
UUID (Universally Unique Identifier) and GUID (Globally Unique Identifier) are essentially the same thing. GUID is the term coined by Microsoft and used predominantly in Windows, .NET, COM, and SQL Server environments. UUID is the standard term defined by RFC 9562 (and its predecessor RFC 4122) and is used in most other contexts including Linux, Java, Python, PostgreSQL, and web development. Both use the identical 128-bit format displayed as 32 hexadecimal digits in the 8-4-4-4-12 pattern. The only minor difference is that Microsoft tools sometimes display GUIDs in uppercase with curly braces, like {550E8400-E29B-41D4-A716-446655440000}, while UUIDs are conventionally shown in lowercase without braces. This tool supports both formats via the output format selector — choose the Braces {GUID} format for Microsoft-style output.
Is UUID v4 cryptographically secure?
When generated using crypto.getRandomValues() or an equivalent CSPRNG (Cryptographically Secure Pseudo-Random Number Generator), UUID v4 contains 122 bits of cryptographically secure random data. This tool uses the Web Crypto API, which draws entropy from the operating system's secure random source. However, UUIDs should not be used as security tokens, passwords, or encryption keys. While 122 bits of randomness makes prediction infeasible, UUIDs have a predictable structure — the version nibble (4) and variant bits are fixed and publicly known. For security tokens, use purpose-built APIs like crypto.getRandomValues() with a full 128 or 256 bits of entropy, or use established token formats like JWT. Use UUIDs for identification, not for security.
How to validate a UUID format?
A valid UUID matches the regular expression pattern: ^[0-9a-f]{8}-[0-9a-f]{4}-[1-7][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$ (case-insensitive). This pattern enforces the 8-4-4-4-12 hexadecimal format, checks that the version digit (position 15) is between 1 and 7, and verifies that the variant nibble (position 20) starts with 8, 9, a, or b (indicating the RFC 4122/9562 variant). In JavaScript, you can validate with: /^[0-9a-f]{8}-[0-9a-f]{4}-[1-7][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(uuid). Most programming languages also have built-in UUID parsing — for example, Python's uuid.UUID() constructor, Java's UUID.fromString(), and Go's uuid.Parse(). Always validate UUIDs at system boundaries before storing or processing them to prevent injection attacks and data corruption.
Are UUIDs good database primary keys? (Performance, safety & best version)
Yes, UUIDs are safe and increasingly popular as database primary keys, with UUID v7 being the recommended version. The key advantages: (1) UUIDs can be generated anywhere — clients, servers, or edge functions — without a round trip to the database, enabling offline-first and distributed architectures. (2) UUIDs prevent enumeration attacks since they are not sequential integers. (3) UUIDs simplify data merging across systems since IDs never collide. UUID v7 is the best version for primary keys because its time-ordered structure keeps B-tree indexes sequential, dramatically reducing page splits, write amplification, and index fragmentation by up to 90% compared to random v4 UUIDs. The tradeoffs: UUIDs use 16 bytes versus 4-8 bytes for integers, increasing storage and memory for indexes. In MySQL/InnoDB, where the primary key is the clustered index, random v4 UUIDs can cause significant performance degradation — v7 solves this by ensuring inserts always append to the end of the index, achieving performance comparable to auto-increment integers. PostgreSQL stores UUIDs natively in 16 bytes with the uuid type. For most modern applications, the benefits of globally unique, coordination-free ID generation far outweigh the extra storage cost.
What is a namespace UUID (v3/v5)?
A namespace UUID is a predefined or custom UUID that serves as a scope for generating deterministic v3 and v5 UUIDs. RFC 4122 defines four standard namespace UUIDs: DNS (6ba7b810-9dad-11d1-80b4-00c04fd430c8), URL (6ba7b811-9dad-11d1-80b4-00c04fd430c8), OID (6ba7b812-9dad-11d1-80b4-00c04fd430c8), and X.500 DN (6ba7b814-9dad-11d1-80b4-00c04fd430c8). When you combine a namespace UUID with a name string, the v3 or v5 algorithm hashes them together to produce a deterministic UUID — the same namespace plus name always produces the same UUID. This is useful when you need reproducible identifiers derived from meaningful names. For example, hashing the DNS namespace with 'example.com' always yields the same v5 UUID. You can also use any valid UUID as a custom namespace for your application's own deterministic ID scheme.
What is the UUID nil value?
The nil UUID (also called the zero UUID) is 00000000-0000-0000-0000-000000000000 — all 128 bits set to zero. It is defined in RFC 9562 Section 5.9 as a special UUID that can represent the absence of a value, similar to null or None in programming languages. The nil UUID is useful as a sentinel value, a default in configuration systems, or a placeholder in database records where a UUID field must not be empty but no real value exists yet. RFC 9562 also defines the max UUID: ffffffff-ffff-ffff-ffff-ffffffffffff (all bits set to one), which can serve as a boundary marker. Important caveats: never use the nil UUID as an actual identifier — it is not unique. Some UUID libraries and databases may reject or specially handle nil UUIDs, so ensure your system treats them consistently. Always document whether nil UUIDs are accepted in your API contracts and database schemas.
What is UUID v7 and why should I use it?
UUID v7 is the newest UUID version defined in RFC 9562 (May 2024). It embeds a 48-bit Unix timestamp in milliseconds in the most significant bits, followed by cryptographically random data. This design produces UUIDs that are globally unique, chronologically sortable, and highly efficient as database primary keys. Unlike UUID v1, which also contains a timestamp, v7 uses a simpler Unix epoch format and does not expose your MAC address. The time-ordered structure reduces B-tree index fragmentation by up to 90% compared to random UUID v4, resulting in faster inserts, smaller indexes, and better cache hit rates. For new projects starting in 2026, UUID v7 is the recommended choice for any scenario requiring time-based ordering — especially database primary keys, event logs, and distributed message queues.
How to decode a UUID?
Decoding a UUID means extracting the structural information encoded within its 128 bits. Every UUID contains a version field (bits 48-51) identifying how it was generated, and a variant field (bits 64-65) identifying the UUID standard it conforms to. Beyond these common fields, different versions embed different data: UUID v1 and v6 contain a 60-bit timestamp and a 48-bit node (MAC address); UUID v7 contains a 48-bit Unix timestamp in milliseconds; UUID v3 and v5 contain a truncated hash of a namespace and name. To decode a UUID, paste it into the Decode tab of this tool. It will instantly display the version, variant, timestamp (for time-based versions), and validity status. Programmatically, you can decode by parsing the hex digits and applying bitwise operations to extract each field according to the RFC 9562 specification.
UUID vs ULID vs nanoid — which should I use?
UUID, ULID, and nanoid serve the same fundamental purpose — generating unique identifiers — but differ in format, sortability, and standardization. UUID is the most widely adopted standard (RFC 9562), supported natively by virtually all databases, languages, and frameworks. UUID v7 provides time-based sorting in the standard 128-bit, 36-character format. ULID (Universally Unique Lexicographically Sortable Identifier) predates UUID v7 and uses Crockford Base32 encoding to produce a 26-character, sortable string. Now that UUID v7 exists as an IETF standard, ULID's main advantage — sortability — is available in the universal UUID format. nanoid generates shorter identifiers (default 21 characters) using a URL-safe alphabet, making it ideal when string length matters and you don't need cross-system interoperability. For most applications, UUID v4 (general purpose) or UUID v7 (database keys) is the recommended choice due to universal tooling support, native database types, and formal standardization.

Related Tools

View all tools →