GUID & UUID Generator

Generate UUIDs and GUIDs (v1, v4, v7) instantly. Bulk output, formatting options and one-click copy. Free, no signup, runs in your browser.

Advertisement

Generate UUIDs — v4, v7, v1, v5 or nil — one at a time or a thousand at once

Choose a version, set a quantity between 1 and 1000, pick an output format and generate. Copy a single value, copy the whole batch, or download it as a text file, a CSV or a JSON array. There is also a parser at the bottom of the page: paste any UUID and it reports the version, the variant, the five structural fields, and — for the time-based versions — the embedded timestamp decoded to an ISO date.

Everything is generated in your browser. Random bits come from the Web Crypto API’s cryptographically secure generator, not Math.random. No values are sent anywhere, none are stored, and no two visitors can be handed the same batch by a server that got its bookkeeping wrong — because there is no server involved.

The five options, and when each is the right answer

VersionBuilt fromSortable by creation timeReach for it when
v4122 random bitsNoThe general-purpose default: tokens, correlation IDs, test fixtures, anything where unpredictability matters
v748-bit Unix millisecond timestamp + random bitsYesDatabase primary keys, event and log IDs, anything inserted in time order
v1Timestamp + clock sequence + node identifierRoughlyInteroperating with a legacy system that already uses v1
v5SHA-1 of a namespace UUID plus a nameNoYou need the same input to always produce the same UUID
NilAll zero bitsA defined placeholder for "no UUID"

v4 — random, and the one to use unless you have a reason not to

A v4 UUID is 128 bits of which 122 are random; the other six are fixed by the specification to mark the version and the variant. It encodes nothing. It reveals nothing about when it was made, on what machine, or in what order relative to its siblings. Two independent processes on opposite sides of the world can mint v4 identifiers with no coordination whatsoever and expect never to collide, which is the entire point of the format.

That opacity is a feature when the identifier will be visible — in a URL, an API response, a webhook payload — because a v4 value leaks no information and cannot be enumerated by incrementing. It is a liability inside a database index, for reasons below.

v7 — time-ordered, and what you want for a primary key

A v7 UUID puts a 48-bit Unix timestamp in milliseconds into the leading bits, then fills the rest with cryptographically secure random data. The consequence is the useful part: sorting v7 values as strings or as bytes sorts them by creation time, because the most significant bits are the clock.

That single property is what makes v7 the sensible default for database primary keys. B-tree indexes on most engines store keys in sorted order. Inserting sequential keys appends to the same region of the index, so the pages being written stay in memory and the tree grows tidily at one end. Inserting random keys — which is exactly what v4 gives you — scatters writes across the whole index. Every insert lands on a different page, that page has to be read in if it is not cached, and pages that fill up split. On a large table with a random primary key you get more buffer-pool churn, more page splits, more fragmentation and a physically larger index than the same data keyed in time order. This is the well-documented reason teams historically preferred auto-increment integers over UUID primary keys; v7 is the format that removes the reason.

The costs are real but small. A v7 value discloses its own creation time to anyone holding it, so do not use it where that is sensitive — it is a poor choice for a password-reset token or an unguessable share link, even though the random portion is generated securely. And two v7 values minted in the same millisecond have no defined order between them; v7 gives you coarse chronological ordering, not a strict monotonic sequence. If you need to know which of two events in the same millisecond came first, you need a real sequence number, not a UUID.

v1 — timestamp and node, mostly of historical interest

A v1 UUID also embeds a timestamp, but with two awkward differences from v7. The clock is a count of 100-nanosecond intervals since 15 October 1582 — the start of the Gregorian calendar — and the timestamp is split across three fields in a scrambled order, with the low-order bits first. That layout means v1 values do not sort chronologically as strings, which is why v1 never delivered the index benefit that v7 does.

The other difference is the node field, the last twelve hex digits. It was originally specified to hold the generating machine’s MAC address, which is why v1 has a privacy reputation: a v1 UUID could identify the physical host that produced it and reveal roughly when. Modern implementations, including the one behind this page, generate that node value randomly instead rather than reading a real network interface — a browser cannot see your MAC address in any case. Treat v1 as something to generate when you are matching an existing system’s format, and reach for v7 for anything new.

v5 — the same input always yields the same UUID

