ByteCompress

UUID Generator

Generate cryptographically random Version 4 UUIDs instantly in your browser. Single or bulk generation using the Web Crypto API per RFC 9562.

51
FreeClient-sideNo signup

UUID v4 has 122 random bits, giving approximately 5.3Γ—1036 possible values. To have a 50% probability of a single collision, you would need to generate 2.71Γ—1018 UUIDs. At one billion per second, that takes 85 years. UUID v4 is standardized in RFC 9562 (successor to RFC 4122) and is the most widely deployed identifier format in modern distributed systems. This generator uses the browser's crypto.randomUUID() API, backed by the operating system's CSPRNG. Generate one UUID or hundreds at a time β€” no server, no signup.

How to Generate UUIDs

  1. Click Generate to create a single UUID instantly.
  2. Enter a quantity (e.g., 10, 100, 1000) and click Generate Bulk for multiple UUIDs at once.
  3. Click any UUID in the list to copy it individually, or use Copy All to copy the full list.
  4. Choose uppercase or lowercase output format as required by your target system.
  5. Use Download to export as a text file.

UUID v4 Explained

Structure and Format

A UUID is 32 hexadecimal characters in an 8-4-4-4-12 pattern: xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx. The 4 in the third group is fixed (version 4). The first 1-2 bits of the fourth group are fixed as 10 in binary (RFC 4122 variant). The remaining 122 bits are randomly generated. UUID v4 appears in every major cloud provider, database system, and web framework as the default identifier format.

Collision Probability

With 2122 possible values (~5.3Γ—1036), generating a duplicate UUID v4 from a proper CSPRNG is statistically negligible for any real-world application. UUID v4 collisions are treated as impossible for practical purposes.

Example

Generated UUID v4

f47ac10b-58cc-4372-a567-0e02b2c3d479

Same UUID in different representations

Hyphenated:  f47ac10b-58cc-4372-a567-0e02b2c3d479
Uppercase:   F47AC10B-58CC-4372-A567-0E02B2C3D479
No hyphens:  f47ac10b58cc4372a5670e02b2c3d479
URN format:  urn:uuid:f47ac10b-58cc-4372-a567-0e02b2c3d479

UUID Versions Compared

  • v1 β€” Time-based, incorporates the MAC address of the generating machine. Exposes hardware information and has sequential patterns. Avoid for security-sensitive identifiers.
  • v3 / v5 β€” Name-based and deterministic: the same input namespace + name always produces the same UUID. Useful for reproducible identifiers.
  • v4 β€” Fully random (122 bits). No embedded information, no sequential patterns. The most widely used type for application-generated identifiers.
  • v7 β€” Time-ordered random UUIDs (RFC 9562). The first 48 bits are a Unix millisecond timestamp, making v7 UUIDs sortable by creation time. Better for database B-tree index performance than v4.

Common Use Cases

  • Primary keys in PostgreSQL (uuid type), MySQL (VARCHAR(36)), and MongoDB
  • Distributed system IDs where multiple services create records independently without a central sequence
  • API resource identifiers exposed in public URLs (safer than sequential integers which enable enumeration attacks)
  • File names for uploaded assets to prevent collisions
  • Idempotency keys for API requests to prevent duplicate processing on retry

For generating secure random passwords (rather than identifiers), use the Password Generator. For time-based identifiers that are also database-sortable, look for UUID v7 support in your database driver or ORM.

Frequently Asked Questions

How unique is a Version 4 UUID in practice?

UUID v4 has 122 bits of randomness, giving approximately 5.3Γ—1036 possible values. To have a 50% chance of a single collision, you would need to generate 2.71Γ—1018 UUIDs β€” at one billion per second, that would take about 85 years. For all practical applications, UUID v4 collisions are treated as impossible.

Are the UUIDs generated here cryptographically secure?

Yes. This tool uses crypto.randomUUID() (or crypto.getRandomValues() as a fallback), both backed by the operating system's CSPRNG. Generated UUIDs are suitable for use as security tokens, session identifiers, and other security-sensitive contexts.

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

Both have trade-offs. UUID v4 works well in distributed systems where multiple nodes generate IDs independently, makes IDs unpredictable in public URLs (preventing enumeration attacks), and simplifies database merging. Auto-increment integers are simpler, smaller (4-8 bytes vs 16 bytes), and have better B-tree index performance for sequential inserts. UUID v7 offers a middle ground: random UUIDs that are also time-sortable.

What format does a UUID have?

A UUID is 32 lowercase hexadecimal characters grouped with hyphens in an 8-4-4-4-12 pattern: xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx. Total string length with hyphens is 36 characters. PostgreSQL stores UUIDs as a native 16-byte binary type; MySQL and SQLite typically store the 36-character string.

Can I generate UUIDs offline?

Yes. Once this page is loaded, UUID generation runs entirely using local JavaScript and the browser's built-in crypto API. No network requests are made during generation. The tool works offline after the initial page load.