🛠️ Web & Developer

UUID Generator

Generate cryptographically secure UUIDs instantly. Supports UUID v1, v4, and v7 — with bulk generation and multiple output formats.

Advertisement
🔑
UUID Generator

Generate universally unique identifiers (UUIDs) for databases, APIs, sessions, and development. All UUIDs are generated in your browser — nothing is sent to a server.

Advertisement

What is a UUID?

A UUID (Universally Unique Identifier) is a 128-bit identifier standardised by RFC 4122 that is designed to be unique across all space and time — without requiring a central authority to coordinate their generation. UUIDs are represented as 32 hexadecimal characters displayed in five groups separated by hyphens: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.

UUIDs are used extensively in software development as primary keys in databases, identifiers for API resources, session tokens, file names, and anywhere a unique identifier is needed without coordination between systems. Their uniqueness guarantee makes them ideal for distributed systems where multiple servers or clients need to generate IDs independently.

UUID v1 vs v4 vs v7 — Which Should I Use?

UUID v4 is the most widely used version. It’s randomly generated using a cryptographically secure random number generator, making it completely unpredictable. Use v4 for most general purposes — database primary keys, API tokens, session IDs.

UUID v1 is time-based, incorporating the current timestamp and the MAC address of the generating machine. This means v1 UUIDs are sortable by generation time but expose information about when and where they were created — a privacy consideration in some applications.

UUID v7 is the newest version (RFC 9562, 2024). It combines a Unix timestamp with random data, making UUIDs time-ordered while remaining unpredictable. This is ideal for database primary keys where you want natural time-based ordering without the privacy concerns of v1.

💡 For new projects using modern databases, UUID v7 is increasingly the recommended choice — it provides the random uniqueness of v4 with the database performance benefits of sequential, time-ordered IDs.

How Are UUIDs Generated?

This tool uses your browser’s built-in crypto.randomUUID() API for UUID v4 generation — the same cryptographically secure random number generator used by your operating system. For v1 and v7, the tool uses a JavaScript implementation. All generation happens entirely in your browser — no UUIDs are transmitted to any server.

UUID v4 format: xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx
where x = random hex digit, y = 8, 9, a, or b
Example: 550e8400-e29b-41d4-a716-446655440000

UUID v7 format: tttttttt-tttt-7xxx-yxxx-xxxxxxxxxxxx
where t = Unix timestamp ms, x = random, y = variant bits
Example: 018e3a1c-7b2d-7f3a-a4b2-1c3d5e7f9012

How to Use This UUID Generator

Select your UUID version (v4 for general use, v7 for database primary keys, v1 for time-based needs). Choose how many UUIDs to generate (1–100). Select your preferred case and output format. Click Generate — your UUIDs appear instantly. Click the copy button next to any UUID to copy it individually, or use “Copy All” to copy the entire list.

UUID Output Formats Explained

Standard: The default RFC 4122 format with hyphens — 550e8400-e29b-41d4-a716-446655440000. Use this for most applications. No Hyphens: The 32-character hex string without separators — commonly used in some databases and APIs that don’t accept hyphens. With Braces: {550e8400-e29b-41d4-a716-446655440000} — used in Windows registry, .NET, and some COM applications. Quoted: Wrapped in double quotes for direct use in JSON strings. JS Array: Formats all generated UUIDs as a JavaScript array for direct use in code.

Are These UUIDs Safe to Use in Production?

Yes — UUID v4 uses crypto.randomUUID() which is a cryptographically secure pseudorandom number generator (CSPRNG). The probability of two UUID v4 values colliding is astronomically small — roughly 1 in 5.3 × 10³⁶. For all practical purposes, UUIDs generated by this tool are guaranteed to be unique. They are safe for use as database primary keys, API identifiers, and session tokens.

UUID vs ULID vs CUID — What’s the Difference?