v5 is not random at all. It hashes a namespace UUID together with a name string using SHA-1 and formats the result as a UUID. Feed it the same namespace and the same name and you get the same value every time, on any machine, forever. That makes it the tool for deriving a stable identifier from something you already have — a domain name, a file path, an external system’s key — without storing a mapping table.

The four namespace UUIDs defined by the specification are offered directly, and you can supply your own:

  • 6ba7b810-9dad-11d1-80b4-00c04fd430c8 — DNS, for hostnames
  • 6ba7b811-9dad-11d1-80b4-00c04fd430c8 — URL
  • 6ba7b812-9dad-11d1-80b4-00c04fd430c8 — ISO OID
  • 6ba7b814-9dad-11d1-80b4-00c04fd430c8 — X.500 distinguished name
  • Custom — any valid UUID of your own, which is how you keep your derived identifiers from colliding with anyone else’s

Two consequences follow from determinism. Generating a batch of v5 UUIDs with the same name gives you the same value repeated, which is correct behaviour rather than a bug. And because v5 is a hash of the input, anyone who can guess the name and knows the namespace can compute the UUID — so a v5 identifier derived from an email address is not a secret. Note also that this generator produces v5; it does not offer v3, the older MD5-based equivalent.

The nil UUID

00000000-0000-0000-0000-000000000000 is a specific value defined by the standard: 128 zero bits, all fields zero. It is the canonical way to express "no UUID here" in a field that must contain a syntactically valid UUID and cannot be null — a non-nullable database column during a migration, a protocol field with a fixed width, a default in a struct.

Its trap is that it looks valid to every validator, so a nil UUID that arrives because of an uninitialised variable rather than a deliberate choice will pass every check and fail every lookup. Treating nil as a real error condition in your code is usually correct. It is worth knowing that the standard also defines a max UUID of all f digits; this tool does not generate that one.

Collision probability, stated honestly

A v4 UUID has 122 random bits, so the space of possible values is 2 to the power of 122. That is a number with thirty-seven digits, and the practical consequence is that for any workload a normal application will ever produce, an accidental duplicate is not something to design around. Software engineering folklore is full of specific-sounding odds for this; most of them are repeated without a source, so here is the claim without a fabricated statistic: the space is large enough that collisions from correctly generated v4 UUIDs are not a realistic operational concern, and a unique constraint on the column is the appropriate and cheap belt-and-braces measure.

The failure that does happen in the real world is not the birthday problem — it is a broken random source. UUIDs generated from a poorly seeded pseudo-random generator, or from the same seed on many freshly booted identical VMs or containers, can and do repeat. That is a bug in the generator, not a property of the format. This page uses the browser’s cryptographic random source, which is the right one.

v7 collision behaviour differs slightly and favourably: because the leading bits are a timestamp, two v7 values can only collide if they were generated in the same millisecond and their random portions matched, which is a smaller space of opportunity than v4’s.

Output formats

The same 128 bits get written down in several conventional ways, and different ecosystems expect different ones. Choose the one your target wants:

FormatExample shapeWhere you meet it
Standard550e8400-e29b-41d4-a716-446655440000The canonical form: lowercase, hyphenated, 36 characters
Uppercase550E8400-E29B-41D4-A716-446655440000Some Microsoft and mainframe tooling
No hyphens550e8400e29b41d4a71644665544000032 characters; compact storage, URL path segments, some APIs
Braces{550e8400-e29b-41d4-a716-446655440000}Windows registry keys, COM GUIDs, .NET’s "B" format
URNurn:uuid:550e8400-e29b-41d4-a716-446655440000The registered URN namespace, used in XML and RDF

These are presentation choices only — the underlying value is identical in all five. Case is not significant when comparing UUIDs, and the canonical output form is lowercase, but a string comparison in your code is case-sensitive, so a system storing uppercase and a system storing lowercase will fail to match records that are in fact the same. Normalise on the way in. Similarly, if you strip hyphens for storage, strip them consistently; a mixed table is a long afternoon.

Batches and exports

The quantity field takes any number from 1 to 1000, with one-click shortcuts for 10, 100 and 1000 — enough to seed a test fixture, populate a staging table or pre-allocate a block of identifiers. The whole batch can be copied to the clipboard in one action, or downloaded three ways: plain text with one UUID per line, CSV with columns for the UUID, the version and a generation timestamp, or JSON with the version, format, count, timestamp and the array of values. All three apply the format you selected.

The parser: reading a UUID someone handed you

