UUID Generator — Create Random UUIDs Online

This UUID generator creates random UUID v4 values using the Web Crypto API. Generate single or bulk UUIDs in five formats: standard, no hyphens, uppercase, braces, and URN. Validate existing UUIDs to check their version, variant, and RFC 4122 field breakdown.

UUID Generator

Generate random UUID v4 values or validate existing UUIDs

1

Frequently Asked Questions

What is a UUID?

A UUID (Universally Unique Identifier) is a 128-bit identifier standardized by RFC 4122. It is represented as 32 hexadecimal digits in five groups separated by hyphens (8-4-4-4-12). UUIDs are designed to be globally unique without requiring a central registration authority, making them ideal for distributed systems, databases, and software development.

What is the difference between UUID v4 and v1?

UUID v1 is generated from a timestamp and the MAC address of the host machine, providing temporal ordering but exposing host identity. UUID v4 is generated using random or pseudo-random numbers, providing 122 bits of randomness. V4 is the most widely used version because it is simple to generate, has no privacy concerns, and provides excellent uniqueness guarantees.

What is the probability of a UUID v4 collision?

UUID v4 has 122 random bits, yielding approximately 5.3 × 10^36 possible values. The probability of generating a duplicate is astronomically small: you would need to generate about 2.71 × 10^18 (2.71 quintillion) UUIDs to have a 50% chance of a single collision. In practical terms, generating 1 billion UUIDs per second for 85 years gives only a 50% probability of one duplicate.

What is the difference between UUID and GUID?

UUID (Universally Unique Identifier) and GUID (Globally Unique Identifier) refer to the same concept — a 128-bit unique identifier. UUID is the term used in RFC 4122 and most open-source ecosystems, while GUID is the term used by Microsoft in Windows and .NET. The formats are functionally identical, though GUIDs are sometimes displayed with curly braces.

Should I use UUIDs as database primary keys?

UUIDs work well as primary keys in distributed databases where multiple nodes generate IDs independently. They eliminate the need for centralized auto-increment sequences. However, standard UUID v4 values are random, which can cause B-tree index fragmentation and slower insert performance compared to sequential IDs. Consider UUID v7 (time-ordered) or ULID for better database performance.

How many bytes is a UUID?

A UUID is exactly 16 bytes (128 bits). When stored as a string in the standard format (8-4-4-4-12 with hyphens), it takes 36 characters (32 hex digits + 4 hyphens). For storage efficiency, databases like PostgreSQL have a native UUID type that stores UUIDs as 16 bytes rather than 36-byte strings.

Are UUIDs secure for tokens and secrets?

UUID v4 generated with a cryptographically secure random number generator (like crypto.randomUUID()) provides 122 bits of randomness, which is sufficient for session tokens and CSRF tokens. However, UUIDs are not designed to be secrets — they are meant to be unique, not unpredictable. For API keys or authentication tokens, use purpose-built libraries that generate cryptographically secure random strings.

What UUID format should I use?

The standard hyphenated format (8-4-4-4-12) is the most common and interoperable. Use no-hyphens format when storage space matters or for URL-friendly identifiers. Use the braces format ({...}) for Microsoft COM/DCOM compatibility. Use the URN format (urn:uuid:...) when embedding UUIDs in URN namespaces or XML documents.

Can I generate UUIDs offline?

Yes. UUID v4 only requires a source of random numbers, which is available on all modern devices through the operating system or browser. This tool generates UUIDs entirely in your browser using the Web Crypto API (crypto.randomUUID()). No server requests are made and no data leaves your device.

What are the different UUID variants?

The variant field (bits 64-65 of the UUID) identifies the layout of the UUID. The most common is RFC 4122 (variant 1, indicated by the two most significant bits being '10'). Other variants include NCS backward compatibility (variant 0), Microsoft COM/DCOM (variant 2), and a reserved variant for future use. All UUIDs generated by this tool use the RFC 4122 variant.

About UUID / GUID

A UUID (Universally Unique Identifier) is a 128-bit identifier standardized by RFC 4122. UUIDs are designed to be unique across all systems without requiring a central registration authority. They are commonly referred to as GUIDs (Globally Unique Identifiers) in the Microsoft ecosystem. UUIDs are used extensively in databases, distributed systems, APIs, and software development to identify resources without coordination between parties.

A standard UUID is represented as 32 hexadecimal digits displayed in five groups separated by hyphens: xxxxxxxx-xxxx-Mxxx-Nxxx-xxxxxxxxxxxx, where M indicates the version and N indicates the variant.

UUID Versions Explained

The UUID specification defines several versions, each with a different generation method:

VersionNameDescription
v1Time-basedGenerated from a timestamp and the MAC address of the host machine. Provides temporal ordering but exposes the host identity.
v2DCE SecuritySimilar to v1 but incorporates POSIX UID/GID. Rarely used in practice outside DCE environments.
v3Name-based (MD5)Deterministic UUID generated by hashing a namespace and name with MD5. Same inputs always produce the same UUID.
v4RandomGenerated using random or pseudo-random numbers. The most widely used version due to its simplicity and strong uniqueness guarantees. This tool generates v4 UUIDs.
v5Name-based (SHA-1)Like v3 but uses SHA-1 instead of MD5. Preferred over v3 for new applications requiring deterministic UUIDs.

UUID Format & Structure

A UUID consists of 128 bits (16 bytes) represented as 32 hexadecimal digits in the canonical form 8-4-4-4-12. The fields according to RFC 4122 are:

FieldHex DigitsDescription
time_low8Low 32 bits of the timestamp
time_mid4Middle 16 bits of the timestamp
time_hi_and_version4High 4 bits are the version, lower 12 bits are the timestamp
clock_seq4Variant (2-3 bits) and clock sequence (13-14 bits)
node1248-bit node identifier (typically MAC address for v1)

For UUID v4, all fields except the version and variant bits are filled with random data, providing 122 bits of randomness.

UUID vs GUID

UUID and GUID refer to the same concept — a 128-bit unique identifier. The term "UUID" comes from the RFC 4122 standard and is used across Linux, macOS, and most programming languages. The term "GUID" (Globally Unique Identifier) originated at Microsoft and is prevalent in Windows, .NET, and COM development. The only practical differences are:

  • Naming convention — RFC standards and most open-source projects use "UUID"; Microsoft documentation uses "GUID"
  • Format representation — GUIDs are sometimes displayed with braces: {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}
  • Byte ordering — Microsoft's GUID structure uses mixed-endian byte order internally, while RFC 4122 UUIDs use network byte order (big-endian)

Common Use Cases

  • Database Primary Keys — UUIDs serve as globally unique primary keys that can be generated independently by any node, eliminating the need for auto-increment sequences and central ID servers
  • Distributed Systems — Microservices, message queues, and event-driven architectures use UUIDs to identify messages, transactions, and correlation IDs without coordination
  • Session Tokens — Web applications use UUIDs for session identifiers, CSRF tokens, and temporary access keys because their randomness makes them hard to predict
  • API Resource Identifiers — RESTful APIs expose UUIDs in URLs (e.g., /api/users/550e8400-e29b-41d4-a716-446655440000) to avoid sequential ID enumeration
  • File & Object Storage — Cloud storage services use UUIDs to name blobs, files, and objects to prevent naming collisions across tenants
  • Device & Component Identification — Bluetooth, USB, and other hardware protocols use UUIDs to identify services and characteristics

Related Tools

Related Tools