UUIDs are the most widely supported standard, available natively in virtually every programming language and database. ULID (Universally Unique Lexicographically Sortable Identifier) is a newer alternative that is URL-safe and sortable by creation time. CUID (Collision-Resistant Unique ID) is designed for horizontal scaling with a different character set. For most projects, UUID v4 or v7 is the right choice due to universal database and language support.

Using UUIDs as Database Primary Keys

UUIDs are excellent database primary keys in distributed systems where multiple nodes need to generate IDs independently without coordination. The main trade-off vs integer auto-increment keys is storage (16 bytes vs 4–8 bytes) and index performance — random UUID v4 values cause index fragmentation in B-tree indexes. UUID v7 solves this by being time-ordered, maintaining index locality while preserving uniqueness. PostgreSQL, MySQL 8+, and SQL Server all have native UUID column types.

Frequently Asked Questions

What does UUID stand for?
UUID stands for Universally Unique Identifier. It is also sometimes called a GUID (Globally Unique Identifier), particularly in Microsoft contexts — GUIDs and UUIDs are the same standard (RFC 4122) with different names. Both refer to the same 128-bit identifier format.
Can two UUIDs ever be the same?
Theoretically yes, but practically no. The probability of generating two identical UUID v4 values is approximately 1 in 5.3 × 10³⁶ — so small it’s considered impossible for any real-world application. You would need to generate approximately 2.7 × 10¹⁸ UUIDs before having a 50% chance of a single collision. For comparison, there are approximately 7 × 10²² stars in the observable universe.
Are these UUIDs truly random?
UUID v4 generation uses your browser’s crypto.randomUUID() — a cryptographically secure random number generator seeded by your operating system’s entropy sources (hardware events, timing, etc.). This is the same quality of randomness used for SSL/TLS and encryption. They are cryptographically random and unpredictable.
What is a UUID v4?
UUID v4 is a randomly generated UUID. All 128 bits are random except for 6 bits used to indicate the version (4) and variant. It follows the format xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx where the ‘4’ identifies version 4 and ‘y’ is constrained to 8, 9, a, or b to indicate the RFC 4122 variant. UUID v4 is the most common UUID version in use today.
What is the difference between UUID and GUID?
UUID and GUID are the same thing — both refer to 128-bit identifiers in the RFC 4122 format. “UUID” is the term used in the RFC standard and in most programming languages (Java, Python, JavaScript). “GUID” (Globally Unique Identifier) is Microsoft’s term, used in .NET, SQL Server, and Windows development. They are 100% interchangeable.
Should I use UUID v4 or v7 for my database?
For new projects, UUID v7 is increasingly recommended for database primary keys. UUID v4 is completely random, which causes index fragmentation in B-tree indexes as rows are inserted in random order. UUID v7 is time-ordered, so new records are always inserted at the end of the index — maintaining index locality and improving write performance, especially at scale. UUID v4 remains perfectly fine for lower-volume applications or non-primary-key uses.
How long is a UUID?
A UUID is 128 bits (16 bytes) in its raw form. When displayed in the standard string format with hyphens, it is 36 characters long (32 hex digits + 4 hyphens). Without hyphens, it is 32 characters. In most databases, UUIDs are stored as a native 16-byte binary type rather than as a string, saving storage space.
Is it safe to use UUIDs as public-facing IDs?
UUID v4 is safe to use as public-facing IDs — they are unpredictable and don’t expose any information about your data (unlike sequential integers, which reveal how many records exist). UUID v1 should not be used as public IDs because they encode a timestamp and MAC address. UUID v7 encodes a timestamp, which reveals creation time but not other sensitive information — usually acceptable for public use.
How do I generate a UUID in code?
In JavaScript/Node.js: crypto.randomUUID(). In Python: import uuid; uuid.uuid4(). In Java: UUID.randomUUID(). In PHP: Str::uuid() (Laravel) or ramsey/uuid package. In PostgreSQL: gen_random_uuid(). In SQL Server: NEWID(). In Go: use the google/uuid package. All modern languages and frameworks have native UUID generation support.
Advertisement
Scroll to Top