Paste a UUID into the parser and it reports what the value actually is, which is faster than counting hex digits by eye. It gives you the version number read from the version nibble, the variant, and the five canonical fields — time-low, time-mid, time-high-and-version, clock-sequence and node — broken out separately. For v1 and v7 it also decodes the embedded timestamp to an ISO 8601 date and to milliseconds since the Unix epoch, each version using its own clock convention.

That timestamp readout answers real questions. When was this record actually created, when the created_at column is missing or looks wrong? Is this identifier from the migration or from after it? Is the batch someone sent me actually from the window they claim? It also demonstrates the privacy point about v7 and v1 in the most direct way possible: the creation time is not metadata alongside the identifier, it is inside it, readable by anyone.

What Is a UUID Generator

A UUID (Universally Unique Identifier) generator creates 128-bit identifiers that are guaranteed to be unique across space and time without requiring a central registration authority. UUIDs are formatted as 32 hexadecimal characters displayed in five groups separated by hyphens: 550e8400-e29b-41d4-a716-446655440000. They are fundamental to distributed systems, databases, and APIs where globally unique identifiers are needed without coordination between systems.

UUIDs solve a critical problem in distributed computing: how do independent systems create identifiers that will never collide? Auto-incrementing database IDs work within a single database but fail when merging data from multiple sources, synchronizing offline clients, or building microservices architectures. UUIDs eliminate this problem entirely.

How UUIDs Work

The UUID specification (RFC 9562, formerly RFC 4122) defines several versions, each generating uniqueness through different mechanisms:

VersionNameGeneration MethodUse Case
v1Time-basedTimestamp + MAC addressLegacy systems needing temporal ordering
v3Name-based (MD5)MD5 hash of namespace + nameDeterministic IDs from known inputs
v4Random122 bits of random dataGeneral-purpose unique identifiers
v5Name-based (SHA-1)SHA-1 hash of namespace + nameDeterministic IDs (preferred over v3)
v7Time-orderedUnix timestamp + random dataSortable IDs for databases (newest)

UUID v4 is the most commonly used version. With 122 random bits, the probability of generating two identical UUIDs is astronomically low—you would need to generate 2.71 × 10^18 UUIDs before having a 50% chance of a single collision.

UUID v7 (introduced in RFC 9562) is gaining adoption because it embeds a Unix millisecond timestamp in the first 48 bits, making UUIDs naturally sortable by creation time. This significantly improves database index performance compared to random v4 UUIDs.

Common Use Cases

  • Database primary keys: Use UUIDs instead of auto-incrementing integers for globally unique, merge-safe identifiers
  • API resource identifiers: Expose UUIDs in URLs and responses to avoid leaking sequential information
  • Distributed systems: Generate IDs independently on multiple servers without coordination or collision risk
  • Session tokens: Create unique session identifiers for authentication systems
  • File naming: Generate unique filenames for uploads to prevent collisions in object storage

Best Practices

  1. Use v7 for new database applications — Time-ordered UUIDs produce better B-tree index performance than random v4 UUIDs
  2. Use v4 when ordering doesn't matter — Random UUIDs are the simplest choice when temporal sorting is unnecessary
  3. Use v5 for deterministic generation — When you need the same input to always produce the same UUID (namespace mapping)
  4. Never use UUIDs as security tokens — v1 UUIDs leak timestamps and MAC addresses; even v4 UUIDs are not cryptographically secure
  5. Consider storage format — Store as BINARY(16) in databases for efficiency rather than CHAR(36); this halves storage and improves query performance

Frequently Asked Questions

What is a UUID and why should I use it?+

A UUID (Universally Unique Identifier) is a 128-bit number guaranteed to be unique across space and time without coordination. Format: 8-4-4-4-12 hexadecimal digits (e.g., 550e8400-e29b-41d4-a716-446655440000). Why use UUIDs: (1) Globally unique - No central registry needed, generate anywhere without conflicts. (2) Distributed systems - Multiple systems can generate IDs independently. (3) Merge-safe - Combining databases never creates ID collisions. (4) Security - Non-sequential prevents enumeration attacks. (5) Migration-friendly - Move records between systems without ID conflicts. Use cases: Database primary keys, Microservices communication, File naming, Session IDs, API request IDs, Document identifiers. Alternative: Auto-incrementing integers are simpler but: Reveal record counts, Cause merge conflicts, Enable enumeration attacks, Require coordination. Use UUIDs when: Working with distributed systems, Need globally unique IDs, Merging databases, Building APIs, Prioritizing security.

