UUID Generator

Generate UUID v1, v4, v5, or v7 — single or bulk, with format options and export. All generation happens in your browser — nothing is sent to a server.

Version
UUID v4
Bulk Generation
Generate multiple UUIDs at once
Count

UUID (Universally Unique Identifier, RFC 4122) is a 128-bit identifier displayed as 32 hexadecimal digits in five groups: xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx. UUID v4 generates all 122 variable bits randomly, making it the standard choice for unique IDs that require no central registry.

What is a UUID?

A UUID (Universally Unique Identifier) is a 128-bit label used to identify information in computer systems. The standard format is 32 hexadecimal digits displayed in five groups separated by hyphens:

xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx

UUID v4 is the most widely used version. All 122 variable bits are randomly generated, making collisions statistically impossible in practice. It is used for database primary keys, session tokens, file names, and distributed system IDs.

UUID v4 vs other versions

  • v1 — Based on timestamp + MAC address. Predictable, not recommended for security-sensitive IDs.
  • v3 / v5 — Deterministic, namespace-based (MD5 or SHA-1). Used when you need the same ID for the same input. This tool supports v5.
  • v4 — Randomly generated. The default choice for database keys and unique tokens.
  • v7 — Timestamp-sortable random UUID. Increasingly used in databases for index efficiency.

This generator supports v1, v4, v5, and v7 above — pick a version from the selector, and for v5 provide a namespace and name.

Use cases

  • Database primary keys (PostgreSQL uuid type, MongoDB ObjectId alternative)
  • REST API resource identifiers (/users/550e8400-e29b-41d4-a716-446655440000)
  • Session and token IDs
  • Idempotency keys for payment APIs
  • File names for uploaded assets

Worked example: reading the timestamp out of a v7

A v7 UUID is not opaque. Its first 48 bits are the Unix timestamp in milliseconds, big-endian, which means you can recover the moment it was created from the string alone — no database lookup. Take the first three hyphen-separated groups, drop the hyphens, and read the first twelve hex digits as one integer:

0199c82c-c000-7eec-99b0-6ec20fbb1f29
└──────┘ └──┘ │
   8 hex  4 hex │
└───────────┘  └─ version nibble: 7
  0199c82cc000  = 1760000000000 ms
                = 2025-10-09T08:53:20Z

Two lines in any language that can parse hex:

// JavaScript
const ms = parseInt(id.replace(/-/g, '').slice(0, 12), 16);
new Date(ms).toISOString();        // 2025-10-09T08:53:20.000Z

# Python
ms = int(uuid.UUID(id).hex[:12], 16)
datetime.datetime.fromtimestamp(ms / 1000, datetime.timezone.utc)

That is also why v7 sorts usefully: because the time leads the string, lexicographic order and creation order are the same. A v4 has no such structure, so sorting a column of v4s tells you nothing about when the rows were made — see UUID v4 vs UUID v7 for what that does to a B-tree index.

Edge cases & gotchas

  • v7 publishes its creation time. The decode above works for anyone who receives the ID. If a UUID is visible to users and the creation time is sensitive — when an account was made, when a draft was started — that is a leak, and v4 is the safer pick. Sortable and private are not the same requirement.
  • v5 is deterministic, not unique. The same namespace and name always produce the same UUID: uuid5(NAMESPACE_URL, 'https://example.com/a') is 6639460f-3425-5329-8097-a58f06127860 every time, on every machine. That is the point of it — but it means a v5 is the wrong choice anywhere you are relying on the ID being new, and two callers who happen to hash the same input get a primary-key collision rather than two rows.
  • v1 encodes a MAC address and a timestamp. It is the one version that can identify the machine that generated it, which is why it is a poor choice for anything user-facing.
  • The nil UUID is a real value. 00000000-0000-0000-0000-000000000000 parses as a valid UUID in most libraries and database types, so it passes a format check while meaning "unset". If a nil UUID would be a bug in your data, check for it explicitly — validation will not.
  • Case is not significant, but string comparison is. The format is defined over hex digits, so 550E8400-… and 550e8400-… are the same identifier. They are not the same string, so a UUID stored as text can hold both forms and compare unequal. Storing it in a real UUID column, or normalising to lowercase on the way in, avoids that whole class of bug.
  • "Collisions are impossible" is shorthand. v4 has 122 random bits, so a collision is not impossible, just overwhelmingly unlikely — and only if the bits are from a cryptographically secure source. A weak or seeded random generator is the realistic failure mode, not the birthday bound. On this page the bits that carry uniqueness come from the browser's CSPRNG — crypto.randomUUID() for v4, crypto.getRandomValues() for v7's random field.

The v7 decode, the v7 sort order and the v5 value above were produced by running them (Python 3.14.6, uuid module, RFC 9562 layout). The UUID generated by this page never leaves your browser.

Frequently Asked Questions

What is a UUID v4?

UUID v4 is a randomly generated 128-bit identifier formatted as five hyphen-separated groups of hexadecimal characters (e.g. 550e8400-e29b-41d4-a716-446655440000). All 122 variable bits are randomly generated, making it the most commonly used UUID version for generating unique IDs without a central registry.

Are the generated UUIDs truly unique?

Yes. This tool uses crypto.randomUUID(), which relies on the browser's cryptographically secure random number generator. The theoretical chance of generating two identical UUID v4 values is approximately 1 in 5.3 × 10³⁶ — effectively zero in any practical scenario.

What is the difference between UUID and GUID?

GUID (Globally Unique Identifier) is Microsoft's name for the same concept. UUID and GUID refer to the same 128-bit identifier format defined by RFC 4122. The terms are interchangeable in practice.

What is UUID v7 and how is it different from v4?

UUID v7 encodes a millisecond-precision Unix timestamp in the first 48 bits, making UUIDs time-sortable. This improves database index performance because new rows are always appended at the end of an index rather than inserted in random positions. Use v7 when you need sortable IDs; use v4 when ordering does not matter. Read more: UUID v4 vs v7 explained.

Can I use a UUID as a database primary key?

Yes. UUID v4 is widely used as a primary key in PostgreSQL (uuid type), MySQL, and MongoDB. The main trade-off is index fragmentation — because v4 values are random, each insert goes to a random B-tree position, which can slow inserts at high volume. UUID v7 avoids this by being time-sortable.

Is my data sent to a server?

No. UUID generation happens entirely in your browser using the native crypto.randomUUID() API (v4) or the Web Crypto SubtleCrypto API (v1, v5, v7). Nothing is transmitted to any server.

Is UUID v5 deterministic?

Yes. UUID v5 is generated from a namespace UUID plus a name string, hashed with SHA-1. The same namespace and name always produce the exact same UUID — useful for generating a stable, repeatable ID for a given input (e.g. a URL or domain name) without needing to store a lookup table. UUID v4 and v7 are random and not repeatable.

Does UUID v1 use my real MAC address?

No. RFC 4122 allows a real network-card MAC address in the node field, but browsers have no access to it. This tool generates a random 48-bit node ID instead, with its multicast bit set (per RFC 4122 section 4.5) to mark it as randomly generated rather than hardware-derived — so UUID v1 values from this tool are not traceable to a real device.

Last updated: July 2026