UUID generator

Generate v4 UUIDs in bulk. Copy as plain text or JSON array — everything runs locally in your browser with crypto-grade randomness.

Format
1 UUID

What is a UUID?

A UUID (Universally Unique Identifier) is a 128-bit value used to identify information in computer systems without requiring a central authority. Defined by RFC 4122, UUIDs are represented as 32 hexadecimal digits grouped into five sections separated by hyphens: 550e8400-e29b-41d4-a716-446655440000.

The most common variant — UUID v4, which this tool generates — uses cryptographically random data for all but 6 of its 128 bits (those 6 bits identify the version and variant). With 2122 possible values, the probability of generating two identical v4 UUIDs is astronomically small, making them safe for use without any coordination between systems.

UUIDs are widely used as database primary keys, API request identifiers, session tokens, distributed system node IDs, message queue deduplication keys, and file or resource identifiers in cloud storage systems.

UUID versions explained

Version 1 combines a timestamp with the machine's MAC address. It guarantees uniqueness but leaks information about when and where it was generated. Rarely used in modern applications due to privacy concerns.

Version 3 generates a deterministic UUID by hashing a namespace and name with MD5. Given the same inputs, it always produces the same UUID. Useful for generating consistent IDs from known data.

Version 4 is the most widely used. It fills 122 bits with cryptographically random data, making each UUID unpredictable and unique. This is what crypto.randomUUID() generates and what this tool produces.

Version 5 is identical to v3 but uses SHA-1 instead of MD5. Preferred over v3 when you need deterministic UUIDs.

Version 7 (RFC 9562) is the newest addition and is gaining rapid adoption. It embeds a Unix timestamp in the first 48 bits, making UUIDs roughly time-ordered. This solves v4's biggest weakness as a database primary key: random UUIDs fragment B-tree indexes, while v7 UUIDs insert in approximate order, maintaining good index performance.

UUIDs vs other ID formats

Auto-increment integers are the simplest option — small, fast to index, and human-readable. But they expose ordering (ID 1000 was created before ID 1001), require a single source of truth, and leak information about your data volume.

ULIDs (Universally Unique Lexicographically Sortable Identifiers) embed a timestamp like UUID v7 but encode in Crockford Base32, producing shorter, sortable strings like 01ARZ3NDEKTSV4RRFFQ69G5FAV.

Nanoids are shorter random IDs with a customisable alphabet. A 21-character nanoid has similar collision resistance to a UUID but takes fewer bytes. Popular in URLs and frontend applications.

Snowflake IDs (used by Twitter/Discord) combine a timestamp, machine ID, and sequence number into a 64-bit integer. They're sortable, compact, and designed for high-throughput distributed systems, but require infrastructure to assign machine IDs.

Frequently asked questions

Can two UUIDs ever be the same?
In theory, yes — but in practice, no. A v4 UUID has 122 random bits, giving 5.3 × 1036 possible values. You would need to generate roughly 2.7 × 1018 (2.7 quintillion) UUIDs before there's a 50% chance of a single collision. For context, if you generated one billion UUIDs per second, it would take about 85 years to reach that point. For all practical purposes, v4 UUID collisions don't happen.
Should I use UUIDs as database primary keys?
It depends on your use case. Pros: UUIDs require no central coordination (any node can generate them independently), they're safe to expose in URLs and APIs (they don't reveal record counts or ordering), and they work well in distributed systems. Cons: at 128 bits, they're larger than auto-increment integers, and their randomness hurts B-tree index performance because inserts scatter across the index instead of appending. If you need the benefits of UUIDs with better index performance, consider UUID v7, which embeds a timestamp prefix so values are roughly time-ordered.
Are UUIDs secure enough for authentication tokens?
V4 UUIDs generated via crypto.randomUUID() use a cryptographically secure pseudorandom number generator (CSPRNG), so the values themselves are unpredictable. However, UUIDs are identifiers, not secrets — they're designed for uniqueness, not for security. For authentication tokens, session IDs, or API keys, use a dedicated library that generates longer, high-entropy tokens with constant-time comparison. In Node.js, crypto.randomBytes(32).toString('hex') gives you a 256-bit token.