What are the differences between UUID versions (v1, v4, v5)?+

UUID has multiple versions for different use cases: UUIDv1 (Time-based) - Includes timestamp and MAC address, Sortable chronologically, Reveals creation time and computer MAC, Privacy concern - MAC address is identifiable, Use when: Need chronological sorting, Privacy not a concern. UUIDv4 (Random) - Purely random (122 bits of randomness), No embedded information, Most popular version, Collision probability: 1 in 5.3 × 10^36 for one billion UUIDs per second for 100 years, Use when: Need maximum randomness, Privacy important, No sorting required. UUIDv5 (Name-based SHA-1) - Generated from namespace + name using SHA-1 hash, Deterministic - same input always produces same UUID, Reproducible without storage, Use when: Need reproducible IDs, Deriving UUIDs from existing identifiers, Content-addressable systems. Deprecated: UUIDv2 (DCE Security) - rarely used, UUIDv3 (Name-based MD5) - obsolete, use v5 instead. Recommendation: Use v4 for general purposes, v1 when you need time sorting, v5 when you need deterministic generation.

Are UUIDs truly unique? Can collisions happen?+

UUIDs are designed to be unique with astronomically low collision probability: UUIDv4 Collision Math: 122 random bits = 2^122 possible values (5.3 × 10^36), Probability of collision with 1 billion UUIDs per second for 100 years: ~0.0000000001%, Need to generate 2^61 UUIDs to have 50% collision chance, Effectively impossible in practice. However, collisions CAN happen if: Using broken random number generators (Mersenne Twister, poor seeding), Generating millions of UUIDs in tight loops with weak RNG, Virtualization/containerization cloning with same RNG state, Bugs in UUID library implementations. UUIDv1 uniqueness depends on: MAC address uniqueness (generally guaranteed), Clock accuracy and monotonicity, More predictable but still effectively unique. Best practices: Use cryptographically secure random number generators (not Math.random()), Don't implement UUID generation yourself - use tested libraries, Test UUID uniqueness in your application, Consider UUIDv7 (time-ordered) for databases requiring sortability. In practice, if using proper libraries, collisions are not a real concern.

Should I use UUIDs or auto-incrementing integers as database primary keys?+

