UUID Generator — Generate UUID v1/v4 in Bulk
Generate UUID v1 or v4 with one click. Supports bulk generation and CSV export.
About UUID Generator — Generate UUID v1/v4 in Bulk
UUID Generator creates RFC 4122-compliant version 4 (random) UUIDs instantly in your browser. Generate a single ID or a bulk batch of up to 100 at once — ideal for database primary keys, session tokens, file names, and any other scenario that needs a globally unique identifier.
How to Use
- 1Choose how many UUIDs to generate (1–100) using the count option.
- 2Click "Generate UUID" to produce the IDs.
- 3Copy the result or use the download button to save as a text file.
Features
- Instant RFC 4122 v4 UUID generation — cryptographically random
- Bulk mode: generate up to 100 UUIDs in one click
- Output is ready to paste directly into code or a database
- Runs offline in your browser — no data is ever sent to a server
What Is a UUID and Why Does It Matter?
A UUID (Universally Unique Identifier) is a 128-bit label used to identify information in computer systems without a central authority. Defined by RFC 4122, a UUID is displayed as 32 hexadecimal digits split into five groups separated by hyphens (8-4-4-4-12). The "universally unique" guarantee means any UUID generated anywhere, at any time, should be unique — making them ideal for distributed systems.
How UUID Generation Works
Version 4 UUIDs use a cryptographically secure random number generator to fill 122 of the 128 bits with random data. The remaining 6 bits encode the version (4) and variant (RFC 4122). The result is a 36-character string like 550e8400-e29b-41d4-a716-446655440000. The collision probability is so low (1 in 5.3 × 10³⁶) that it is treated as zero for all practical purposes.
UUID vs GUID — Are They the Same?
GUID (Globally Unique Identifier) is Microsoft's term for UUID. They follow the same RFC 4122 specification and are completely interchangeable. The only cosmetic difference: Windows tools sometimes display GUIDs in uppercase with curly braces — {550E8400-E29B-41D4-A716-446655440000}. When a .NET or SQL Server API asks for a GUID, a standard UUID v4 works perfectly.
Common Use Cases
UUIDs are used as database primary keys in distributed systems, API resource identifiers in REST URLs (/users/550e8400-...), idempotency keys in payment APIs, session and authentication tokens, file names in object storage (S3, GCS), and device identifiers in mobile apps. Any situation requiring a globally unique ID without a central coordinator is a natural fit.
UUID Versions: v1, v3, v4, and v5 Explained
The UUID standard defines five versions, each using a different generation strategy. Understanding the differences helps you pick the right version for your use case.
Version 1 — Time-Based
UUID v1 combines the current timestamp with the MAC address of the generating machine. While unique across time and space, v1 UUIDs expose the host machine's MAC address and creation time — a privacy concern in user-facing contexts. They are rarely used in modern web applications.
Version 4 — Random (Most Common)
UUID v4 uses 122 bits of cryptographic randomness, making it the safest and most widely supported version. No machine info or timestamp is embedded, so it is privacy-safe. This is what most developers mean by "UUID," what this generator produces, and what crypto.randomUUID() returns in browsers and Node.js.
Versions 3 and 5 — Name-Based
v3 and v5 generate deterministic UUIDs from a namespace UUID and a name string. Given the same inputs, they always produce the same UUID — useful for consistent identifiers (e.g., always the same UUID for a given URL). v3 uses MD5 hashing; v5 uses SHA-1 and is preferred. Neither is suitable as a security token since the output is predictable.
UUID Best Practices for Developers
Using UUIDs effectively requires understanding storage, indexing, and language-specific APIs. Here are the most important considerations for production use.
Database Storage — BINARY(16) vs VARCHAR(36)
Store UUIDs as BINARY(16) in MySQL or the native uuid type in PostgreSQL — not as VARCHAR(36). BINARY(16) uses exactly 16 bytes, while VARCHAR(36) uses 36 bytes for the hyphenated form plus overhead. The smaller format improves index performance and reduces storage costs, especially in join-heavy schemas with millions of rows.
Generating UUIDs in Code
JavaScript/Node.js: crypto.randomUUID() (built-in). Python: uuid.uuid4() from the standard library. PHP: Ramsey/uuid package or com_create_guid(). Go: google/uuid package. PostgreSQL: gen_random_uuid(). MySQL 8+: UUID() for v1 or BIN_TO_UUID(UNHEX(REPLACE(UUID(),'-',''))) for better storage. All modern languages and databases have first-class UUID support.
Index Performance — Consider UUID v7 or ULID
Random UUID v4 values cause index fragmentation in B-tree indexes because new rows are inserted at random positions. For write-heavy tables, consider UUID v7 (time-ordered, draft RFC) or ULID (Universally Unique Lexicographically Sortable Identifier) — both provide the uniqueness of UUID while preserving insertion order for efficient indexing. Many modern ORMs and databases are adding native support.
FAQ
- What is a UUID v4?
- UUID v4 is a 128-bit identifier defined by RFC 4122. The bits are filled with cryptographically random values, making collisions astronomically unlikely. It is displayed as 32 hexadecimal digits grouped as 8-4-4-4-12 (e.g., 550e8400-e29b-41d4-a716-446655440000).
- Are the generated UUIDs truly unique?
- Yes. The probability of two v4 UUIDs colliding is approximately 1 in 5.3 × 10³⁶ — effectively zero for any real-world use. Even generating a billion UUIDs per second for 85 years would give only a 50% chance of a single collision.
- What is the difference between UUID and GUID?
- GUID (Globally Unique Identifier) is Microsoft's implementation of the UUID standard. They follow the same RFC 4122 spec and are interchangeable. The only cosmetic difference is that Microsoft GUIDs are sometimes written in uppercase with curly braces: {550E8400-E29B-41D4-A716-446655440000}.
- Which UUID version should I use?
- For most use cases, v4 (random) is the best choice — it's privacy-safe and universally supported. If you need time-ordered UUIDs for better database index performance, consider UUID v7 (not yet in this tool). Use v5 when you need the same UUID to be produced deterministically from a given name and namespace.
- How do I generate a UUID in JavaScript?
- Use the built-in Web Crypto API: crypto.randomUUID(). It returns a v4 UUID string and is available in all modern browsers and Node.js 14.17+. No library needed. Example: const id = crypto.randomUUID();
- How do I generate a UUID in Python?
- Use the built-in uuid module: import uuid; my_id = uuid.uuid4(). This produces a UUID object; call str(my_id) for the hyphenated string form. No external library required.
- Can I use UUIDs as database primary keys?
- Yes, but with caveats. UUIDs work well in distributed systems since no central coordinator is needed. The trade-off is size (16 bytes vs 4 bytes for INT) and index fragmentation with random v4 UUIDs in B-tree indexes. For better performance, store as BINARY(16) in MySQL or use the native UUID type in PostgreSQL, and consider UUID v7 or ULID for time-ordered inserts.
- Can I generate UUID v1 or v5?
- This tool generates v4 (random) UUIDs. v1 (time-based, embeds MAC address) and v5 (SHA-1 name-based) are not currently supported.
Found a bug or something not working as expected?
Report a bug →