UUID Generator – v4, v7, v1 & v5

Generate random (v4), time-ordered (v7), time-based (v1) or name-based (v5) UUIDs in bulk, or paste any UUID to check it and read its version, variant and embedded timestamp.

What Is a UUID?

A UUID (Universally Unique Identifier) is a 128-bit label used to uniquely identify information in computer systems. Also known as GUIDs (Globally Unique Identifiers) in Microsoft ecosystems, UUIDs are formatted as 32 hexadecimal characters displayed in 5 groups separated by hyphens: xxxxxxxx-xxxx-Mxxx-Nxxx-xxxxxxxxxxxx, where M indicates the version and N indicates the variant.

UUIDs were standardized by the Open Software Foundation (OSF) as part of the Distributed Computing Environment (DCE), formalized in RFC 4122 and updated in 2024 by RFC 9562, which added versions 6, 7 and 8. They solve a fundamental problem in distributed computing: generating unique identifiers without a central coordinating authority.

UUID Versions Explained

  • UUID v4 (random) — 122 random bits from your browser’s cryptographically secure random number generator. The most widely used version and the right default when you just need a unique ID.
  • UUID v7 (time-ordered) — The first 48 bits are the Unix time in milliseconds, the rest is random. New v7 UUIDs sort after older ones, which keeps database indexes compact. This generator also keeps UUIDs created in the same millisecond in order (RFC 9562, method 1: a 12-bit counter that starts at a random value), so a batch of 1,000 is strictly ascending.
  • UUID v1 (timestamp + node) — A 60-bit count of 100-nanosecond intervals since 15 October 1582, a clock sequence and a 48-bit node ID. Classic v1 uses the network card’s MAC address; this tool uses a random node ID with the multicast bit set, as RFC 9562 recommends, so nothing about your device is revealed. The timestamp fields are stored in a shuffled order, so v1 UUIDs do not sort by time as text.
  • UUID v5 (name-based, SHA-1) — Computed from a namespace UUID and a name. The same input always gives the same UUID, on any machine and in any language. Useful when you need a stable ID for something that already has a unique name, such as a domain or a URL.
  • Nil and Max — 00000000-0000-0000-0000-000000000000 and ffffffff-ffff-ffff-ffff-ffffffffffff are reserved special values, often used as “no value” or as a sentinel in range queries.

UUID v4 vs v7 for Database Keys

Random v4 keys land at random positions in a B-tree index. Every insert touches a different page, so on large tables the index grows fragmented and inserts slow down. A v7 key starts with the current time, so new rows are appended at the end of the index, much like an auto-increment number — while IDs can still be created by any service without coordination. PostgreSQL 18 ships a built-in uuidv7() function for exactly this reason.

The trade-off: a v7 UUID reveals when it was created (paste one into the decoder above to see it). If an ID is shown publicly and the creation time is sensitive, use v4.

How to Use This Tool

  • Generate — pick a version, how many you need (up to 1,000), and the output format: standard lowercase, without hyphens, in braces (as used in Windows registry and C#) or as a URN. Copy the list or download it as a text file.
  • Name-based (v5) — choose a namespace (DNS, URL, OID, X.500 or your own namespace UUID) and enter one name per line. Each line produces one UUID. For example, the DNS namespace and the name python.org always give 886313e1-3b8a-5372-9b90-0c9aee199e5d.
  • Decode / validate — paste a UUID to check that it is well-formed and to see its version, variant, the embedded creation time (v1, v6, v7), clock sequence and node, plus the same value in other notations, including the 128-bit integer.

Everything runs in your browser. The UUIDs you generate or paste are never sent to a server.

Real-World Use Cases

  • Database Primary Keys — UUIDs are ideal primary keys in distributed databases where auto-incrementing integers would cause conflicts. Prefer v7 for large, write-heavy tables.
  • API Resource Identifiers — Public-facing IDs in REST APIs. Random UUIDs don’t reveal record count or creation order, unlike sequential integers.
  • Deterministic IDs — v5 turns an existing unique name (a URL, an email address, a product SKU) into a UUID, so two systems can derive the same ID independently.
  • File & Asset Naming — Create unique filenames for uploads to prevent conflicts in cloud storage (S3, Azure Blob, GCS).
  • Distributed Systems — Microservices can independently generate unique IDs without coordination. Critical for event sourcing, message queues, and distributed tracing.
  • Testing & Development — Generate test data with realistic unique identifiers for development and QA environments.

Frequently Asked Questions

Are UUIDs truly unique?

UUID v4 generates random values from a space of 2^122 possibilities (approximately 5.3 × 10^36). The probability of a collision is astronomically small — you’d need to generate about 2.71 quintillion UUIDs to have a 50% chance of a single collision. For all practical purposes, they are unique.

Which UUID version should I use?

Use v4 when you just need a unique, unguessable-looking ID. Use v7 for database primary keys and anything you want to sort by creation time. Use v5 when the same input must always produce the same ID. Avoid v1 in new designs: v7 gives you the same time ordering in a simpler, sortable layout.

Can I get the date and time out of a UUID?

Yes for v1, v6 and v7 — they contain a timestamp. Paste the UUID into the Decode / validate tab and the creation time is shown in UTC and in your local time zone. v4 and v5 contain no time information.

How do I check if a string is a valid UUID?

A UUID has exactly 32 hexadecimal digits, usually grouped 8-4-4-4-12. The 13th digit is the version (1–8) and the 17th digit is the variant (8, 9, a or b for standard UUIDs). The decoder above checks all of this and tells you exactly which character or length is wrong. As a regular expression for standard UUIDs: ^[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$ (case-insensitive).

What is the difference between a UUID and a GUID?

None in substance — GUID is Microsoft’s name for the same 128-bit identifier. GUIDs are often written in uppercase and wrapped in braces, like {550E8400-E29B-41D4-A716-446655440000}. Choose the “{Braces}” format and “Uppercase” above to get that style.

Do UUIDs with hyphens work differently than without?

No. Hyphens are purely visual formatting. The UUID 550e8400-e29b-41d4-a716-446655440000 is identical to 550e8400e29b41d4a716446655440000. Most libraries and databases accept both formats.

How much storage does a UUID need?

A UUID is 128 bits (16 bytes) in binary. As a string with hyphens, it takes 36 characters (or 32 without hyphens). Most databases have a native UUID type that stores them efficiently as 16 bytes.