The UUID vs auto-increment debate has important trade-offs: UUIDs as Primary Keys - Pros: Globally unique (merge databases safely), Generate client-side (reduce database roundtrips), Distributed-friendly (multiple services generate IDs), Secure (can't enumerate records), Partition-friendly (distribute across shards). UUIDs as Primary Keys - Cons: Larger storage (16 bytes vs 4-8 bytes for integers), Slower lookups and joins (larger indexes), Random insertion causes index fragmentation (performance hit), Harder to debug (complex values), URL-unfriendly (long identifiers). Auto-Increment Integers - Pros: Small storage (4-8 bytes), Fast lookups and joins (compact indexes), Sequential insertion (better performance), Human-readable, URL-friendly. Auto-Increment Integers - Cons: Database-dependent (hard to merge), Reveal record counts (security/competitive issue), Enumeration attacks (guess valid IDs), Distributed systems problems (coordination needed). Modern solution: UUIDv7 (coming) - Time-ordered UUIDs combining benefits of both. Recommendation: Use auto-increment for: Single database systems, Internal applications, Performance-critical apps. Use UUIDs for: Microservices, APIs, Multi-tenant SaaS, Distributed systems, Security-sensitive apps.

How do I store UUIDs efficiently in databases?+

UUID storage varies by database with significant performance implications: PostgreSQL: Native UUID type (16 bytes), use uuid column type, Supports indexes, Very efficient. MySQL 8.0+: Native UUID type, use UUID or BINARY(16), Convert string to binary: UUID_TO_BIN(), Convert back: BIN_TO_UUID(). MySQL 5.7 and earlier: Store as CHAR(36) (wasteful - 36 bytes), Better: Store as BINARY(16), Manual conversion: UNHEX(REPLACE(uuid, '-', '')). SQL Server: Native uniqueidentifier type (16 bytes), Supports indexes, Use NEWSEQUENTIALID() for better performance (reduces fragmentation). MongoDB: Native UUID/GUID support, store as BinData type. Performance Tips: (1) Always store as binary (16 bytes), never as string (36 bytes). (2) Use indexed UUID columns sparingly. (3) Consider UUIDv1 or UUIDv7 for time-ordering (reduces index fragmentation). (4) Partition by UUID prefix if needed. (5) Use covering indexes for UUID lookup queries. Storage comparison: UUID as CHAR(36): 36 bytes, UUID as BINARY(16): 16 bytes (56% savings), Integer as INT: 4 bytes, Integer as BIGINT: 8 bytes. For high-volume systems, the storage difference matters significantly.

Can I generate UUIDs in different programming languages?+

UUID generation is built into most languages: JavaScript/Node.js: crypto.randomUUID() (Node 14.17+, browser), require('uuid').v4() (npm package). Python: import uuid, uuid.uuid4() (random), uuid.uuid1() (time-based), uuid.uuid5() (name-based). Java: java.util.UUID, UUID.randomUUID() (v4), UUID.nameUUIDFromBytes() (v3/v5). C#/.NET: System.Guid, Guid.NewGuid() (v4). PHP: uniqid() (not true UUID), Ramsey\\Uuid\\Uuid::uuid4() (proper library). Ruby: require 'securerandom', SecureRandom.uuid. Go: github.com/google/uuid, uuid.New() or uuid.NewRandom(). Rust: use uuid::Uuid, Uuid::new_v4(). SQL: PostgreSQL: gen_random_uuid(), MySQL: UUID(), SQL Server: NEWID(). Key principles: Use built-in crypto-secure functions, Don't implement your own, Avoid Math.random() or similar weak RNGs, Test for uniqueness in critical applications. Most languages have battle-tested UUID libraries - never roll your own.

What is the difference between UUID and GUID?+

UUID (Universally Unique Identifier) and GUID (Globally Unique Identifier) are the same thing with minor differences in terminology and presentation: UUID - Standard term (RFC 4122), Used in most technologies and languages, Written with lowercase hex digits (550e8400-e29b-41d4-a716-446655440000), Common in open-source, Linux/Unix, APIs. GUID - Microsoft's term for the same concept, Used primarily in Windows and .NET ecosystem, Often written with uppercase hex digits (550E8400-E29B-41D4-A716-446655440000), Sometimes shown in Windows registry format with braces: {550E8400-E29B-41D4-A716-446655440000}. Technical equivalence: Both are 128-bit identifiers, Same format: 8-4-4-4-12 hex digits, Same generation algorithms, Same uniqueness guarantees, Fully interoperable. Practical differences: Case sensitivity (lowercase vs uppercase is convention, not requirement), Brace formatting (cosmetic), API/function naming (UUID.randomUUID() vs Guid.NewGuid()). Recommendation: Use "UUID" for cross-platform systems, Use "GUID" when working specifically with Microsoft technologies, Convert between formats as needed (trivial - just case and braces), Don't worry about the distinction - they're the same thing.

When should I use UUID v5 for deterministic ID generation?+

UUIDv5 is ideal when you need reproducible IDs from existing data: How UUIDv5 works: Takes namespace UUID + name string, Applies SHA-1 hash, Produces deterministic UUID (same input → same output), Version bits set to 5. Use cases: (1) Content-addressed storage - File SHA-256 hash → UUID for referencing. (2) Idempotent API operations - Request parameters → UUID ensures same request gets same ID. (3) Derived identifiers - User email → UUID without storing mapping. (4) Data migration - Old ID → UUID for backward compatibility. (5) Reproducible test data - Generate consistent UUIDs across test runs. Standard namespaces: DNS: 6ba7b810-9dad-11d1-80b4-00c04fd430c8 (domain names), URL: 6ba7b811-9dad-11d1-80b4-00c04fd430c8 (URLs), OID: 6ba7b812-9dad-11d1-80b4-00c04fd430c8 (ISO OIDs), X500: 6ba7b814-9dad-11d1-80b4-00c04fd430c8 (X.500 DNs). Example: uuid5(DNS_NAMESPACE, "example.com") → Always produces same UUID. Don't use v5 for: Primary security identifiers (not random), Session tokens (predictable), One-time codes (not random enough). Recommendation: Use v5 when repeatability matters, v4 when randomness required.

This tool is provided for informational and educational purposes only. All processing happens in your browser — no data is sent to or stored on our servers. While we strive for accuracy, we make no warranties about the completeness or reliability of results.